ipt_pkd: The port knock detector!

December 6, 2009 23:29 pm · 0 comments

by Black

in Open Source,Security tools

If you have read our last few posts, you already what a port knock is. We had mentioned about it here when we wrote about winKnocks. Today, we are going to blog about ipt_pkd.

Port knocking per se can be very dangerous if you were to try it on your own firewall without any authentication mechanism. winKnocks is a good option though its implementation is mainly for Windows. So what do you do to protect your Linux based firewall, when you do want to use an option of port knocking? Simple – use ipt_pkd! ipt_pkd is an iptables extension implementing port knock detection. It makes use of single packet authorization. The knock packet is a sha256 of a timestamp, some random bytes, a small header, and a shared key, sent via udp. The timestamp and the bytes are passed in the packet so the server can do the sha256 and compare the results.  If its a match then the pkd module returns true, otherwise false and any more packets from the sender are dropped. To eliminate a replay attack, the source and destination ports are used in the hash!

There are two versions – one in C and the other in Python. The open source package has a small python script-knock.py which is a python implementation of ipt_pkd which reads the necessary information from ipt_pkd.ini. You can have it accept 3 options – a 40 bytes long-hex-shared key, a window (time until it waits for a valid knock from a system) and a 4 byte long tag which helps in speeding up the processing. You can make use of “hitcount” to maintain a control over the number of times you would like the knock until it is dropped,reset, etc.

Download ipt_pkd here.

If you enjoyed this article, you might also like:

  • February 7, 2010 -- UPDATE: ipt_pkd 1.6!
    We blogged about ipt_pkd in our previous posts here.So, "ipt_pkd is an iptables extension implem...
  • April 4, 2010 -- SOURCE: Linux Keylogger!
    Thought that we should share a basic Linux keylogger source code, since there are many ope source Wi...
  • December 3, 2009 -- winKnocks: An encrypted port knocking tool!
    Port knocking is a method of externally opening ports on a firewall by generating a connection attem...
  • April 23, 2009 -- Tutorial: Basic IPTABLES Firewall rules
    Guys, I was at a friends home and he wanted to know about a few basic rules that will help him secur...
  • August 20, 2010 -- UPDATE: XSSer v0.7a!
    All of you web application penetration testers, check out this release of XSSer version 0.7a, for i...
  • August 16, 2010 -- UPDATE: Websecurify 0.7!
    Good news for Websecurify lovers, as we have an updated Websecurify version 0.7 amongst us finally! ...
  • August 14, 2010 -- ROPEME – ROP Exploit Made Easy
    ROPEME is a PoC tool for ROP exploit automation on Linux x86. It contains a set of simple Python scr...
  • August 10, 2010 -- UPDATE: PacketFence 1.9.0!
    PacketFence is a free and open source network access control (NAC) system and the reason for us wri...
  • August 9, 2010 -- UPDATE: Websecurify 0.7RC2!
    Right on time this time! We have an updated Websecurify version 0.7RC2 amongst us now!“Websecu...

Previous post:

Next post: