Skip to contentSkip to conversation

new match extension to implement port knocking in one

DISCUSSION Luis Floreani 3 participants 5 messages Oct 11, 2006 – Oct 13, 2006 netfilter

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines

If you're interested in port knocking, you might want to read this
paper: http://www.acsac.org/2005/abstracts/156.html It covers security issues relating to port knocking in detail, and presents an architecture for solving most of them.

Full disclosure: I wrote that paper. Feel free to contact me if you have questions.

Rennie deGraaf

In our implementation, for security, we are using the Tumbler protocol, we found it simple yet powerful, check it out here:
http://tumbler.sourceforge.net/.

Well, hope to read you paper soon and give you some feedback.

Luis

#1 lore raw
Quoted 5 lines · Luis Floreani
Quoted 5 lines

If you're interested in port knocking, you might want to read this
paper: http://www.acsac.org/2005/abstracts/156.html It covers security issues relating to port knocking in detail, and presents an architecture for solving most of them.

Quoted 8 lines
Quoted 4 lines

Full disclosure: I wrote that paper. Feel free to contact me if you have questions.

Rennie deGraaf

In our implementation, for security, we are using the Tumbler protocol, we found it simple yet powerful, check it out here:
http://tumbler.sourceforge.net/.

It seems that Tumbler is not capable of working across NAT, unless the client can somehow obtain its public IP address. Also, it relies on clocks being synchronized, since authentication will fail if the UTC time in minutes is not identical on the client and server. Tumbler is not as stealthy as the techniques in Rennie deGraaf's paper, since it uses an open UDP port.

Finally, I doubt the cryptographic security of the Tumbler protocol - it relies on a SHA256 hash over the UTC time (in minutes), the client's IP and the shared secret. Observing a few authentications from the same client will give you hashes of strings with known prefixes (time + IP) and a fixed suffix (the secret). The insertion of the optional username between the time and IP (not at the end as documented) increases security slightly by making the pattern known,fixed,known,fixed but I think some attacks will still be possible because there are multiple ralated plaintexts with no random parts.

Alexey

#2 lore raw
Quoted 1 line · Alexey Toptygin

Finally, I doubt the cryptographic security of the Tumbler protocol - it relies on a SHA256 hash over the UTC time (in minutes), the client's IP and the shared secret. Observing a few authentications from the same client will give you hashes of strings with known prefixes (time + IP) and a fixed suffix (the secret). The insertion of the optional username between the time and IP (not at the end as documented) increases security slightly by making the pattern known,fixed,known,fixed but I think some attacks will still be possible because there are multiple ralated plaintexts with no random parts.

Never mind this last bit, I wasn't thinking clearly.

Alexey

#3 lore raw
In reply to Alexey Toptygin
Quoted 16 lines · Alexey Toptygin
Quoted 5 lines · Luis Floreani
Quoted 5 lines

If you're interested in port knocking, you might want to read this
paper: http://www.acsac.org/2005/abstracts/156.html It covers security issues relating to port knocking in detail, and presents an architecture for solving most of them.

Quoted 8 lines
Quoted 4 lines

Full disclosure: I wrote that paper. Feel free to contact me if you have questions.

Rennie deGraaf

In our implementation, for security, we are using the Tumbler protocol, we found it simple yet powerful, check it out here:
http://tumbler.sourceforge.net/.

Quoted 6 lines

It seems that Tumbler is not capable of working across NAT, unless the client can somehow obtain its public IP address. Also, it relies on clocks being synchronized, since authentication will fail if the UTC time in minutes is not identical on the client and server. Tumbler is not as stealthy as the techniques in Rennie deGraaf's paper, since it uses an open UDP port.

Why not use fwknop in Single Packet Authorization mode?:

http://www.cipherdyne.org/fwknop/

(Disclosure: I wrote it).

Here are some of the highlights (parts of this are related to both the original poster's question and the Alexey's observation above about the open UDP port in Tumbler):

- Support for both asymmetric and symmetric encryption via Rijndael and GnuPG. If GnuPG is used, then fwknop verifies that the data is both signed and encrypted. Any multi-packet port knocking scheme would have serious difficulty in using an asymmetric cipher because of the generally long key lengths and resulting size of encrypted data.
- No open ports on the server side; all packet data is monitored via a sniffer. Iptables should be configured in a default-drop stance for all protected services and for the port on which the SPA packet is sent (UDP 62201 by default, but fwknop also supports sending over ICMP and over a blind TCP ACK packet).
- Automatic reconfiguration of the local iptables policy via the IPTables::ChainMgr perl module; this is not as cool as using a netlink socket to communicate to a userspace program, but doing the knock verification in the kernel itself limits your options for doing things like using GnuPG.
- Because an encrypted payload is used, any access directive can be used instead of just a pre-determined set of access directives for which the hashes can be worked out as in the Tumbler protocol. A full command channel is also supported by fwknop.
- SPA packets are non-replayable in both asymmetric and symmetric encryption modes due to the fact that 16 bytes of random data is included within every packet, and the md5 sum is tracked (and written to disk) on the server side.
- Support for multiple users, each with their own encryption keys and authorization rules.
- Support for a time window over which an SPA packet is accepted (this feature can easily be disabled if time synchronization is a problem).
- Custom patch against openssh, so (after fwknop is run against <host> for the first time so it can cache your command line arguments) you can just do:

ssh -K "-L <host>" user@host

--
Michael Rash
http://www.cipherdyne.org/
Key fingerprint = 53EA 13EA 472E 3771 894F AC69 95D8 5D6B A742 839F

#4 lore raw
In reply to Alexey Toptygin
Quoted 10 lines · Alexey Toptygin
Quoted 8 lines · Luis Floreani
Quoted 8 lines

If you're interested in port knocking, you might want to read this
paper: http://www.acsac.org/2005/abstracts/156.html It covers security issues relating to port knocking in detail, and presents an architecture for solving most of them.

Full disclosure: I wrote that paper. Feel free to contact me if you have questions.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Rennie deGraaf

In our implementation, for security, we are using the Tumbler protocol, we found it simple yet powerful, check it out here:
http://tumbler.sourceforge.net/.

It seems that Tumbler is not capable of working across NAT, unless the client can somehow obtain its public IP address.

Yes, with our implementation you need to know the public IP. On the other hand, the Rennie implementation makes that easier, but from a security point of view, both ways leaves the service open to the public IP address, so anybody behind the NAT has the service port open. That's a general problem with PK.

Quoted 3 lines

Also, it relies on clocks
being synchronized, since authentication will fail if the UTC time in minutes is not identical on the client and server.

it's very easy to sync a clock, you can do it with "rdate". e.g: $ rdate time-a.nist.gov

Quoted 3 lines

Tumbler is not as
stealthy as the techniques in Rennie deGraaf's paper, since it uses an open UDP port.

In our netfilter extension, the knock ports are CLOSED, also, the server never sends an answer to any client knock, which really means being "stealthy".