Code Monkey home page Code Monkey logo

port-knocker's Introduction

Port knocker script for bash

A simple bash script for knocking on TCP and UDP ports. Accepts unlimited number of ports. Delay between knocks can be adjusted.
Tested on Debian and CentOS, but should run on any OS with bash installed.
No dependencies!

Usage

Download the script, make it executable and run it.

curl https://raw.githubusercontent.com/kolbasky/port-knocker/main/knocker.sh > knocker.sh
chmod +x knocker.sh
./knocker.sh --host(-h) sample.server.net --ports(-p) udp:111,tcp:222,... [--delay(-d) 0.1s]

Parameters are accepted in numerous forms.

./knocker.sh -h server -p udp:111,tcp:222 -d 0.2s
./knocker.sh --host=server --ports=udp:111,tcp:222,udp:333
./knocker.sh host server -p udp:111 -p=tcp:222 --p udp:333 --delay=1s

So are the ports:
tcp:111 or 111:tcp or 111tcp or 111/tcp or TCP@111 etc

Any way you want it :-)

Parameters

  • [--]host|-h hostname or IP address to knock. Mandatory argument.
  • [--]ports|-p comma-separated list of ports to knock, can be used multiple times. Mandatory argument.
    Example: -p tcp:123,udp:321,tcp:433 or -p tcp:123 -p udp:321,tcp:433 etc
  • [--]delay|-d delay between knocks. Optional argument. Default: 0.1s
  • [--]help show help message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.