Slashdot Mirror


"Port Knocking" For Added Security

Jeff writes "The process of Port Knocking is a way to allow only people who know the "secret knock" access to a certain port on a system. For example, if I wanted to connect via SSH to a server, I could build a backdoor on the server that does not directly listen on port 22 (or any port for that matter) until it detects connection attempts to closed ports 1026,1027,1029,1034,1026,1044 and 1035 in that sequence within 5 seconds, then listens on port 22 for a connection within 10 seconds. The web site explains it in some detail, and there is even an experimental perl implementation of it that is available for download. I can't think of any easy ways you could get around a system using this security method - let alone even know that a system is implementing it. Another article on port knocking is here."

6 of 950 comments (clear)

  1. Silent Bob by Sanity · · Score: 5, Informative
    A few years ago Freenet implemented something similar to this called "Silent Bob". The name comes from Alice and Bob, the names given to sender and receiver respectively when describing cryptographic protocols.

    The idea was that you didn't want to disclose that you were running a Freenet node unless the person connecting to you already knew your node's public key.

    So when someone wants to establish a connection to you, they must send some encrypted data providing they know your public key. Your node can receive this data and only respond if it is correct. Furthermore, you could let your Freenet node sit on port 25, for example, and forward invalid connection attempts to a mail server on a different port.

    Through this mechanism, your Freenet node could quite effectively hide behind another server, only making itself known to those already part of the Freenet network.

    IIRC this wasn't actually implemented in Freenet, but it is the intention to add it at some point. Still, it is amazing how many ideas were pioneered by Freenet years ago and are only showing up in the wider public conciousness now.

  2. Old Idea, Different Use by jsonic · · Score: 5, Informative

    The shady side of hackerdom has been using this very technique to hide their backdoors from port scanning admins. Or, uh, so I've heard...

  3. Re:Brute Force by HeghmoH · · Score: 5, Informative

    Somebody do the math, but it doesn't look to be that secure. Brute-forcing this would not take long.

    Assuming a 5 'letter' password, you have (2^16 - 1024)^5 possible passwords, which is 1.1 X 10^24. Assuming both the server and the attacker are on fat pipes and the server is implemented in a dumb way so that it doesn't recognize brute-force attempts, you could pull off perhaps 100 attempts per second. So it would take you about 10^22 seconds, or 350 trillion years.

    In security, I think this technique is comparable to a reasonably strong plaintext password. It can be sniffed, but it can't really be brute-forced.

    Today's show was brought to you by Google Calculator.

    --
    Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
  4. Re:Open a whole range of ports by ViXX0r · · Score: 5, Informative

    The summary says that the ports to knock on are closed. Portscanning shouldn't reveal which ones are available to be knocked on.

    --
    University - a box of academia nuts.
  5. Re:Well, there go the logfiles by smeenz · · Score: 5, Informative
    When a port is 'open', that means there's a process listening for connections on that port

    When a process is listening for new connections, it doesn't block existing connections from carrying on sending and receving data

    When a port is 'connected', it means that a process has an established connection to another host.

    Therefore, no, just because a port is not listening/open, doesn't prevent an existing connection from sending and receiving data.

    If that was the case, then the first person to telnet/ssh to your box would tie up that port and a second connection would be blocked until the first had freed up the port, however that is not what happens at all.

    All they're saying is that when the portknocking daemon detected the correct knock sequence on closed ports, it starts a process to LISTEN for new connections, ideally from just the host that did the knocking, for a limited period of time (10 seconds). Once a TCP connection is established with the listening host, that host no longer needs to listen, and that's why it stops after 10 seconds.

  6. security through obscurity? no sorry by wolfdvh · · Score: 5, Informative
    For all of you arguing that port knocking is security through obscurity, please take a couple minutes and read this article from the site:

    http://www.portknocking.org/view/about/obscurity

    It does a much better job of explaining this than anything yet posted here.