Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kchr/knack
Port knocking client for command-line usage
https://github.com/kchr/knack
Last synced: 5 days ago
JSON representation
Port knocking client for command-line usage
- Host: GitHub
- URL: https://github.com/kchr/knack
- Owner: kchr
- License: gpl-3.0
- Created: 2014-12-06T11:26:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-19T14:19:33.000Z (over 8 years ago)
- Last Synced: 2024-04-22T01:22:00.591Z (7 months ago)
- Language: Python
- Size: 19.5 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - kchr/knack - Port knocking client for command-line usage (others)
README
knack
=====Port knocking client for command-line usage
This is a minimal client implementation of the port knocking model.
It basically tries to connect to a given set of ports on a remote host, without sending or receiving any data. The idea is that the remote host is listening for a specific pattern of ports to be opened in sequence, and then acting upon it in some fashion (mostly opening arbitrary ports for later usage). This can be used to keep weak services hidden from the public but accessible through simple TCP/IP operations.
Most port knocking setups involve a series of dummy (unused) ports being monitored for connection attempts. To keep the operation as stealth as possible the server should not reply to these requests, only register them. This makes it possible for other ports to be thrown in to confuse someone sniffing the wires, but makes it impossible for the client to separate packet loss from received knocks (both would time out if server is not configured to reply).
Therefore this application will only treat local network (and routing) errors as fatal. Timeouts and completed attempts are treated as equally good knocks!
Note that this package does not handle the listening/server part of the port knocking protocol in any way, it only knocks. Please see [knockknock](https://github.com/moxie0/knockknock) for a server.
More information:
https://en.wikipedia.org/wiki/Port_knocking
http://www.portknocking.org/view/resources
Usage
-----$ knack [-h] [-t TIMEOUT] [-v] [-w WAIT] HOST PORT [PORT ...]
positional arguments:
HOST Hostname to knock at
PORT Port(s) to use, in order specified
optional arguments:
-h, --help show this help message and exit
-t TIMEOUT, --timeout TIMEOUT
Timeout for connection attempt (seconds), default 10
-v, --verbose Show detailed information
-w WAIT, --wait WAIT Time to wait between knocks (seconds), default 1.0A successful operation is silent, unless you supply the verbose flag (this will also show the reason for any failed attempts).
Return code is 0 for success and 1 for failures.