fwknop

Open source

fwknop implements Single Packet Authorization, hiding services such as SSH behind a default-drop firewall until a valid encrypted packet arrives.

cipherdyne.org
fwknop homepage screenshot
GitHub stars
1.5k
Last 30 days
+23(+2%)
Last commit
5 mo ago
Repository age
15 years
Version
2.6.11
Licence
GPL-2.0
Self-hosted
Yes

About fwknop

fwknop, short for FireWall KNock OPerator, implements Single Packet Authorization (SPA), described as a next generation of port knocking. It works with a default-drop packet filter and libpcap, and supports iptables and firewalld on Linux, ipfw on FreeBSD and Mac OS X, and PF on OpenBSD.

A client sends a single encrypted packet that carries the requested access through the firewall policy, or even commands to run on the target. The server side passively sniffs these packets, so there is no listening server in the traditional sense, and access is granted only after an authenticated, decrypted, non-replayed packet is seen.

The main use is to add a layer of protection to services like OpenSSH. According to the author, someone scanning with nmap cannot tell that sshd is listening, which makes both password cracking and 0-day exploits much harder. The site offers a tutorial, documentation, source on GitHub, and lists 2.6.11 as the latest release.

Key features

  • Single Packet Authorization instead of multi-port knocking
  • Asymmetric cipher option for encryption
  • HMAC authentication in encrypt-then-authenticate order
  • Packets cannot be replayed
  • Works with iptables, firewalld, ipfw, and PF
  • Packets can carry commands to execute on the target

Good fit for

  • Hiding SSH from port scans
  • Adding a layer ahead of unpatched services
  • Replacing traditional port knocking
Built with
Perl tools
Tags
port knocking
firewall
single packet authorization
ssh
network security
iptables

fwknop: questions and answers

What is fwknop used for?
fwknop implements Single Packet Authorization, hiding services such as SSH behind a default-drop firewall until a valid encrypted packet arrives. It is a good fit for hiding SSH from port scans, adding a layer ahead of unpatched services and replacing traditional port knocking.
Is fwknop open source?
Yes. fwknop is open source under the GPL-2.0 licence. Its source code is on GitHub at mrash/fwknop and is written mainly in Perl.
Is fwknop free?
Yes. fwknop is open source, so the software itself is free to use.
Can I self-host fwknop?
Yes. fwknop can be self-hosted on your own server or infrastructure.
What are some alternatives to fwknop?
Similar open-source tools in the Security category include fail2ban, step-ca and ModSecurity. SaaS products in the same category include Fortinet, SonicWall and Untangle NG Firewall.
Is fwknop actively maintained?
The most recent commit to fwknop was on 1 June 2026, and the latest release is 2.6.11, published on 7 February 2024. The project has 1.5k stars on GitHub, with 23 added in the last 30 days.

Open-source alternatives to fwknop

See all

SaaS alternatives to fwknop

See all