knock(1)

πŸ’… knock(1) β€” the port-knock client, bestie edition ✨

okay so you found the knock(1) man page and you're like "what is this" β€” don't worry, we're gonna get through it together 🫢 this is the manual for knock, and it's genuinely so much fun once it clicks.

🌸 NAME 🌸

knock β€” a port-knock client. that's the whole vibe. it knocks. on ports. iconic behavior tbh πŸ‘‘

✨ SYNOPSIS ✨

knock [options] <host> <port[:proto]> [port[:proto]] ...

so it's knock, then whatever options you want, then the host, then one or more ports β€” and each port can optionally have :proto stuck on the end if you're feeling fancy πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

knock is a port-knock client, periodt. what it does is send TCP/UDP packets to each port you specify on host, and by doing that it creates a special knock sequence on the listening server. that's the whole trick β€” the server is listening for a specific little rhythm of knocks and you're out here performing it πŸŽ€

if you wanna know the server side of this whole situation, go read the knockd manpage β€” that's where the extra info lives πŸ‘€

πŸŽ€ OPTIONS πŸŽ€

  • -u, --udp β€” makes all your port hits use UDP instead of TCP (TCP is the default, fyi). but bestie, if you want each port to use a different protocol (some TCP, some UDP), you can just specify the protocol per-port instead. see the examples down below for how that looks ✨
  • -d <t>, --delay <t> β€” waits <t> milliseconds between each port hit. why would you want this? because sometimes your router sees your stream of SYN packets and is like "omg is this a port scan???" and blocks them 😭 but if you slow the packet rate down with --delay, then the router should let the packets through. crisis averted πŸ’–
  • -4, --ipv4 <version> β€” forces usage of IPv4 🧚
  • -6, --ipv6 <version> β€” forces usage of IPv6 🌈
  • -v, --verbose β€” outputs verbose status messages, so you actually get to see what's happening instead of vibing in the dark πŸ”₯
  • -V, --version β€” displays the version. short and sweet πŸ“
  • -h, --help β€” syntax help. your little safety net when you forget how anything works πŸ™ˆ

πŸ‘‘ EXAMPLES πŸ‘‘

okay these are the moment, fr fr. first one β€” mixed protocols per port:

knock myserver.example.com 123:tcp 456:udp 789:tcp

see how each port gets its own :tcp or :udp? that's the per-port protocol thing from earlier. slay πŸ¦‹

and then this one β€” all UDP, no per-port labels needed because of -u:

knock -u myserver.example.com 8284 4721 18592 42912

look at that lil sequence of port numbers just knocking away 😭 so satisfying

πŸ’œ SEE ALSO πŸ’œ

knockd is the accompanying port-knock server β€” the other half of this whole relationship. you can't knock without somebody listening, iykyk 🫢

🌟 AUTHOR 🌟

Judd Vinet <jvinet@zeroflux.org> β€” the icon who made this happen πŸ‘‘


and that's the whole page, bestie!! this version of the knock page comes to you from knockd 0.8.2, dated June 26, 2005 β€” yeah it's an oldie but it still ate πŸ’…βœ¨ go knock on some ports, you've got this πŸŽ€

πŸ“¦ where this page comes from