The sys admin's daily grind: Single-packet authenticationBy
Conventional, woodpecker-style port knocking is open to sniffing and brute force knocking attacks. Sending an encrypted packet with an access request to the server is safer and more modern. Learn more about Firewall Knock Operator, a.k.a. Fwknop.
Conventional port knocking, which I described last month, protects you against attackers who routinely scan whole networks looking for "low-hanging fruit." A cracker who takes more time and logs communications can also identify knocking signals because the sequences will repeat.
In theory, you might consider using lists of one-off knocking signals that become obsolete after use. Unfortunately, this is really complex. Besides, if the administrator is not creative enough, an attacker could just try out popular knocking sequences (port 7000, 8000, 9000, ?) to gain access.
Single-Packet Authentication (SPA) is one possible solution. The knocking system sends a single packet containing the encrypted authentication credentials – typically a pass phrase – and the client request to open a specific port. An SPA implementation that works really well is Firewall Knock Operator, or Fwknop . Besides the normal build tools, the installation requires Perl, the libpcap-dev package, and the CPAN Net::Pcap module. After installing all of these resources, installing Fwknop is a breeze thanks to the Perl-based installer.
Fwknop comprises the fwknopd server and the fwknop client. By editing two files below /etc/fwknop/, you can configure the server; fwknop.conf contains the basic configuration. Initially, you will just need to change a couple of parameters, which are tagged __CHANGEME__.
The other knobs you could tweak here have very sensible defaults. Note that you need to synchronize the time between the server and the client because if the difference is too big, fwknopd will ignore the knocking client.
The entries in /etc/fwknop/access.conf define how fwknopd responds to a client knocking. The secret key that the client uses to identify itself is stored here. The SOURCE line can be used to restrict the networks from which the daemon accepts knocking. To set the port that the system opens on successful knocking – for example, tcp/22 for SSH – you can use OPEN_PORTS. Figure 1 shows a successful attempt. The fwknop client picks up the key from its own /etc/fwknop/access.conf.
If the SSH connection doesn't open quickly enough, the FW_ACCESS_TIMEOUT on the server triggers. This time is normally set to 30 seconds, but I went for twice that – never rush an admin on the job!
Charly Kühnast is a Unix operating system administrator at the Data Center in Moers, Germany. His tasks include firewall and DMZ security and availability. He divides his leisure time into hot, wet, and eastern sectors, where he enjoys cooking, fresh water aquariums, and learning Japanese, respectively.
VMware bids for a stake in the container industry with a bold effort to integrate containers with its classic virtualization system.
3ROS attack tool lowers the technical bar so anyone can be an intruder.
Mozilla's latest browser offers powerful new privacy feature
If attackers are on your system, saving your passwords in a password vault is no protection.
Faulty hash algorithm persists, despite efforts by experts to raise awareness.
Powerful man-in-the-middle attack is now targeting online shopping.
Another high-profile coder says the kernel team needs a kinder, gentler culture.
Bug database has a bug of its own that could allow an intruder to create an unauthorized account.
Report focuses federal resources on achieving universal Internet access.
Leading browser makers say “no” to porous encryption algorithm