LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

knock

client component of port knocking

TLDR

Knock on a sequence of ports
$ knock [hostname] [port1] [port2] [port3]
copy
Knock on ports with specified protocol
$ knock [hostname] [port]:tcp [port]:udp
copy
Knock using UDP as default protocol
$ knock -u [hostname] [port1] [port2] [port3]
copy
Knock with a delay between each knock (in milliseconds)
$ knock -d [500] [hostname] [port1] [port2]
copy
Display verbose output while knocking
$ knock -v [hostname] [port1] [port2] [port3]
copy

SYNOPSIS

knock [options] hostname port[:protocol]...

DESCRIPTION

knock is the client component of port knocking. Port knocking is a security technique where a firewall opens specific ports only after receiving a predefined sequence of connection attempts ("knocks") on closed ports.The client sends packets to the specified ports in sequence. When the server (knockd) detects the correct sequence, it executes configured commands, typically to open a firewall port for the client's IP address.

PARAMETERS

-u, --udp

Use UDP instead of TCP
-4
Force IPv4
-6
Force IPv6
-v, --verbose
Display verbose information
-d, --delay MS
Delay between knocks in milliseconds

INSTALL

sudo apt install knockd
copy
sudo dnf install knock
copy
sudo pacman -S knockd
copy
sudo apk add knock
copy
sudo zypper install knockd
copy
brew install knock
copy
nix profile install nixpkgs#knock
copy

CAVEATS

Port sequence must be kept secret. Network issues can cause knock sequences to fail. Not a replacement for proper authentication but an additional security layer.

HISTORY

Port knocking emerged as a security technique in the early 2000s to hide services from port scanners. The knock/knockd implementation is one of the most widely used port knocking solutions.

SEE ALSO

knockd(1), iptables(8), nmap(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid