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."

950 comments

  1. Oh, really. by Anonymous Coward · · Score: 1, Insightful

    I predict a flood of commenters whining about this being "security through obscurity."

    1. Re:Oh, really. by Anonymous Coward · · Score: 0

      To me, this looks like security through obscurity.

    2. Re:Oh, really. by Anonymous Coward · · Score: 0

      :-)

      Cat got my tongue.

    3. Re:Oh, really. by Anonymous Coward · · Score: 2, Interesting

      I predict a flood of commenters whining about this being "security through obscurity."

      Yeah, just like passwords are "security through obscurity."

      This is essentially another level of passwords, but sounds useful for hiding those services that could have vulnerabilities *cough* OpenSSH *cough*.

      Will this technique itself have possible vulnerabilities?

    4. Re:Oh, really. by Anonymous Coward · · Score: 0

      Your tongue is cat gut.

    5. Re:Oh, really. by Anonymous Coward · · Score: 0

      Sniffing to see what port attempts are made, and of course replaying those attempts.

    6. Re:Oh, really. by aldousd666 · · Score: 1

      Well, this is only security by obscurity in the same way that putting a combination lock on a safe is security through obscurity.

      --
      Speak for yourself.
    7. Re:Oh, really. by MCZapf · · Score: 2, Informative

      They gave away half of their "obscurity" by releasing the concept to the world. If they were really interested in the security aspect of port-knocking, they wouldn't have posted the concept on the WWW. As an unobscure authentication system, I feel its value is quite limited.

    8. Re:Oh, really. by orangesquid · · Score: 2, Informative

      Yeah, but you don't send out public packets when opening a combination lock.

      Plus, thing about it this way:
      * someone notices an SSH connection
      * someone portscans, notices port 22 is closed
      * someone thinks, "hm, there was that /. article..."
      * someone waits around for you to re-connect, and watches what closed ports you connect to

      See? that easy.

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    9. Re:Oh, really. by aldousd666 · · Score: 1

      They have to be already in to get a sniffer on there. Arp cache poisoning etc are all very noisy so you can tell if someone is trying to insert a sniffer, and thus the port knocking is another step that must be traversed before one can break in. You can't just 'see' what ports people connect to on arbitrary hosts unless your on a span port, you're a router, or you've already compromised their systems.

      --
      Speak for yourself.
    10. Re:Oh, really. by Mod+Me+God · · Score: 1

      Perhaps they've already had their fun, or else perhaps they are just not criminals. Either way, if they can make the port scanning seem like noise (e.g., use a seemingly random code) people knowing or not knowing about it doesn't matter (remeber they'd already have to have some kind of backdoor to be activated somehow).

      --
      --

      FreeNET user? Comfortable with the adverse selection?
    11. Re:Oh, really. by Anonymous Coward · · Score: 0

      in essence, everything is security through obscurity .. security is in itself obscurity, almost be definition .. absolute security is an illusion

      as for this port knocking stuff, its only as secure as the point at which i can set up a sniffer and check to see what requests are going where .. then i have the 'secret knock' .. clever, but you're stupid if you rely on it

      you want security? .. disconnect your box from the goddamn intarweb

    12. Re:Oh, really. by Anonymous Coward · · Score: 1, Insightful

      Well the port ends up being open for a few seconds so that you can connect. Someone else could technically connect then and exploit you. Especially on a busy box, the port would end up being open pretty often. A better idea would be a lower level tcpd-like system where the port looks closed to all ip addresses by default, but only certain ips will be able to complete the tcp handshake. Still a silly idea though. Just use ipsec to open a VPN tunnel, and be done with these half-assed "cute" security ideas.

    13. Re:Oh, really. by srmalloy · · Score: 3, Funny
      I predict a flood of commenters whining about this being "security through obscurity."
      Well, it worked reasonably well for the speakeasies during Prohibition. Unfortunately, the FBI's DOS attacks were also more effective then...
    14. Re:Oh, really. by jobsagoodun · · Score: 1

      depends where the server is. A co-lo service I have used was full of rooted boxen which were in promisc - they would have been able to sniff this approach.

    15. Re:Oh, really. by aldousd666 · · Score: 1

      that's a good point, but I would say that only in that kind of situation is the port knocking not really helpful. Most cases port knocking would help out quite a bit.

      --
      Speak for yourself.
    16. Re:Oh, really. by Gyorg_Lavode · · Score: 1
      This was addressed in the encrypting the port knock portion of the document.

      And there are other reasons a person wouldn't be able to connect to the port other than port knocking.

      Finally, if someone has all this information, the strength of port knocking is probably the least likely of your problems.

      --
      I do security
    17. Re:Oh, really. by orangesquid · · Score: 1

      That's very true. There are ways to make the port knock less predictable, in a way much similar to SMART cards, or put it through an encrypted tunnel, or such (like most slashdotters, I speak all my opinions *before* even bothering with the article, so I don't know what was actually mentioned).

      But, I just want anybody who thinks "Oh, OK, this is a simple way to get infinite security!" to be uh... less disillusioned? :)

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    18. Re:Oh, really. by gnu-generation-one · · Score: 1

      "To me, this looks like security through obscurity."

      Well my password is secure because it's obscure, does that count?

    19. Re:Oh, really. by JWSmythe · · Score: 1

      It's not like your solution is very hard either. A decently set up ipchains/iptables script at boot time can easily handle that. If no ports are accessable other than by authorized networks, it makes things fairly tight.

      I do that on a lot of servers, where only port 80 is accessable to the Internet, and my SSH port (reassigned for a little security through obscurity myself).

      Here's my script. By default, this machine would be invisible to the rest of the Internet. I just uncomment whatever needs to be accessable. It should be tuned to your own tastes. I'm sure some people will argue parts of the ICMP, but others will agree that it can be blocked completely. Honestly, it causes no problems like this. Parts may not be correct, I put some entries in here that I've never actually used. I have an iptables version also, but it's not as well tested as this one is.

      #!/bin/tcsh
      # rc.firewall
      # secure yer webserver
      # 04.24.2003(d) Edition -pv

      echo "Firewall, Flushing"
      /sbin/ipchains -F input
      /sbin/ipchains -F output
      /sbin/ipchains -F forward
      /sbin/ipchains -A input -i lo -d 0/0 -j ACCEPT

      echo "Firewall, Starting"

      # Put Enemy Networks Here
      #/sbin/ipchains -A input -b -p tcp -s aa.bb.cc.0/24 -d 0/0 -l -j DENY

      # Remote services
      # Accept web viewers
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 80 -j ACCEPT # Port 80 - Web Server
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 443 -j ACCEPT # Port 443 - Secure Server
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 8000 -j ACCEPT # Port 8000 - Alternate Web Port
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 8080 -j ACCEPT # Port 8080 - Alternate Web Port
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 21 -j ACCEPT # Port 21 - FTP Server
      #/sbin/ipchains -A input -b -p tcp -s 0/0 -d 0/0 20 -j ACCEPT # Port 20 - FTP Server (FTP-Data)
      #/sbin/ipchains -A input -b -p tcp -s 0/0 50000:50050 -d 0/0 -j ACCEPT # -FTP Data Ports
      #/sbin/ipchains -A input -b -p udp -s 0/0 50000:50050 -d 0/0 -j ACCEPT # -FTP Data Ports
      #/sbin/ipchains -A input -b -p tcp -s 0/0 -d 0/0 25 -j ACCEPT # Port 25 - SMTP Mail Server
      #/sbin/ipchains -A input -p tcp -s 0/0 25 -d 0/0 -j ACCEPT # Outbound Email
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 110 -j ACCEPT # Port 110 - POP3 Mail Server
      #/sbin/ipchains -A input -b -p tcp -s 0/0 -d 0/0 113 -j ACCEPT # Port 113 - ident
      #/sbin/ipchains -A input -b -p udp -s 0/0 -d 0/0 113 -j ACCEPT # Port 113 - ident
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 143 -j ACCEPT # Port 143 - imap
      #/sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 13 -j ACCEPT # Port 13 - daytime
      #/sbin/ipchains -A input -b -p tcp -s 0/0 -d 0/0 53 -j ACCEPT # Port TCP/53 - DNS
      #/sbin/ipchains -A input -b -p udp -s 0/0 -d 0/0 53 -j ACCEPT # Port UDP/53 - DNS
      #/sbin/ipchains -A input -p udp -s 0/0 -d 0/0 1024:32767 -j ACCEPT # Port UDP/1024->32767 - DNS

      # Accept Internetwork communication (Our networks, unlimited)
      /sbin/ipchains -A input -s 1.2.3.0/24 -d 0/0 -j ACCEPT # Office
      /sbin/ipchains -A input -s 5.6.7.0/24 -d 0/0 -j ACCEPT # Server Farm

      # Deny and log everyone else
      /sbin/ipchains -A input -p tcp -s 0/0 -d 0/0 -l -j DENY
      /sbin/ipchains -A input -p udp -s 0/0 -d 0/0 -l -j DENY
      /sbin/ipchains -A input -p icmp -s 0/0 -d 0/0 -l -j DENY

      /sbin/ipchains -A output -j ACCEPT
      /sbin/ipchains -A forward -j DENY

      --
      Serious? Seriousness is well above my pay grade.
    20. Re:Oh, really. by maxwell+demon · · Score: 1

      Well, an interesting variation: The knock sequence is not always the same, but depends in a secret way on "hidden" information in the reject packet (like that "packet serial number", I don't remember the name).

      That is, you knock the first port (say 1024), then you look at the reject packet, and from that, using a shared secret table, you determine which port to knock next. That table effectively works as partially questioned alternative password. Since every time, only part of the table (and not always the same part) is questioned, you'd have to watch quite a few connects to be prepaired to connect yourself.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    21. Re:Oh, really. by really? · · Score: 1

      err ... of the top of my head I can think of at least a couple "root-kits" that have been using this method to hide themselves. this has been around for a while.

      --

      "Consistency is contrary to nature, contrary to life. The only completely consistent people are the dead." A. Huxley
    22. Re:Oh, really. by mvpll · · Score: 1

      #/sbin/ipchains -A input -p tcp -s 0/0 25 -d 0/0 -j ACCEPT # Outbound Email

      Sweet, the above rule means I can connect to any tcp port I like, so long as I establish the connection from my own port 25 ...

    23. Re:Oh, really. by Pieroxy · · Score: 3, Insightful

      I don't think you get it. This way of securing a port (22 for example) is obscuring in the sense it hide the fact that you have a service up (SSH) to the outside world unless you know the "knock code".

      You can then hide any service that is not to be known from the public (SMTP, POP, SSH, TELNET, whatever...) thus removing the probability that any exploit for these may be exploited: The hacker on the other end doesn't even know the service is running!

    24. Re:Oh, really. by zemkai · · Score: 1
      > #/sbin/ipchains -A input -p tcp -s 0/0 25 -d 0/0 -j ACCEPT # Outbound Email

      Sweet, the above rule means I can connect to any tcp port I like, so long as I establish the connection from my own port 25 ...

      Yep... now if only it wasn't commented out...

      -ZK

    25. Re:Oh, really. by JWSmythe · · Score: 1


      Ya, I guess it really should have the local IP in there too. Like I said, there could be problems with it. No one should copy&paste just anything they find. :)

      --
      Serious? Seriousness is well above my pay grade.
    26. Re:Oh, really. by FCKGW · · Score: 1

      This seems to me like an unencrypted password. Anyone with a packet sniffer who knows about port knocking can see that you're making connections to ports x and y before connecting to port z. Hopefully it will be seen as security through obscurity: a way to slow down, but not stop, attacks.

      --
      It's an operating system, not a religion.
    27. Re:Oh, really. by stridebird · · Score: 1
      Anyone with a packet sniffer...

      Er, ok. I got one. I like Ethereal.

      ...who knows about port knocking...

      Hmm, ok, I do now...thanks to this thread.

      ...can see that you're making connections to ports x and y before connecting to port z.

      Rats. Why I can't I see it, then? Damn it, you make it sound so easy. Come one tell me, what else do I need? I wouldn't really have to be on the same subnet would I? Or owning me a few switches or routers on the network path?

      security through obscurity works. I won't tell you how...

  2. Well, there go the logfiles by djh101010 · · Score: 3, Insightful

    Something tells me I'm going to be seeing a lot bigger firewall logs in the future, as this catches on.

    1. Re:Well, there go the logfiles by Ozone+Depletion · · Score: 0

      *sigh* Yup, time to devote more of my Hd to logs. but I guess if it promotes better security it's a good thing.

    2. Re:Well, there go the logfiles by trompete · · Score: 2, Insightful

      Good luck doing this through NAT. You'd have to configure your machines to act like a NAT device as far as refusing connections or else you could be port scanned to figure out which ports to knock on.

    3. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      excellent point. this guy hasnt thought things through.

    4. Re:Well, there go the logfiles by mabu · · Score: 2, Interesting

      This isn't going to catch on. It's not more secure and it wastes more resources.

      Why would this be any more secure than listening on a single port for the "unique knock sequence?" Any good admin knows the most secure system is one that is listening on as few ports as possible.

    5. Re:Well, there go the logfiles by Frymaster · · Score: 2, Insightful
      It's not more secure and it wastes more resources

      i submit it could actually be less secure...

      1. dos attacks!
      2. sniff the port knocks

      yikes!

    6. Re:Well, there go the logfiles by Jade+E.+2 · · Score: 1
      Any good admin knows the most secure system is one that is listening on as few ports as possible.
      I don't know, I've been thinking lately that having a nice small dummy ssh/http daemon that opens every unused port would be fun. And it would also be the perfect place to implement the knocking scheme. Hmmm...
    7. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      It's not listening on any of the ports, genius.

    8. Re:Well, there go the logfiles by aldousd666 · · Score: 4, Interesting

      It doesn't have to be listening on the 'knock' ports, it can be dropping the packets and either logging the drop or setting a flag via some daemon. There are a million ways to tell if someone attempted to access a closed port without having to open the port. All of this, by my calculation, makes port knocking indeed more secure.

      --
      Speak for yourself.
    9. Re:Well, there go the logfiles by RollingThunder · · Score: 5, Interesting

      Actually, an interesting potential of this is to have you "knock" at the NAT gateway. Proper knocking opens up a given service and knock ports to an internal system.

      Different knock patterns at the NAT open you to different internal hosts. Quite interesting possibilities there.

    10. Re:Well, there go the logfiles by Mod+Me+God · · Score: 5, Interesting

      That is the point.

      1. Many ports getting a sequence is much more like noise than one port getting it -> much harder to identify an attempt of intrusion.

      2. If you have a backdoor, as mentioned in the article, how will you know it has not been accessed? It was not listening, it gets activated, does its duty, deactivates. If it is a good backdoor it is invisible to that system (only visible though an additional layer).

      So it is a better way of getting a connection, but not a solve-all for the intruder, and I doubt the intruder cares about any waste of your resources.

      --
      --

      FreeNET user? Comfortable with the adverse selection?
    11. Re:Well, there go the logfiles by Ziviyr · · Score: 1

      Yeah, NAT breaks stuff, get used to it.

      --

      Someone set us up the bomb, so shine we are!
    12. Re:Well, there go the logfiles by zuzulo · · Score: 1

      Actually, this could be a very cool technique for negotiating an encrypted exchange between two peers on an untrusted network. One feasible sequence could look like this.

      The peers share a protocol to translate a sequence of port knocks into a usable data stream. There would have to be some provision to filter out 'noise' or non communication based port knocks (not extraordinarily difficult, since you can just retry if required).

      One peer uses a sequence of port knocks to inform the other of its IP address, public encryption key, and desired port to be used for this communication session.

      The other peer uses a sequence of port knocks and the IP address to pass back its public key and desired port to be used.

      The first peer encrypts an arbitrary stream of data packets with its private key and the second peers public key, and sends those packets to the port suggested by the second peer.

      The second peer does the same.

      More interesting, is that you could use this to bypass the "tracker"/"hub" issue with most peer to peer networks. As soon as you want to join a peered network, the client could just start port knocking random IPs until you get a response from someone who is already a member. The time required to find a member would, of course, scale inversely with the number of members. From that member you get a list of valid P2P network IPs that he knows about and in return you pass any other valid P2P IPs you discover.

      Walla, secure distributed routing mechanism.

      Cute stuff.

      --
      "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
    13. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      A "knock port" would do almost the same thing, except it could be detected. True port knocking looks just like a completely closed machine. Plus it follows the rule that a closed port is more secure than an open port.

    14. Re:Well, there go the logfiles by rgmoore · · Score: 2, Interesting

      But you're missing the point that this doesn't require any extra ports being open. The listener waits for the correct series of attempted connections to closed ports, and then transiently opens an otherwise closed port. Thus the approach lets you leave a port open temporarily when you would otherwise have to leave it open all the time, so it should add safety by your known good administration practices.

      --

      There's no point in questioning authority if you aren't going to listen to the answers.

    15. Re:Well, there go the logfiles by pegr · · Score: 4, Informative

      Any good admin knows the most secure system is one that is listening on as few ports as possible.


      Is zero secure enough for you? The ports used for knocking are not open. The knock is the connect attempt which is recorded as an event on the server. The client gets nothing, not a NAK not a reset, nothing.

    16. Re:Well, there go the logfiles by Feanturi · · Score: 2, Informative

      Did anybody read the article? No ports are open on the server until the gateway has determined that the correct sequence of blocked attempts have been made in the right amount of time. Until then, scan all you like, you will get nothing.

    17. Re:Well, there go the logfiles by jlaxson · · Score: 3, Insightful

      sniff the port knocks

      I Disagree. If someone sniffs the knocks, they still have to authenticate to whatever application gets opened up. So, for a sniffer, this may not be very effective (at the worst case, it's no different than what you had before). But for a hacker across the net who wants to get at ssh, this effectively locks them out.

      --
      On Apple Input Peripherals: They're okay, I guess, but I was really hoping for a one-key keyboard and a 109-button mouse
    18. Re:Well, there go the logfiles by Esion+Modnar · · Score: 4, Insightful
      Actually, I think this article has been one of the most "nerd-worthy" postings on Slashdot in quite a while...

      And yes, one the most annoying things about sitting behind a NAT is only being able to forward a port to a single host at a time. This would be great if "port knocking" could solve this, though in a very Rube Goldberg fashion.

      --

      They say the first thing to go is your penis. Well, it's either that or your brain. I forget which...
    19. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Resources. The entire population of China could do a knock sequence somewhere around a hundred zillion times before we approached the bandwidth used by one Victoria's Secret catalog show online.

    20. Re:Well, there go the logfiles by str8 · · Score: 1

      The article (the second one, the first is /.'d) specifically addressed problem #2 by suggesting a changing 'knock' similar to the way encryption keys are rotated. The article also acknowledges that the same challenges such as secret distribution exists with the knock rotation scheme and encryption key rotation.

      Psst. Hey buddy, can you spare a SIG?

    21. Re:Well, there go the logfiles by lynx_user_abroad · · Score: 1, Informative
      It doesn't have to be listening on the 'knock' ports...

      Yes, it does. And thats the point. You're still expending resources monitoring the port, and (presuming it does catch on) you're still responding. You're just not responding in the RFC-approved way.

      For now, you'd be gaining some added keyspace to your theorhetical access path, while at the same time introducing a lot of complexity (thus potential compromise points).

      At best, you get some added protection from the diversity. At worst, it's just another false sense of security through obscurity blanket.

      I'll pass, thanks.

      --

      The thing about things we don't know is we often don't know we don't know them.

    22. Re:Well, there go the logfiles by IPFreely · · Score: 1
      Any good admin knows the most secure system is one that is listening on as few ports as possible.

      I would alter that to say responds on as few ports as possible. You can have ports not repsond to things that happen on them. If a port simply records what comes in but never sends any response, then it is no different than a closed port. You're not going to break into a port that does not respond. At best, you might DOS it by taking advantage of internal bugs by sending it a specific pattern of activity.

      Single port knocking sequence is a good idea though. You could send it a pattern of IP packets with different protocol headers or some such to wake it up. That's what I thought when I first saw the title. Timing based sequences would not work well, as they would be at the mercy of transmission delays.

      Either way, you might be at the mercy of ISP level port or protocol filtering. Better check those out first.

      --
      There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
    23. Re:Well, there go the logfiles by diablobynight · · Score: 2, Insightful
      beautiful, now instead of a 1U router I will need a 6U router that will cost 10000$ because it needs to be able to constantly process log files for all security requests.

      Also can you imagine trouble shooting problems on this.
      oh I see the problem, your connection wasn't able to send a knock from your network on port 8019, but it was on 1223,6789,9865 oh but not 7024, oh crap you have another ap on 7024 and when you send requests, it gets bad request errors in the error logs, well lets switch that to 2345. Or other problems to be seen, also now hackers won't just port scan me, they'll port scan me a trillion times, trying to find the right combination to open my ports.

      Beautiful

      --
      Anonymous Cowards - Oh God, How I hate you
    24. Re:Well, there go the logfiles by ltwally · · Score: 1
      "Why would this be any more secure than listening on a single port for the "unique knock sequence?""

      Agreed.. it truely wouldn't make any sense to have all those ports open. Thankfully, modern network software is quite capable of detecting connection attempts to any port, even closed ones.

      What I'm saying is that you wouldn't have to have those ports you're listening for set to open states. You could have those ports closed, and just watching for connection attempts on those ports. Once the proper sequence is hit, then you open port X (be it 22, 23, 80, etc).

      --



      /dev/random
    25. Re:Well, there go the logfiles by mrdaveb · · Score: 1

      Erm...

      1. Why would someone attack a server if they don't know it has open ports? I will admit it would make a DoS attack much more effective if the attacker knew the server had port knocking.

      2. So the baddies sniff the knock sequence and are then able to open the port... How exactly are they any better off than if the port knocking just hadn't been implemented in the first place?

      --
      Homme petit d'homme petit, s'attend, n'avale
    26. Re:Well, there go the logfiles by diablobynight · · Score: 4, Interesting

      does it only open the port for that one IP somehow, using also advanced IP filtering, cause otherwise this is dumb, it would be like unlocking your door for the first customer to knock right, but having to leave it open the whole time the customer is shopping.

      --
      Anonymous Cowards - Oh God, How I hate you
    27. Re:Well, there go the logfiles by The+boojum · · Score: 1

      Not really. Unless I'm much mistaken, I imagine that you could simply set your NAT device to forward the port range to another machine. When a successful knock is performed (and assuming the NAT device uses a web administration interface like most little routers), that machine could then issue the appropriate HTTP requests to the NAT device's web administration to open and forward a port to an internal machine. Should be easy enough.

    28. Re:Well, there go the logfiles by Awptimus+Prime · · Score: 1, Informative

      I'd suggest modding the parent up. There are not many good reasons for having port 22 (or whatever port you happen to run your sshd on) open to the world. You can, easily, configure your FW to only allow access from certain IPs or subnets.

      Sadly, most people who probably think port knocking is great security probably have yet to learn how to use DSA keys.

      Personally, I keep a DSA key on a keychain USB device and only allow one IP access to my sshd. This is adequate to satisfy my level of paranoia.

    29. Re:Well, there go the logfiles by hazem · · Score: 1

      To help stop sniffers, the knock sequence can be based on a one-time pad, so it changes every time. In addition to that, there could be random ports that are ignored, adding noise to the sniffed data.

    30. Re:Well, there go the logfiles by pegr · · Score: 2, Interesting

      Sadly, most people who probably think port knocking is great security probably have yet to learn how to use DSA keys.

      Think "in addition to" and not "instead of". No reason why you couldn't do both. In fact, you could rotate your port knocks to be different everytime you connect. That way, if someone does try to fake their way in, you could detect it and react.

    31. Re:Well, there go the logfiles by JSmooth · · Score: 1

      Hmm. I wouldn't dismiss this out of hand.

      Simple knocking would most certainly become brute forced soon after it was widely deployed. However a MUCH better way of "knocking" is to require a oneway authentication scheme.

      I set my server to "not listen" on udp port 2000. When someone connects they recieve no reply (UDP is connectionLESS) but I accept their datastream. If the data they sent is correct (matches my password) then I open the port.

      This is serious security by obscurity and starts to border on the threshold of stego type stuff. If you don't know it's there even after a thorough search you ain't gonna find it.

      Thiw would allow you to add OOBA (out of band authentication) to any protocol and be close to 100% immune from anonymous attack if setup correctly

    32. Re:Well, there go the logfiles by S.Lemmon · · Score: 5, Interesting

      That doesn't seem right. If the order of the knocks is important, how do you get around that there's never a guarantee in what order network packets arrive? If no packets are sent back at all, how do you know when to send the next knock or even if the knock made it to the server?

    33. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Transferring public keys over an untrusted network is always a bad idea. Adding port knocking doesn't suddenly make it secure, it just adds port knocking. Still a bad idea. Sorry.

    34. Re:Well, there go the logfiles by Florian+Weimer · · Score: 1

      sniff the port knocks

      It's not even sniffing. Payload doesn't show up in log, usually, but L4 information like this certainly does.

      Actually, I think the basic idea is sound. If you have to run a private, critical and complex service over the public Internet (access to a SSH server or to your VPN gateway, for example), and you add very simple access control, you won't be among the very first victims once a new vulnerability is exploited. As a result, you probably have enough time to disable or patch the service.

      And by the way, controlling access by source IP address is sufficient for that (but not always possible, unfortunately).

    35. Re:Well, there go the logfiles by 3.1415926535 · · Score: 4, Insightful

      How about, "Yeah, NAT breaks stuff, let's fix it" instead?

    36. Re:Well, there go the logfiles by _bug_ · · Score: 1

      dos attacks!

      How is this different from the way things are now? You keep track of the last 5 connection attempts per IP address. If you get nailed with several hundred separate attempts using spoofed sources, how does that differ from a normal DOS? Eating up memory usage, right? Well then you take only the last 50 or even 10 IPs that were trying to connect.

      DOS by bandwidth saturation. That's the only DOS and that's a problem regardless of if you're using a knock system or not.

      sniff the port knocks
      this isn't a big issue when you understand the reason behing a knock system. The idea with knocks is to keep scanners from finding open ports. You don't have any ports open, in fact you don't respond to pings or ANYTHING, and scanners will assume a dead IP.

      Knocking just opens up a port for 10 seconds.

      If someone sniffs it, so what? Now they've got access to the sequence to open a specific port. The attacker still isn't into the system. It's as if no knocking system were in place, which is exaclty how things are now.

      The knock system isn't going to stop everyone. But it is going to stop a majority of port scanners out there looking for live machines to exploit.

    37. Re:Well, there go the logfiles by ipstacks · · Score: 1

      Actually there are no ports listening and doesn't have to be, until the knock. THen it could turn on any service for any range of IP to gain access. This will be HUGE!!!! I bet every forewall will support this within this year.

      --
      Which distro does Linus use?
    38. Re:Well, there go the logfiles by Tom7 · · Score: 1

      This is a troll, right?
      Simply opening up other ports does not make your system less secure; it's running insecure services on those ports that does.

    39. Re:Well, there go the logfiles by KrispyKringle · · Score: 1
      You didn't read the article?

      This isn't a daemon that listens on multiple ports. It's simply an option you would enable in your firewall (easily done with IPTABLES, for example) to only allow connections that have previously attempted to connect to a certain number of blocked ports in a certain order. The response from the blocked ``key ports'' is still not an ACK, it's a RST (or no response at all, if you prefer the DROP target, which perhaps makes some sense in this case). So theres nothing actually listening on those ports, and no response given indicating that anything is.

      It wastes a minimal number of resources with the more complex firewall rules, you are right. But not much.

      And you've sort of taken that thing about listening on as few portsa as possible out of context. If I have SSH listening on two ports instead of one, it's really no less secure (except to SYN attacks, perhaps, which are easily defended against anyway).

    40. Re:Well, there go the logfiles by NixLuver · · Score: 1
      This procedure could be armored against sniffing in another manner; if both endpoints synchronize to the same timeserver, an md5 hash of the epoch time and a keyphrase could be used; do it like SecureID and accept the previous and next hashes as well as the current one, and use that hash to generate the knock sequence.

    41. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      hard tokens and digital certificates...why would you allow ANYONE you do not EXPLICITLY know to setup a remote external connection ?

    42. Re:Well, there go the logfiles by Short+Circuit · · Score: 1

      Or, a proper knocking sequence issues iptables commands to translate/forward all packets from the knocking IP address to a given host on the internal network. For a given amount of time, or until a signal is sent by the host being forwarded to.

      You're right, the possibilities are endless.

    43. Re:Well, there go the logfiles by KrispyKringle · · Score: 1
      No, it doesn't. Read the article. It would be running an added firewall rule that responds differently to connections that were previously attempted on the set ports earlier. There's still no daemon listening. Yes, a slightly higher load from a slightly more complex firewall rule. But not much.

      It still responds in the RFC-approved way. You can still set the target on those ports to REJECT (if using iptables) or DROP (though that's not the RFC-approved way). So you still send back a RST, and the client knows no differently than that the port is closed.

      And your added keyspace is quite significant in this case, since it's not just a mathematical gain, but, in the real world, means you can set your targets all to DROP and hide the existence of your machine completely, making it likely that kiddies will simply leave you alone (obviously this makes no sense if you are running some other public server).

    44. Re:Well, there go the logfiles by Short+Circuit · · Score: 1

      Better yet, only forward connections from a specific IP to an internet machine. Much more secure.

    45. Re:Well, there go the logfiles by Tassach · · Score: 1
      I set my server to "not listen" on udp port 2000. When someone connects they recieve no reply (UDP is connectionLESS) but I accept their datastream. If the data they sent is correct (matches my password) then I open the port.
      I had a very similar idea. In my scheme, the UDP listener throws back a NAK response regardless of the datgram's content. This way, it always appears as if the UDP port is closed. However, if the UDP datagram has the proper payload (say like a cryptographically signed message saying "open port 22 for 5 minutes starting at 13:42 for client at 192.168.123.45"). This way, port 22 would be closed most of the time, and would only open up for a limited amount of time for the requested address.
      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    46. Re:Well, there go the logfiles by Florian+Weimer · · Score: 1

      hard tokens and digital certificates...why would you allow ANYONE you do not EXPLICITLY know to setup a remote external connection ?

      It's a chicken-and-egg problem. To identify someone remotely, you need some kind of information exchange, which, by definition, has to be initiated by a yet unidentified party.

      This is a real problem. I don't know any fully trustworthy X.509 implementation, for example. That's why I think the first hurdle shouldn't involve cryptography (at least not asymmetric cryptography 8-).

    47. Re:Well, there go the logfiles by quantum+bit · · Score: 1

      You're not going to break into a port that does not respond.

      Not necessarily true. Sometimes it's even possible to break in to hosts that don't respond. I remember reading about a vulnerability in tcpdump a while back (buffer overflow in one of the decoders). In theory, it would be possible to send traffic to another IP on the same subnet and end up rooting the sniffer...

    48. Re:Well, there go the logfiles by Smidge204 · · Score: 4, Insightful

      Or other problems to be seen, also now hackers won't just port scan me, they'll port scan me a trillion times, trying to find the right combination to open my ports.

      And what stops them from brute-forcing regular password protected access on a known port?

      1) You don't know how many ports are in the knock sequence
      2) You don't know that the range is
      3) You don't know what port will open when you get it right

      Similar to a password, only instead of base 94 (a-z,A-Z,0-9`~-_=+\][|}{';":/.,?>million trillion trillion trials to crack. Then you have to do one more scan to figure out which port actually opened after each trial and hope no other service opened a port for some unrelated reason.

      I'm thinking it's a tad more secure than password authentication alone... and you can always throw password auth in after the client connects, so you can throw in a few false-positives (bogus logins) to keep them busy.

      And a five second window to transmit the sequence is pretty generous. If you wanted to harden it even more against brute forcing, you could require a full 5 second wait and accept all connection attempts from a particular host. That would limit an attacker to 20 attempts per minute max. So it'll take the better part of 32 billion trillion years to crack it.

      At that point, you can consider the end of the universe as "The ultimate connection timeout"
      =Smidge=

    49. Re:Well, there go the logfiles by pegr · · Score: 1

      While there are no guarantees, if latency isn't absolutely horrid, you could time them to arrive in a certain order. (My mind wanders to a vision of using port knocking to actually be the transport protocol, complete with integrity checks and retransmission of dropped packets... IP encapsulated into port knocks. MUST... RESIST... STUPID...THOUGHTS!)

      You are right that there is no way to know if a packet is dropped, but you could define the "protocol" to account for a few drop outs...

    50. Re:Well, there go the logfiles by Smidge204 · · Score: 1

      Guess preview isn't all that reliable... stupid HTML.

      Supposed to say:
      "Similar to a password, only instead of base 94 ... it's now base 65535 (number of possible ports used in the combination). An eight-port sequence would take, at worst, 340 million trillion trillion trials to crack."

      =Smidge=

    51. Re:Well, there go the logfiles by diablobynight · · Score: 1

      you entirely skipped my point, I dind't say it wouldn't be secure, I said it would be irritating for me as the admin, when people tried to crack it. your Reasons 1) 2) and 3) are just the reasons why they would try even harder and annoy me even more.

      --
      Anonymous Cowards - Oh God, How I hate you
    52. Re:Well, there go the logfiles by Smidge204 · · Score: 1

      And my point was that the likelyhood of cracking it is so astoundingly small it's not worth even trying. At that point they might as well just try to DoS you, in which case the usual protective measures (if any?) apply.
      =Smidge=

    53. Re:Well, there go the logfiles by Cunk · · Score: 1

      This doesn't seem like much of an advantage over simply using different ports for services on those other machines. In either case the client will need to be aware of special conditions for connecting to a different host on the private network (i.e. a different port-knocking pattern or an alternative port number).

      --

      I am the inventor of the hilarious refrigerator alarm.
    54. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Study networking.

      Such systems existed and do exist. They're pieces of crap compared to improved protocols, but they can still do the job, even if they do it very very slowly.

      Just send the first knock, wait. Send the second knock, wait. Send the third knock, wait. Try to connect. If the connection is refused, repeat. Of course you can make this smarter by trying to guess a good waiting period. ICMP ping, add a fudge factor, and try at that.

    55. Re:Well, there go the logfiles by lowe0 · · Score: 1

      Looked at in this manner, every kind of security is just another thing that can go wrong. Obviously, this isn't something you'd use on a server where clients have unreliable connections.

      However, it's another tool in the security admin's toolbox, to be applied in the right circumstances.

      (And yours was pretty much my first thought as well.)

    56. Re:Well, there go the logfiles by 0x12d3 · · Score: 1

      Or you could just silently discard all packets though only forwarding the secret handshake once on to the requisite host.

    57. Re:Well, there go the logfiles by Awptimus+Prime · · Score: 1

      I didn't say you couldn't have both. I'm just speaking as for being sufficient in most scenarios. :)

    58. Re:Well, there go the logfiles by Penguinshit · · Score: 2, Interesting


      An additional step here would be to have both machines (server, client) seeded with the same randomly-generated number and then, utilizing the same algorithm, generate a random port sequence for knocking. This sequence would be valid for 10 to 30 seconds, at which point the sequence for proper knocking is re-generated.

      I'm guessing this would need to be tied to Time of Day, necessitating accurate time; so either an external GPS device or an NTP connection would be required.

      This is just some off-the-cuff speculation, so don't flame me for the holes.

    59. Re:Well, there go the logfiles by Blackbrain · · Score: 1

      We already have a fix for NAT. It's called IPv6.

      --
      Where would we be if Wheel had hid her round rock in a cave instead of showing everyone how it rolls?
    60. Re:Well, there go the logfiles by Txiasaeia · · Score: 1
      "To help stop sniffers, the knock sequence can be based on a one-time pad, so it changes every time. In addition to that, there could be random ports that are ignored, adding noise to the sniffed data."

      If you're going to go so far as to require a one-use pad, then you can forget about the whole "port knocking" concept -- there's no stronger password than a 1-use password.

      --
      Condemnant quod non intellegunt.
    61. Re:Well, there go the logfiles by Gyorg_Lavode · · Score: 1

      Uh, the idea of a DoS is to keep other people from connecting to a system. Only in very specific cases is someone going to use this against a system that has no open ports. Really, think about your attacks before making them.

      --
      I do security
    62. Re:Well, there go the logfiles by Gyorg_Lavode · · Score: 1
      How exactly do you impliment a unique knock sequence against a single closed port, other than timing, which would be rather hard given varying latency on the internet.

      And this system isn't listening per-say. The sender can only send information encoded in port numbers and that which is transmitted in their attempt to connect. As has already been said. The worst this can be is as secure as your setup without port knocking. And the possible increase in security is very large.

      --
      I do security
    63. Re:Well, there go the logfiles by swordboy · · Score: 1

      Something tells me I'm going to be seeing a lot bigger firewall logs in the future, as this catches on.

      Something tells me that I'm going to see a lot more knock-knock jokes on slashdot.

      Knock-Knock
      Lady: Who is it?
      Landshark: Plumber.
      Lady: I didn't hire a plumber. Who is it!?
      Landshark: Flowers.
      Lady: What... for who?
      Landshark: Plumber
      Lady: ...you're...that crazy shark aren't you?
      Landshark: No maam, I am just a dolphin.. will you let me in please?
      Lady: A dolphin! Ok!

      --

      Life is the leading cause of death in America.
    64. Re:Well, there go the logfiles by John+Courtland · · Score: 1

      That reminds me of those crazy keychains my dad carried which had a radio reciever, so if he needed to log in from home, he needed to check his keychain. It broadcasted a value every minute I think. I remember how much that thing pissed him off, because it was always freaking out, or he'd put in the number and then the minute would elapse and the number would change. Seems like you could use a standard port for synchronization, but then that defeats the whole knocking idea.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    65. Re:Well, there go the logfiles by Khasmo · · Score: 1

      I can see two advantages: the first being the security which is the whole point of the knock in the first place. The second being that many apps especially older windows apps don't have the ability to reconfigure what port they connect to, or even if they do, they don't allow different ports for different connections.

      I don't think it'd be difficult to build a stand alone knock app that would knock and then run the app you wanted, or even better just listen for outgoing connection and make the appropriate knock before allowing the connection to go through.

    66. Re:Well, there go the logfiles by infochuck · · Score: 2, Informative

      does it only open the port for that one IP somehow, using also advanced IP filtering, cause otherwise this is dumb, it would be like unlocking your door for the first customer to knock right, but having to leave it open the whole time the customer is shopping.

      You're not quite right here - all knocking in the correct sequence does is make the specified port AVAILABLE - nowhere was it stated that port would 'just start working'. In the example given, using ssh, a correct ssh login/password pair would ALSO need to be provided - so to correct your metephor, the door is still locked - it's just not camoflauged anymore - now everybody can see the door is there - though they still need a key.

      To correcct my own metaphor - the door, furthermore, according to the example, would only be visible for, say, 10 seconds - at which point it's cloaking device turns on again, waiting to present the keyhole to the first correct secret knock.

    67. Re:Well, there go the logfiles by gnu-generation-one · · Score: 3, Insightful

      "I dind't say it wouldn't be secure, I said it would be irritating for me as the admin, when people tried to crack it."

      It should give you less irritation as an admin, when portscans reveal that every port on your computer is closed, and they go find another target, wondering why you bothered buying a firewall if you seemingly haven't configured it to accept connections.

      A recent nanog (was it nanog?) flamewar mentioned that people ran their servers on non-standard ports and they considered it really secure. Why? Because the viruses only scan one port, and choosing a different one gives you a lot of time to take stock when a vulnerability/virus pair is announced.

      It's obscurity (as a first layer of defence), but it means that an "nmap * -p 22" won't find your server, and anyone running the full scan of 64K ports over the internet is making themselves a lot more visible, and a lot slower.

    68. Re:Well, there go the logfiles by diablobynight · · Score: 1
      how does it make the port appear closed after ten seconds, communication is still traversing that port if you open an SSH session you ussually continue to use it for a while don't you?

      Also, how could I be right or wrong, I asked a question. Also you didn't answer if it had a way of allowing that port to be open for just the IP using it, otherwise the port would have to appear open, because it is open.

      --
      Anonymous Cowards - Oh God, How I hate you
    69. Re:Well, there go the logfiles by AyeRoxor! · · Score: 1

      No broadcast. Just a precise clock.

    70. Re:Well, there go the logfiles by anotherone · · Score: 1
      Just FYI, that's probably not a radio receiver, it's a psuedorandom number generator that picks a number based on a "seed" and the number of minutes that have elapsed since some arbitrary time.

      The server can predict what numbers will be displayed on the fob and that's used as part of your password. Very cool system.

      --
      Username taken, please choose another one.
    71. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Ordinary closed (as opposed to blackholed or 'filtered') TCP ports reply with a RST when they are SYN-probed. When nmap shows a 'filtered' port this means that NO reply came back -- this is unusual, unless the system is also behind a firewall/NAT gateway.

      In any case, the knocking program knows that the connection to the port has failed when it receives the RST (ie, when connect() returns ECONNREFUSED), and can move on to the next port.

    72. Re:Well, there go the logfiles by Wicked187 · · Score: 0

      This shouldn't be too difficult of a task. In most situations, you could have specific IP address reserved for systems behind your NAT gateway. This is perfectly feasable, because you should be able to get more IPs (unless you are using residential service, and at that point your whining would be moot). Simple open extra ports to be forwarded to the system behind the NAT gateway, and use those as the knocking ports. You could go hog wild and forward anything destined for that IP to the system, but that is more harm than good. I would implement 30 or so ports, and only use 5-7. This would throw people off a bit that ran OS detection in a scanner such as nmap, because you would have the extra ports open as well.

      --
      Politics, Life, and More on my Aspiring for the Future
    73. Re:Well, there go the logfiles by diablobynight · · Score: 1

      Ummm...this article is on slashdot, do you think hackers will honestly look at a closed port computer and move on? It'll be like a quest to be the first guy to hack the port knock. Also you wouldn't have all your ports closed, don't you still want your email server to recieve email, or your webserver to be able to be visited anonymously, or your ftp server? And yes I have an FTP server that I allow anonymous connections to, because I keep files like builds of linux, and some other stuff on it, that I don't mind sharing out.

      --
      Anonymous Cowards - Oh God, How I hate you
    74. Re:Well, there go the logfiles by dossen · · Score: 2, Insightful

      One could implement it in such a way that the validity of the keys overlap. Then one could read the key, perhaps even keeping it "locked" on the device for the time it takes to enter it, and then be sure that it is still valid (unless you take a very long time entering it). There would need to ba an overlap in any case, since the network transmission could cause the key to be too old by the time it got to the server.
      But if it is implemented in some soft-/hardware combination, then those timing issues are much smaller. But then why not just use a big-ass public key-pair.

    75. Re:Well, there go the logfiles by NanoGator · · Score: 1, Funny

      "Yeah, NAT breaks stuff, get used to it."

      Shat up, port knocker. /Beavis Voice

      --
      "Derp de derp."
    76. Re:Well, there go the logfiles by plover · · Score: 1
      Heh. You thought of IP over knocking, while I was thinking of Morse Code knocking, using one port for dot and the other for dash.

      I must have read too much Cryptonomicon as a kid ... oh, wait, it didn't come out until I was an adult.

      --
      John
    77. Re:Well, there go the logfiles by cdemon6 · · Score: 1

      Sorry if I'm missing the point, but the whole thing seems kind of insecure to me without a method to dynamically change the knocking sequence (as you mentioned). It should be as easy to get knocking sequences as sniffing plaintext passwords with any network sniffer (like ethereal for example).

    78. Re:Well, there go the logfiles by infochuck · · Score: 2, Informative

      how does it make the port appear closed after ten seconds, communication is still traversing that port if you open an SSH session you ussually continue to use it for a while don't you?

      Also, how could I be right or wrong, I asked a question. Also you didn't answer if it had a way of allowing that port to be open for just the IP using it, otherwise the port would have to appear open, because it is open.


      A) RTFA - the port doesn't just always close after 10 seconds - it listens for a connection for 10 seconds. It none is made (ie, successful login), the port closes up all hidden again.

      B) You claim, back to back, that (1) you didn't ask a question, and (2) I didn't answer your question. Which is it? It can't be both.

      I'll answer - of course you can specify only the IP that knocked correctly can get in. With linux, your imagination is about the only limit. Are you sure you're in the right place?

      And, again, just because a port is 'open', doesn't mean anyone can just waltz in - that depends entirely on the service running BEHIND the port - in the case of SSH, yes, the port will let you 'get in', but without entering the correct username and password, it kicks you right back out.

    79. Re:Well, there go the logfiles by WNight · · Score: 4, Interesting

      You can also open up inbound ports from specific external IP addresses only, and do many at once. So ten inbound connections can reach ten different internal webservers, and at the next request, reach the same one again.

      This can be done dynamically as a form of load balancing which is a neat hack. Expire the specific forward rule after 30s or something. Means similar requests cluster - less DB traffic.

      But, combine this with knocking and you've got the next step. Secret services on a 'stealthed' IP, where you can request which quake server (for instance) by knocking in a different way.

      Port scanning isn't what it once was. Especially once you factor in time-sensitive keys (easily doable - both machines need a net connect to reach each other, ntp is then trivial) and ID-sensitive keys (so my key isn't like yours, even at the same time). Even if you managed to snoop on a 'knock' you couldn't repeat it.

    80. 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.

    81. Re:Well, there go the logfiles by diablobynight · · Score: 1
      B) You claim, back to back, that (1) you didn't ask a question, and (2) I didn't answer your question. Which is it? It can't be both.

      Ugh I hate this, I didn't claim I didn't ask a question, I said, how could I be right or wrong, I asked a question.

      It seems even in your post of what I said, I stated I asked a question.

      A) RTFA - the port doesn't just always close after 10 seconds - it listens for a connection for 10 seconds. It none is made (ie, successful login), the port closes up all hidden again.

      my point is, what is the point of this security if the port then stays open after the first connection.
      You say I can specify, because of linux, is linux on my router? Is that what Cisco or Linksys has on my router? Most people don't use a pc running linux as their router, home users use linksys or d-link, and companies use Cisco routers.

      --
      Anonymous Cowards - Oh God, How I hate you
    82. Re:Well, there go the logfiles by lynx_user_abroad · · Score: 1
      No, it doesn't. Read the article. It would be running an added firewall rule that responds differently to connections that were previously attempted on the set ports earlier. There's still no daemon listening. Yes, a slightly higher load from a slightly more complex firewall rule. But not much.

      It changes the behavior of the firewall (or whatever is acting as a firewall) from "drop and forget" to "drop, but make a note of it". The behavior is not visible to the outsider if the outsider is looking for a normal reply, but is visible if the outsider knows what's going on. It's great added security from people who don't know the secret, no added security against people who do. In short: security through obscurity.

      And your added keyspace is quite significant in this case, since it's not just a mathematical gain, but, in the real world, means you can set your targets all to DROP and hide the existence of your machine completely, making it likely that kiddies will simply leave you alone (obviously this makes no sense if you are running some other public server).

      It's as secure as using TELNET was back before everyone started sniffing for passwords.

      We all (I hope) already know that anyone with a sniffer can steal your key (password) if you choose telnet. That's why clued people use ssh instead.

      But once "knock to open" becomnes common, anyone with a sniffer will also be looking for sequences of probes to non-responsive ports (or whatever) and try replaying those as a form of password. The particular ports, the sequence, the timing, all of these now have to be treated as a guarded secret as well. You wouldn't write down a password, but you'd likely have to write down this information. Or worse, code it into a program.

      Don't rely on something remaining secret unless you're willing to protect it as a secret. This "knock to open" is just another hoop a cracker has to jump through on the way into your machine. It will stop the clueless ones cold until they read about how the observant ones got around it, then it won't stop anybody.

      But it might also lull the owner of the box into a false sense of security, and to the extent it does, it's a bad idea.

      --

      The thing about things we don't know is we often don't know we don't know them.

    83. Re:Well, there go the logfiles by Billly+Gates · · Score: 2, Interesting

      I suppose a way around this would be to have an old 486 running BSD or Linux act as a first layer firewall and knocking device between your nat/router and ISP. You could just keep open port 22 on your nat/router and have the BSD box decide based on knocks which client to forward the packets the packets too.

      Another method I would like is some sort of handshake authentication where the firewall would reconigze who you were after logging in and would open ports up appropriately depending on your private key. I think MS proxy server does this with NTLM authentication but I am not too sure. There is IPSEC but this does not work over the internet or many campus wide networks if your at a unviversity.

      A unix equilivant would be nice with Kerbos, LPAD or Samba support.

      Having a dual firewall this way is rudant but it would work since I use my nat/router more as a hub then just a firewall.

    84. Re:Well, there go the logfiles by I+Like+Pudding · · Score: 0

      I love people who claim obscurity doesn't increase security.

      You see, the US army has a $750,000 anti-radar missile called HARM. It homes in on the emissions of radar stations and blows them to hell. During the whole Bosnia thing, the Serbs would rig up 75$ microwaves to run with their doors open, and HARMs would be flying into them left and right.

      On the internet, missiles cost nothing produce. Taking into account the principles of supply and demand, we end up with INFINITE FUCKING MISSILES, so I'll take all the microwaves I can get. I'll also take blenders, mixers, ovens, spatulas, and half a dozen of George Foreman's Mean Bean Cleaning Machine if they'll reduce my chances of getting hit.

    85. Re:Well, there go the logfiles by beebware · · Score: 1

      Plus if you run SSH on, say, port 283 and put a little rule in the filewall so that any attempted access to the default SSH port (22) is made, that IP address is immediately blocked from all server access for 30minutes. Anybody attempting to "port probe" to find your hidden SSH port will have to scan for a very long time...

    86. Re:Well, there go the logfiles by Chanc_Gorkon · · Score: 1

      And that port scan would not work as these are CLOSED ports. It would not show any different then any other closed port. This would be hard to break. Even if you could break it, you could design a algorithm to cycle the ports every hour or so. Definitely a crazy/neat idea.

      --

      Gorkman

    87. Re:Well, there go the logfiles by Penguinshit · · Score: 1

      You actually meant this.

      My idea was basically a hack version of one of these, built into the client so that the human wouldn't have to enter the number (and lag the negotiation time past the deadline).

    88. Re:Well, there go the logfiles by WNight · · Score: 1

      The basic networking stack already processes these packets. It looks at the port number and decides if it wants to do anything. It then decides if it should be nice about this (let the other end know nothing is running) or sneaky (pretend it didn't hear you, so you don't know if it's there at all).

      If I try to connect to your desktop machine at port 80 it's already got to decide how to handle it, regardless of what's running (or not) so this doesn't make your network stack need to be any more complex.

    89. Re:Well, there go the logfiles by AyeRoxor! · · Score: 1

      You actually meant this.

      Nah. I stand by my original post.

      My idea was basically a hack version of one of these, built into the client so that the human wouldn't have to enter the number

      While possible to store passwords of any sort in the code of a program, it's generally not the type of situation in which you'd use SecurID, which I helpdesked for 3 years.

    90. Re:Well, there go the logfiles by gnu-generation-one · · Score: 1

      "Ummm...this article is on slashdot, do you think hackers will honestly look at a closed port computer and move on? It'll be like a quest to be the first guy to hack the port knock"

      Yeah, but how do you know which is the server with the port-knocking, and which are the gazillion other office firewalls which look identical to a port scanner?

    91. Re:Well, there go the logfiles by spectral · · Score: 1

      it would be a psuedo-random password, much like the securid cards.. synchronize the clocks, and generate random things based on the time. Use this as a way to figure out what ports to knock. this prevents the people from accessing potentially vulnerable services, which is what we're trying to prevent anyway. If you need to use a password, even a one time one, but have to connect to a service first, then that service is open to attack -- ignore the password, the service itself can be broken. This adds another layer of security.

    92. Re:Well, there go the logfiles by Blkdeath · · Score: 1
      DOS by bandwidth saturation. That's the only DOS and that's a problem regardless of if you're using a knock system or not.

      I hate being DOS'ed. When people throw those diskettes, like, ow. 5 1/4's had sharp corners!

      I don't know how much DOS it would take to fill up my bandwidth, though. It was pretty small; like the size of a decent MP3. (Not even in the Stairway to Inna Gadda Da Vida range!)

      If, on the other hand, by DOS you mean DoS; this message will self-destruct with bad karma in 5...4...3...2...1...

      Starting MS-DOS...
      --
      BD Phone Home!

      Shameless plug. Like you weren't expecting it.

    93. Re:Well, there go the logfiles by ahdeoz · · Score: 1

      This doesn't do *anything* for security at all. "Port knocking" is exactly the same thing as typing a password. The only difference is that you don't know which service is available. So why not just have two passwords? The only reason to use it is if you have a known insecure application that you have to access, but you do not have a way to firewall, nat, or subnet it.

    94. Re:Well, there go the logfiles by mabu · · Score: 1

      Let me qualify this... I understand that ports are virtual, but it still consumes more resources to listen on more ports than it does on a single port. What technically is the difference between a single port with an elaborate encryption-based handshake scheme, as opposed to the same thing across multiple ports?

      I don't know about you guys, but I get port scanned all day. The likelihood of my system being further probed by seeing some type of handshaking across multiple ports seems more likely to attract additional, unwanted attention.

      And with a scheme like this, aren't you talking about wasting further resources keeping track of the "knock sequence?" What's the point? I could see it being used as an ALTERNATIVE to encryption if you didn't have encryption available, but other than that, it seems a waste of resources.

    95. Re:Well, there go the logfiles by Christopher+Whitt · · Score: 2, Insightful

      If you're going to go so far as to require a one-use pad, then you can forget about the whole "port knocking" concept

      I understand your point, but if I understand port-knocking correctly, it will allow you to effectively cloak the existence of a service entirely. Even if you use a 1-time pad authentication scheme, Mr. Evil Cracker can still connect to your server and see that a service is running. Perhaps it is a commonly used service, and a known exploit exists that bypasses the authentication mechanism. Unlikely, I know, but with port-knocking, connection attempts to your server are simply dropped on the floor, until the correct sequence of connection attempts is received.

      Unless Mr. Evil Cracker is sitting somewhere in the middle to sniff a valid connect attempt, he will never even know the service exists.

    96. Re:Well, there go the logfiles by ahdeoz · · Score: 1

      So too, could a proper "login" enable forwarding to a given host on an internal network.

    97. Re:Well, there go the logfiles by John+Hurliman · · Score: 1

      Another option would be to have a service listening on port 22 that wasn't SSH at all and sent back ICMP messages indicating the port is closed, even though it's listening to what you send. A packet with a special payload could temporarily turn the port 22 service in to a tunnel to ssh which is listening on a port accessible by 127.0.0.1 only. The idea has been around but this is the first real implementation I've heard of; would make port scanning completely useless. The problem is relying on additional client-side tools. I guess you could manually telnet to a series of ports quickly, then opening the ssh connection but the special packet idea wouldn't work unless you had proper tools on the client side.

    98. Re:Well, there go the logfiles by S.Lemmon · · Score: 1

      That's what I was expecting - you'll get a RST: the parent claimed it could just not reply at all.

      I guess for this to be reliable (especially under a loaded network) you can't "stealth" your ports, or at least not the ones you're using to test with. Sure you could just send the packet and hope it works (as some of the other replies were saying), but you could easily get shut out of your own service under bad conditions (which is probably when you'd least want to be).

      Which reminds me of another general problem with this idea. Whats to stop an attacker from sending forged packets to the kock ports? Even a low level spray of packets would add enough random "knocks" to effectively lock you out of your own service.

    99. Re:Well, there go the logfiles by Blkdeath · · Score: 1
      Uh, the idea of a DoS is to keep other people from connecting to a system. Only in very specific cases is someone going to use this against a system that has no open ports. Really, think about your attacks before making them.

      This goes directly against the credo of Skript Kiddies (sorry, my l33t translator is on sabbatacal, so I've only capitalized it for emphasis) and worm authors; If you throw enough shit against the wall, somebody will see a picture in it.

      Legend;

      • Shit - Packets
      • Picture - Open Ports / exploitz (l33t tr4nsl4t0r is back with coffee!)
      --
      BD Phone Home!

      Shameless plug. Like you weren't expecting it.

    100. Re:Well, there go the logfiles by Mage+Powers · · Score: 1

      Usually security is a balance of several steps, yes someone could sniff the sequence, but they can't sniff the password. A SSH worm probbly wont be smart enough to sniff sequences, so the port knocking would stop that :)

    101. Re:Well, there go the logfiles by rpresser · · Score: 1

      Oooh .. let's take it further ,.... IP encapsulated into port knocks travelling through an IP-OVER-MAIL tunnel which travels by X.509 going over IP using avian carriers ...

      (I know the X.509 probably isn't right, but it's not worth it to look it up)

    102. Re:Well, there go the logfiles by rpresser · · Score: 1

      Opening up other ports, regardless of the security level of the services running on them, makes your system more visible; more visible systems are bigger targets for DOS.

      If you want to pick nits, being a target for DOS does not mean you are insecure; but it's still a vulnerability.

    103. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      i use linux, and many others do too..

    104. Re:Well, there go the logfiles by The+Raven · · Score: 1

      A port does not have to REMAIN open during the life of the TCP connection. You open the door, let the SYN packet in, a connection is negotiated... and the port is CLOSED again. Existing TCP connections are let through via the stateful firewall rules.

      --
      "I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.
    105. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      > 3) You don't know what port will open when you get it right

      Unless the server is behind a screening router. An NMAP port scan will reveal "filtered" ports while returning "closed" for those in the sequence and the one to be "unlocked".

    106. Re:Well, there go the logfiles by ahdeoz · · Score: 1

      1) You don't know how many letters are in a password sequence. (fyi, it doesn't have to be a maximum of 8 characters) 2) You don't know which letters are used. 3) You don't necessarily know what application will open, unless you're using an app-specific login. 4) You could require two logins. Or more. So, a password login with two 697 character passwords would be as secure as a "port knock" with a 94 port knock sequence.

    107. Re:Well, there go the logfiles by infochuck · · Score: 1

      my point is, what is the point of this security if the port then stays open after the first connection.
      You say I can specify, because of linux, is linux on my router? Is that what Cisco or Linksys has on my router? Most people don't use a pc running linux as their router, home users use linksys or d-link, and companies use Cisco routers.


      AH - but the port DOESN'T stay open - you knock, the port becomes accesible, and you have 10 seconds to correctly login. After that, it dissappears, until the knock comes again. A port can be OPEN and have a current session active, but not accept any new connections. IE, I can knock, then SSH in, supply a UN/PW pair, and get into the system. But then, the port stops accepting further connections, unless the knock is once again presented correctly. It DOES NOT boot me off. It just stops LISTENing.

      As to if linux is on your router - well, for those hom users using Linksys routers, yes, I believe they do use linux. Cisco uses their own OS, but IIRC it's pretty flexible and such a scenario could likely be implemented there. DLink I dunno about.

      Why would a home user using a dlink router possibly need to implement this kind of thing? It seems to me that anybody who'd want to implement this would have a clue, and, having a clue, they would use a *nix box as their router.

    108. Re:Well, there go the logfiles by ahdeoz · · Score: 1

      The difference is that instead of having your TCP/IP stack parse packets, and your login program authenticate, you have to write other programs to parse your firewall logs to do the exact same thing.

    109. Re:Well, there go the logfiles by Tom7 · · Score: 1

      I don't really understand how having more ports open makes you more visible for DOS. What kind of attack are you thinking of? Where some guy just picks a random IP address and port number and, if that port is open, starts sending packets?

      Anyway, the whole point of this system is to make you less "visible" in the sense of fewer open-looking ports. Nobody said that the knocking ports have to even be listening; the kernel could be silently recording the SYN and responding with RST. This hides some unused ports (the ones you say increase "visibility") and also hides ports with real services on them--and THAT makes a difference.

    110. Re:Well, there go the logfiles by merlin_jim · · Score: 1

      does it only open the port for that one IP somehow, using also advanced IP filtering, cause otherwise this is dumb, it would be like unlocking your door for the first customer to knock right, but having to leave it open the whole time the customer is shopping.

      Actually there is something you can do that combined with the way TCP/IP is built that makes this very secure.

      Only allow that IP to login. After one connection attempt, close the port. A listen port doesn't need to be open for communciation to occur; remember that when you connect to my computer on port 80, what you're really doing is going to port 80 to be assigned ANOTHER port to communicate on, and that other port is what is actually used for the TCP/IP message traffic.

      --
      I am disrespectful to dirt! Can you see that I am serious?!
    111. Re:Well, there go the logfiles by Anonymous Coward · · Score: 2, Informative

      Exactly.

      The idea that a port wouldn't respond until the proper knock had been received might be a good one. But there's no reason to overload the port setting in the TCP header to do this. Include the knock values in the payload of the packets that are sent prior to the server sending back an ACK. It'd be just as secure as this setup (i.e. still vulnerable to sniffing.)

    112. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Wouldn't the TCP sequence numbers still help you sort out the order in which the packets were sent?

    113. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Walla?!? WTF?

      It's "voila". It's French. Normal use by crazy Americans is:

      "I mixed every ingredient I could find, and voila! Instant disgusting mess!"

      Please do not use words that you don't understand. I'm not saying I even know what it translates to exactly in French, but at least I know enough not to use the completely ignorant high-school-dropout "walla"!

      I read your whole post, and was even intrested in your point on the possible P2P ramifications... but then "walla" - you completely undermined your entire post and I almost caused a scene at work, laughing so hard. Wow, man. Wow.

    114. Re:Well, there go the logfiles by JSmooth · · Score: 1

      Good idea. But remember. UDP never returns a response unless an higher layer protocol such as tftp tell's it to do so.

      So if you were to port scan a UDP port with nmap the way it tries to determine if the port is open is whether or not it get an icmp message.

      When data is sent to an unused UDP port icmp will return a "port unreachable" error. If data is sent to a used udp port it will return no information.

      So I scan udp ports by looking for the unused ones and then "guessing" that the others are in use.

    115. Re:Well, there go the logfiles by Graspee_Leemoor · · Score: 1

      "An eight-port sequence would take, at worst, 340 million trillion trillion trials to crack."

      yeah, and at best it would take one trial. always remember that.

      graspee

    116. Re:Well, there go the logfiles by WNight · · Score: 1

      I'd imagine that port knocking would be used by university students whose dorms forbid running servers of any type. SSH would be secure, but they'd shut off your net connection if they saw it. Port knocking means you can pass a scan and yet still run SSH.

    117. Re:Well, there go the logfiles by Smidge204 · · Score: 1

      Same is true with a password, or any auth system for that matter. It's 100% true that you only need to get it right once.

      For an eight-key sequence, odds are either:

      2.18 x 10^14 to 1 (Assuming a-z,A-Z,0-9 password only)
      -or-
      3.40 x 10^38 to 1 (Port knocking)

      So, which do you think you're more likely to hit on the first try?
      =Smidge=

    118. Re:Well, there go the logfiles by Bombcar · · Score: 1

      Aha! I can bring in my LOTR metaphor here! Gandalf knew the knock (which showed him the door), but he did not know the ssh login/password pair (the word "Mellon")! Clear as day, now!

      Tolkien was way ahead of his time.

    119. Re:Well, there go the logfiles by WNight · · Score: 1

      Do you understand the difficulty of guessing the correct port five-port sequence, where order matters and any wrong guess silently restarts the process? Especially since anyone setting up port knocking would already have a rule for discarding any system port-scanning you. Define port-scanning as 100 connection requests without a successful connect and that allows for only twenty guesses before you're banned. 64535 ^ 5 is much higher than 5; much, much higher.

      The problem with opening the packet and looking at it is that you've then got a service, with pretty hefty privs, listening to the network.

      With letting iptables and sshd do all the listening your perl script only needs to detect a correct pattern and allow access to ssh, the failure mode is pretty small and the window of opportunity for feeding it bad data is likewise small. A service performing a signature verification (expensive) on a whole packet of data has a much larger window of vulnerabilities - more opportunities to have a buffer overflow, or fail to parse the packet, or whatever.

      The knocking just seems so much quicker, easier, less risky, and just as secure.

    120. Re:Well, there go the logfiles by nomel · · Score: 1

      You could also just do it time based on one port...hell, even the port your trying to connect to. But, this would require client software (to make it easy for the user) and a decent connection.

      I wish I would have made a webpage of "port knocking" when I thought of it a couple years ago. :) *Almost* got to implement the idea as they have it (with time and different ports). Didn't do the timming because it was a telnet service (too hard manually with shitty connections), and didn't end up implementing it cause VB (it was my first big programming project when I knew nothing but vb) is a stupid programming language that *always* seems to destroy projects beyond repair (which is why I don't use it anymore), to the point where you can't open them.

      I got single port knocking in (and at one time, double) before vb killed the project. It's the port after the actual service port, so, a port scan wouldn't see anything initially except the "knock" port. I also made it so you had to send a single character. This way, port scanners wouldn't activate the service.

      I thought "port knocking" (which I called "like a padlock") was an already thought of/implemented way to have port security. *shrug*

    121. Re:Well, there go the logfiles by Anonymous Coward · · Score: 2, Funny
      which do you think you're more likely to hit on the first try?

      YOUR FACE

    122. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      is this a troll?

      god learn to spell.

    123. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      You mom is easy enough to hit on the first try!

    124. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0
      well, what about a multi-step connection? a given port knock to activate watch on a different set of ports (repeat as needed)? or something on the lines of:

      1. knock
      2. connect to a given port via http to obtain an encrypted (gpg) list of ports/timings to knock at (using a different sequence) for step 2 and the 'true' port to connect to afterwards - randomly generated of course
      3. do the second knock and connect (within a time interval)


      of course, it requires a bit more than a USB dongle to store a perl script on, and the usual security caveats apply about the machine you're knocking from - but for a paranoid enough admin that carries his/her laptop around it could be a neat trick for keeping ssh firewalled against the next remote root exploit
    125. Re:Well, there go the logfiles by 10101001+10101001 · · Score: 1

      That's quite simple. For TCP there's something called a sequence number. For something like a 5 second window, you'll use x numbers in a sequence, which leaves at least 16K possible "knocks" to form a successful knock sequence (technically, a seq number is 16-bit leaving 64K, but you might have to factor in all the other packets coming out of the machine, which might be using one seq counter throughout the tcp/ip stack).

      --
      Eurohacker European paranoia, gun rights, and h
    126. Re:Well, there go the logfiles by Wescotte · · Score: 1

      And a five second window to transmit the sequence is pretty generous. If you wanted to harden it even more against brute forcing, you could require a full 5 second wait and accept all connection attempts from a particular host. That would limit an attacker to 20 attempts per minute max. So it'll take the better part of 32 billion trillion years to crack it.

      Well, then write a nice outlook virus that performs some sorta distributed computing method to have all outlook users contributing to hacking the box :)

    127. Re:Well, there go the logfiles by Ziviyr · · Score: 1

      Lets fix NAT, marked as insightful?

      How much insight into NAT does that represent?

      NAT is broken by nature unless you want to go back to FidoNet. Which doesn't un-fracture the IP network and doesn't really fix anything.

      So how about:
      "Yeah, NAT breaks stuff, so use something else ya twit!"

      --

      Someone set us up the bomb, so shine we are!
    128. Re:Well, there go the logfiles by John+Courtland · · Score: 1

      Ahh, live and learn. Thanks for the correction.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    129. Re:Well, there go the logfiles by Bitsy+Boffin · · Score: 1
      It's great added security from people who don't know the secret, no added security against people who do. In short: security through obscurity.
      The same can be said about any common combination-lock combo, but lets anybody who does through.
      But once "knock to open" becomnes common, anyone with a sniffer will also be looking for sequences of probes to non-responsive ports (or whatever) and try replaying those as a form of password.
      You are supposing that the knock sequence is static - it need not be. I'd suggest that one-time-use knock-sequences are generated from an initial seed value known by both client & server, or from the current time of day valid for 5 minutes either side and one-use-only.

      Sniffing then gets you nothing except an already expired (because it's been used) knock sequence.

      --
      NZ Electronics Enthusiasts: Check out my Trade Me Listings
    130. Re:Well, there go the logfiles by Bitsy+Boffin · · Score: 1
      ... common combination-lock combo, but lets anybody who ...
      Ugh, fat fingers. That should have read

      The same can be said about any common combination-lock, great against people who don't know the combo, but lets anybody who does through.

      --
      NZ Electronics Enthusiasts: Check out my Trade Me Listings
    131. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      I was thinking about creating a serial link using two ports. Assuming you can capture the timestamp put on the packet, use one port as a clock and one port as a data line. When you get the clock packet, make a note of its time stamp. Look for a packet on the data port with the same time stamp, or wait for awhile if you didn't get it. If you have a packet with the same time stamp, that's a high bit. If you don't get a packet with the same time stamp, that's a low bit.

      There you have it. A serial link with low reliability. Do the same thing in the opposite direction, pick your protocol poison to put on top of that, and have fun.

    132. Re:Well, there go the logfiles by Awptimus+Prime · · Score: 1

      Not really. If I were the resident InfoSec geek, I would probably catch the traffic on Snort and go have a talk with them.

    133. Re:Well, there go the logfiles by CmdrTHAC0 · · Score: 1

      "...or sneaky (pretend it didn't hear you, so you don't know if it's there at all)."

      If a port is stealthed (i.e. using the DROP target) then it doesn't actually hide your system. If there was nothing at that IP address, normally something upstream would send back something like "no route to host" or "host unreachable". A packet to a stealthed port on a live machine just vanishes, but using traceroute can tell people that the network it's on is actually up and reachable. All the stealthing really does is make a portscan take a bit more resources (time or simultaneous connections) because it has to wait for the full timeout.

      --
      __CmdrTHAC0__
      In Soviet Russia, Spanish Inquisition doesn't expect YOU!!
    134. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      X.509 is definitely not right. It has something to do with SSL. I think frame relay (what you're getting at?) is AX.25 but like you, I am too lazy to look it up. Thus does /. propagate ignorance....

    135. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      Or an anonymous proxy, and avoid Freenode's scanning. w00t!

    136. Re:Well, there go the logfiles by Tassach · · Score: 1

      I was forgetting the specifics of how UDP works (I don't do much socket level work anymore). The ICMP port unreachable message was, of course, what I meant by sending back NAK -- the idea is that you want the system to respond as if the port were actually closed.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    137. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      "Psst. Hey buddy, can you spare a SIG?"

      Sure thing. UPS is delivering your SIGKILL as we speak.

    138. Re:Well, there go the logfiles by rpresser · · Score: 1

      What kind of attack are you thinking of? Where some guy just picks a random IP address and port number and, if that port is open, starts sending packets?

      Yes. Imagine Charlie Badguy gets laughed at Joe's Hardware Store. He immediately looks up www.joeshardware.com, but decides to try to trash everything he can see in the whole subnet as well. So he does a portscan. If there's a server with common open ports, he's got new targets.

      Maybe this isn't common, but it's what i was thinking of.

      Anyway, ... Nobody said that the knocking ports have to even be listening; the kernel could be silently recording the SYN and responding with RST.

      Yes. I understand this point. My post was in direct reply to your claim that open ports by themselves do not make you insecure; a completely separate question from the system proposed in the article.

    139. Re:Well, there go the logfiles by Thing+1 · · Score: 1
      I don't know a whole lot about networking so I don't know whether this is valid, but it seems to me that this can be made even more secure by modifying the packets being sent to knock with.

      So not only does it have to be a specific sequence of ports to knock on, i.e.:

      100, 102, 104, 106, 100, 103
      to get in, but you also have to send the right data to each port, something like (port:byte):
      100:ac 102:dc 104:00, 106:ff, 100:be, 103:ad
      Now, I'm no network hacker but I can't see how such a lock could be picked (man-in-the-middle attack, perhaps, but other than that?).
      --
      I feel fantastic, and I'm still alive.
    140. Re:Well, there go the logfiles by Thing+1 · · Score: 1
      Which reminds me of another general problem with this idea. Whats to stop an attacker from sending forged packets to the kock ports? Even a low level spray of packets would add enough random "knocks" to effectively lock you out of your own service.

      Not a problem: keep track of the IP.

      So the attacker is locked out of connecting over that port, but (unless s/he had already taken over your client machine and was knocking from there!), you can still get in.

      --
      I feel fantastic, and I'm still alive.
    141. Re:Well, there go the logfiles by FLEB · · Score: 1

      Then again, you could just have a plain-telnet-or-http-or-something "control port" that asks "Which server, please?", then associates your IP for the duration.

      --
      Information wants to be free.
      Entertainment wants to be paid.
      You just want to be cheap.
    142. Re:Well, there go the logfiles by KrispyKringle · · Score: 1
      First, as the other replyer noted, any form of security employed today, other than biometrics, relies on the user knowing something that someone else doesn't. That is the entire theory behind password authentication. ``Security through obscurity'' only has a bad connotation because it implies a lack of any further security (e.g. closing the source and hoping nobody notices the lack of bounds-checking). It's not necessarily a bad thing, however, as in this case.

      Two, you haven't explained why it's a bad thing that the firewall's behavior is changed. Potential DoS? Not any more so than with any other firewall rule (save for the spoofing issue, which is an issue with paranoid bad-password-lockout schemes anyway).

      Three, you claim that anyone with a sniffer (who must be on the local non-switched network) will be looking for probes to non-responsive ports. You know how many SYN packets fly across the 'Net and get no response (or get a RST)? Way, way too many to filter out the meaningful ones. Even if someone knows what he's looking for, it won't do him a world of good.

      It's certainly not foolproof. But it's an added layer. Your argument about a false sense of security implies that the layer approach to security is bad, because any weak layer motivates the admin to ignore implementing a stronger layer. I would say that anyone skilled enough to implement this (and I'll admit I'd have to read the iptables docs a bit to get this one working right) probably knows enough to know it's limitations. It's not as weak as telnet. Even if someone knows the knock sequence, he's got no more than if I just had an open SSH server (like I do now).

      It's patently obvious that this is imperfect security on its own, and that there is a potential DoS with spoofed failed attempts. But I would be very impressed and surprised if you could argue some actual weakness from this, or argue that it doesn't accomplish it's ends reliably. And I'm afraid you simply haven't convinced me yet.

    143. Re:Well, there go the logfiles by 3.1415926535 · · Score: 1

      I meant to imply that he should have a more helpful attitude than simply, "get used to it." I didn't intend to make any statement about the technical merits of NAT or lack thereof.

      I do agree with you, by the way.

    144. Re:Well, there go the logfiles by 3.1415926535 · · Score: 1

      s/he/you/

    145. Re:Well, there go the logfiles by S.Lemmon · · Score: 1

      "keep track of the IP"

      Um, as I said "forged" - remember we're not establishing a connection, and if there's no need to get a packet back, then it's very easy to send a spoofed IP.

    146. Re:Well, there go the logfiles by lynx_user_abroad · · Score: 1
      I can tell you haven't played this game much. ;-)

      The same can be said about any common combination-lock, great against people who don't know the combo, but lets anybody who does through.

      In that case, the combination is the key. The owner knows the key must be kept secret and that if the key is revealed, the system is no longer secure.

      You are supposing that the knock sequence is static - it need not be.

      That is a common mitigation; changing the protocol in this way eliminates replay vulnerabilities but introduces key management challenges, some of which you've acknowledged:

      ...generated from an initial seed value known by both client & server...

      which means the initial seed value becomes a seperate secret which must be tracked, managed, and which could be compromised. It also means that if the random number generator, or the algorithm used to derive the current key from the seed is discovered (it's another secret which has to be managed) then the system is compromised.

      ...or from the current time of day...

      Is that meant to be some sort of secret, too?

      When designing a crypto system, you divide it into two pieces: those parts which you will treat as part of the key (and are prepared to keep secret) and those parts which you accept that sooner or later your advesary is going to know. (Purists put everything into the second class, and demand that even passwords be changed frequently) Either the correlation between the key and time-of-day is a part of the secret or it isn't. If it isn't, it adds no security. If it is, you've gained maybe 7 bits of keyspace (using your "5 minutes either side" suggestion) at a huge complexity cost.

      What happens if some script kiddie pings the one of the critical ports while the knock-knock password is being entered? The choices are 1) build the system to accept a knock-knock password even if it's "misspelled", or 2) accept the fact that a script kiddie can intentionally DOS you, or (perhaps worse) force you to enter and re-enter your knock-knock password multiple times in hopes of getting through once. It's also vulnerable to man-in-the-middle attacks.

      The only advantage I can see from such a system is if it were deployed a) in addition to a secure key negotiation scheme (as a safeguard against the discovery of a vulnerability in that system) and b) if it were custom engineered in each case, as opposed to widely deployed. I don't think it introduces that much of a vulnerability as long as it remains obsecure.

      I heed Schneier's advice on this one: leave the design of crypto systems to those who know what they're doing.

      --

      The thing about things we don't know is we often don't know we don't know them.

    147. Re:Well, there go the logfiles by monkey_jam · · Score: 1

      what about adapting something similar to bluetooths frequency hopping system. Bluetooth frequently switches channels (something like 60 times a sec IIRC).

      What if the sender and receiver on a wired network switched ports like this? Both have a passkey that generates a psuedorandom stream, which can be used to decided which ports to use.

    148. Re:Well, there go the logfiles by monkey_jam · · Score: 1

      you mean your logs will look like..:


      10:01pm: Port 34 "HEY"
      10:02pm: Port 44 "ITS ME"
      10:03pm: Port 67 "DAVE"
      10:04pm: Port 22 "OPEN UP"


      *Warning- incorrect knock sequence*

      Response: error 33a33f: "DAVES NOT HERE MAN"

    149. Re:Well, there go the logfiles by diablobynight · · Score: 1

      Have a clue?
      I have never seen a major corporation using a linux box as their router. And I have been in the systems room of several.

      --
      Anonymous Cowards - Oh God, How I hate you
    150. Re:Well, there go the logfiles by lynx_user_abroad · · Score: 1
      ... any form of security employed today, other than biometrics, relies on the user knowing something that someone else doesn't.

      Well, there's something you know like a password, there's something you are like biometrics and something you have like a physical token, access card or key.

      Any (or all) of these can be considered keys, and as such need to be managed. You are correct that every system must have keys, but it's important for the users of these systems to understand what the keys are, and understand that the keys have to be managed.

      ...you haven't explained why it's a bad thing that the firewall's behavior is changed.

      To the extent that the "standard firewall behavior" is changed, two things happen.

      First, you gain a certain amount of security (albeit security by obscurity) from the fact that your firewall behavior is different from the standard model. I'd argue the gain a) has limited value, only to the extent that the person implementing the modified behavior takes steps to keep it secret, b) is non-existant against insiders (people who have been told the secret), and c) evaporates completely if the modified firewall behavior becomes the new standard.

      Secondly, you introduce the possibility that your modified firewall behavior exposes new vulnerabilities not present in the standard model. We all know the consequences of allowing buffer overflows in firewall software, and we code accordingly. Have we studied at all the consequences of strapping a perl script into IP tables? I don't know what those vulnerabilities are, but as a general rule whenever complexity is added to a system, the possibility of vulnerability increases. This isn't something I'd want to bet on.

      I would be very impressed and surprised if you could argue some actual weakness from this...,

      So would I. ;-) And I'm thinking a system like this won't ever get deployed widely enough to get the attention of the people who could. But systems I would previously considered "near perfect" (like SSH) have had actual weaknesses exposed after deployment, so I wouldn't rule out the possibly that a system with "patently obvious" inperfections harbors them.

      --

      The thing about things we don't know is we often don't know we don't know them.

    151. Re:Well, there go the logfiles by S.Lemmon · · Score: 1

      but would the sequence numbers be useful? Remember we have no connection yet - these are individual connection attempts doing the knocking. Shouldn't the initial sequence numbers be unpredictable on a good TCP/IP implementation?

    152. Re:Well, there go the logfiles by KrispyKringle · · Score: 1
      Hope I'm not being a jerk by continuing this thread long after it should have died, but it's this sort of conversation that I find remotely redeeming about Slashdot. ;)

      Anyway, I think you are right in saying that the main advantage is obscurity--the added keyspace, when I think about it, could just as easily be gained from a longer SSH key or using public-key authentication--but nonetheless, if stealth is a requirement (hiding the machine's or services' existence), this is a very good way to do so. If the machine is unknown, it is likely that no attackers will ever even attempt to get in (granted, sniffing would expose it's existence, but it's not as if knowing it's there makes it any weaker, either). In other words, what you see as only security-through-obscurity is actually a very valuable asset, in certain circumstances (e.g., setting up a logging host that is invisible to all but those who know the knock sequence--though there are other good ways of doing this, admittedly).

      I think the other major point you do make, quite correctly, is that the introduction of weaknesses is relatively unknown. And I agree; I probably wouldn't volunteer to be the first to set up this system. But, at the same time, the system is theoretically sound, and I see this argument as no better than saying, ``well, we don't know the quality of code written by the authors of this new-fangled SSH thing yet, so we don't want to use the first release.'' It's a valid point, but it's no reason not to continue development.

      So essentially, the only benefit we get from this is the ability to actually hide what other services are listening (as you say, mere obscurity; it's concievable that those better-known servers like OpenSSH are also a lot more secure than something new and untested like this). The added-keyspace argument's major weakness is that, while it does add value, it adds no more than simply having a longer SSH password or using public-key authentication instead.

      So, yeah. For me, since I have a public webserver anyway, I wouldn't be able to hide the existence of the machine, even using this. So I'd get little benefit from this. So I'd never bother. I suppose, when I think of it this way, it's only really useful at all if stealth--hiding the machine's or service's existence completely--is an important goal. If cryptographic difficulty is required, simply use public-key authentication.

      But still...it's not a bad idea. Just kinda obscure and not that useful. ;)

    153. Re:Well, there go the logfiles by Thing+1 · · Score: 1
      Um, as I said "forged" - remember we're not establishing a connection, and if there's no need to get a packet back, then it's very easy to send a spoofed IP.

      If your attacker is forging the specific IP you're coming from, you've got more problems than securing a knocking algorithm.

      My statement stands.

      --
      I feel fantastic, and I'm still alive.
    154. Re:Well, there go the logfiles by S.Lemmon · · Score: 1

      What makes you say that? It's pretty much trivial to forge a packet with any source IP you like as long as you don't care about getting back a reply - it's not like an attacker needs any special access to your system what so ever. The only thing even a bit non-obvious is guessing the IP of the client, but in most cases even that's not very hard.

    155. Re:Well, there go the logfiles by Thing+1 · · Score: 1
      The only thing even a bit non-obvious is guessing the IP of the client, but in most cases even that's not very hard.

      You're right. And if your attacker knows you well enough to be able to spoof your IP address, port knocking is the least of your worries.

      --
      I feel fantastic, and I'm still alive.
    156. Re:Well, there go the logfiles by 10101001+10101001 · · Score: 1

      Yes and no. The sequence number at the very start of a knock may be completely unpredictable, but it's not unreasonable to make sure each sequence numbers in the series of knocks is increasing. The actual server machine, then, would be reasonably expected to collect about 5 secs worth of port knocking and make an assessment of whether the group of knocks, when sorted (assuming it starts the range of numbers, figuring out the lowest seq number of the span is 32K or smaller away from the highest), is a valid knock sequence. Because of this, trying to flood a connection to find a proper knock sequence would invariably not work (though DoS is always available). Heck, with this implementation, one could intentional disorder the knocks in transport but order them properly in sequence number, and the numbers themselves would just be increasingly less random the longer the knock sequence.

      --
      Eurohacker European paranoia, gun rights, and h
    157. Re:Well, there go the logfiles by Anonymous Coward · · Score: 0

      "...You claim, back to back, that (1) you didn't ask a question, and (2) I didn't answer your question. Which is it? It can't be both."

      Uh, no, he did not claim he *didn't* ask a question, he claimed he DID. Read it again.

  3. Interesting. by Vindictive · · Score: 0, Offtopic

    Damn, interesting...

  4. not bad by maelstrom · · Score: 5, Insightful

    But it does seem like a layer of obscurity to what should otherwise be a secure port. What if someone is sniffing your network? Unlike an encrypted password, they could easily replay this sequence and gain access to your "hidden" port.

    --
    The more you know, the less you understand.
    1. Re:not bad by Kenja · · Score: 5, Interesting
      "But it does seem like a layer of obscurity to what should otherwise be a secure port. What if someone is sniffing your network? Unlike an encrypted password, they could easily replay this sequence and gain access to your "hidden" port."

      And? It is still more secure. By using "port knocking" they HAVE to sniff out your network traffic and find the port combo. Without "port knocking" they just need to run nmap and see what ports they can try to attack.

      --

      "Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
    2. Re:not bad by 7ex · · Score: 1

      There is no Problem with replaying these sequences. Since they are only hiding which services are really listening on a IP-Adress nothing relyes upon this 'protection'.

      --
      http://blog.gauner.org - just a blog
    3. Re:not bad by Anonymous Coward · · Score: 0

      And? It is still more secure. By using "port knocking" they HAVE to sniff out your network traffic and find the port combo. Without "port knocking" they just need to run nmap and see what ports they can try to attack.

      false sense of security, why make yourself do more work for a negligible gain in security. this is no more beneficial than adding 5 characters to your login password, then logging in via telnet.

    4. Re:not bad by LostCluster · · Score: 5, Interesting

      Think of it this way... it's an extra password combined with bonus security-by-obscurity of not having a visible password prompt.

      The "knocking ports" could also be configured that if there are random hits to the standard port without the proper knock, the system could lock down for 30 seconds and even ignore the proper knock so that if somebody's trying to brute force all the possible knocks, they'll never get feedback when they have the right one.

      Yeah, this is no substitute for properly securing the original service, but it's an extra layer that means there's even more that needs to be captured for a successful hack...

    5. Re:not bad by Anonymous Coward · · Score: 0

      Sure, maybe it is. I use this, except I use a one time pad of port numbers and strike them off as I use them. I implemented this when all the ssh vunerabilities were going around. This buys me time to patch them.

    6. Re:not bad by sinucus · · Score: 1

      What kind of crack are you people smoking. This isn't a bad idea, I don't know if *I* would use it but it's still a great idea. You don't just eliminate your passwords on port 22 because you have this installed, it's an extra layer of security on top of more security. You think that because you have 1 lock that 2 locks won't do anything?

    7. Re:not bad by jonathan_95060 · · Score: 1

      regarding "sniffing" -- you are missing the point!

      What port knocking does is raise the cost of automated scanning of random internet machines.

      the script kiddies who run the year 2004 equivalent of SATAN against a "phonebook" of ip addresses (or random ip addresses) will have a much tougher time.

    8. Re:not bad by RealityMogul · · Score: 2, Informative

      Of course you could also have a new combination generated every minute for the super paranoid.

      But I don't think the intent is to prevent people sofisticated enough to actually sniff packets from being able to enter the network, but simply stop script kiddies and worms that are rather mindless in their attacks. I am not aware of any worms that would be able to sniff packets and actually interpret what is happening.

    9. Re:not bad by webtre · · Score: 0

      If you noticed and RTFA'd, current implementations don't have the port numbers in any sensical order, which makes sense if you're making it hard to just simply port scan a machine. Therefore, just running nmap (or something similar) is now going to bw *MUCH* more difficult.

      --
      litigious bastards
      suck it sco!
    10. Re:not bad by 26199 · · Score: 5, Interesting

      Hmm, lots of people have pointed this out, but it's easy to set up a system of one-time passwords... provided it's done in a cryptographically secure way, there's little point in sniffing for combinations.

      Of course, you can still sniff to see what ports are actually in use...

    11. Re:not bad by Atreide · · Score: 1

      well you just have to encrypt the port number, and for this just connect to the ssl port...

      you can even use a security key card that gives you a random number from which the port sequence is selected.

      welcome to paranoia land

      --
      The world belongs to those who get up early. - I'm far from being the king of Earth then :-(
    12. Re:not bad by Anonymous Coward · · Score: 0

      packets part of an established tcp connection give you certain guarantees, you can be confident that your data will end up where its supposed to be going, or you will be notified...this "connection atempt logging" provides no feedback, you can never be sure your packets got there. you might as well be using UDP.

      this will never take off.

    13. Re:not bad by Zetta+Matrix · · Score: 1

      You can implement a standard countermeasure against replay attacks - one time passwords (e.g. OPIE, etc.). Then you just need some function that can turn it into the port combination.

    14. Re:not bad by Anonymous Coward · · Score: 0

      Dead wrong. Port knocking stops 99% of all attackers before they get a chance to interact with server software which has to implement a more complicated protocol. Exploits based on protocol implementation errors are only accessible to attackers who can sniff the knock sequence. If another ssh exploit is found, port knocking will most likely give you the time to update your ssh daemon. All this depends on port knocking being a simple method which doesn't create security risks of its own, which I think is plausible.

    15. Re:not bad by cb8100 · · Score: 1

      "But it does seem like a layer of obscurity to what should otherwise be a secure port. What if someone is sniffing your network? Unlike an encrypted password, they could easily replay this sequence and gain access to your 'hidden' port"

      Well, it seems to me that port knocking is just another level of security to be used on top of encrypted passwords.

      Port knocking could theoretially make social engineering all that much. For example, Joe Hacker -- pretending to be IT Security Guy -- calls A. Dumbass -- lowly intern -- and cons A,'s password out of him. Since the company's SSH client uses port knocking (assuming Joe Hacker doesn't know that), having A. Dumbass's password does him no good.

      Port knocking definitely shouldn't be used in place of traditional security methods, but could turn out to be a usefuly security measure.

      --
      My lack of God, it's Trotsky!
    16. Re:not bad by mugnyte · · Score: 2, Informative

      No, not really. If the pattern changed each time, or access-counts, no two sequences would be the same. Add in a larger set of sequences, with some salt, and you get something analogous to encryption, it seems.

    17. Re:not bad by Anonymous Coward · · Score: 0

      Think about it genius, sure i could install 25 locks on my front door..but getting through that door is going to get annoying very quickly. within a few days you will rip them all off.

    18. Re:not bad by jdgreen7 · · Score: 1

      That was my thought on this process. Design it so that the algorithm is based off of a "seed" of sorts which generates the sequences and gets changed periodically. Let all of the clients know when the seed changes, and their software will generate the correct sequence. Basically, it's another password to remember and to change.

      But, you could also design the software to generate the sequence based on a particular time (even down to the second if you wanted), and have the client and the server synchronized to the same time server.

      Combine all of this with the "secure" programs out there right now, and you have a much harder system to crack. Granted, all someone needs is a copy of the software, the seed being used at the time, and access to the same time server, but that's still a decent amount of extra time they'll have to devote to cracking the system.

      I don't know much about airwave communications, but this sounds similar to frequency hopping.

    19. Re:not bad by gnu-generation-one · · Score: 1

      "The "knocking ports" could also be configured that if there are random hits to the standard port without the proper knock, the system could lock down for 30 seconds and even ignore the proper knock so that if somebody's trying to brute force all the possible knock"

      So you can prevent someone getting access to their own service by doing random knocks every 30 seconds? (for the longest time, I couldn't use my yahoo account because people were locking it out with password-guesses every few seconds)

      So if PINs have lockout because there's only 10000 combinations, what do you need for port-knocking with 2^32^KnockLength possible guesses?

    20. Re:not bad by platypus · · Score: 1, Insightful

      It isn't more secure. It's just more obfuscated, because it's more complex. But that doesn't make it more secure, it makes it potentially _less_ secure.
      It's like saying that if sshd asked consecutively for two passwords before granting access, that would be more secure.
      It's simple:
      a) for every admin, the time he can dedicate to security is finite
      b) every minute the admin cares about "port knockin" lowers the time he can spend for something else
      c) because of the weakness of this "protocol" (non-encyptable, easyly spoofable source IPs), it doesn't save any time somewhere else. E.g. you can't relax any other real security measure because you now use "port knocking"
      It follows that the first effect of using "port knocking" is that there's less time for the other security measures, therefore potentially weaking them.

    21. Re:not bad by enjo13 · · Score: 1

      Not to mention that you can change the port knocking sequence depending on date, time of day, etc.. and build that into the knocking algorithm.

      --
      Turn s60 photos into awesome videos with mScrapbook for all S60 3rd edition phones!
    22. Re:not bad by orthogonal · · Score: 2, Interesting

      Of course you could also have a new combination generated every minute for the super paranoid.

      No, if you were "super paranoid" you'd have two identical one-time pads, one residing on the computer to be accessed, one in the hands of a single person trying to connect.

      Every minute, the computer would consult its copy of the pad to determine what that minute's secret knock sequence would be.

      The person connecting would look up in his copy of the pad that minute's sequence. You'd need to synchronize both participants' clocks, of course.

      Less secure would be generating a new combination -- using some continuous function -- every minute.

      Less secure than the pad, but more secure than a continuous function, would be a cellular automaton -- life Conway's Game of Life -- where any particular minute's knock sequence could only determined by first determining the previous minute's sequence.

      Of course, to prevent the rules from being extrapolated by anyone analyzing your traffic, you'd have to agree on a new function or automaton to use for the next connection before ending the current connection. To guard against interruption of the connection, agreeing on the next connection's function would be the first thing you'd do after making a connection, and to guard against that being interrupted you'd need some fallback combinations -- which brings us back to the one-time pad.

    23. Re:not bad by nolife · · Score: 0, Flamebait

      One of us must be smoking something because your post makes absolutely no sense.

      --
      Bad boys rape our young girls but Violet gives willingly.
    24. Re:not bad by ComputerSlicer23 · · Score: 4, Informative
      But it's not as secure as not running SSH.

      Hence, weather or not it is secure, is all a matter of opinion. Personally, I think if you can't run SSH out in the open, you shouldn't run it thru an obscurity filter.

      We have no SSH configured on our outside network. Not with OTP, not from only allowed IP's. Not from only a specific port. Not with KnownHosts only. Not with known RSA keys only.

      You want on, you've gotta be in the building. It'd be nice to fix problems while remote, but it's just not an option because of the security problems it presents. I live within a mile of the building, specifically so not having remote access isn't a big deal. I can go from sleeping in bed, to in the building in less then 10 minutes. It's a pain for small problems. However, it's small issue in comparison to dealing with a full blown network breakin due to SSH.

      On occasion, I believe we have had someone local build an SSH tunnel that we can VPN thru onto our network. However, someone who already had access had to initiate the connection by hand with the correct IP. That's only allowed if we voice authenticate from you.

      Kirby

    25. Re:not bad by Anonymous Coward · · Score: 0

      So instead of making the port knocking a fixed sequence of values, can you start it at a known port, and perform some function on the sequence number of the ack packet to generate a series of subsequent ports to connect/check against? Presumably, this would also incorporate some extra private data to make it pretty hard to determine what the hell you're doing each time.

    26. Re:not bad by tommck · · Score: 2, Funny

      Rather than sniffing her network and replaying sequences, why not just buy her dinner to gain access to her "hidden port"?

      --
      ---- It puts the lotion on its skin or else it gets the hose again. It does this whenever it's told.
    27. Re:not bad by zmooc · · Score: 0, Offtopic

      Well I'm smoking something and I understood it so do the math:)

      --
      0x or or snor perron?!
    28. Re:not bad by Anonymous Coward · · Score: 0

      It would be simple enough to randomize the knock pattern based on any algorithm that the client and server both know. That way the hax0r would have to snoop long enough to figure out the port knock sequence algoritm...........

    29. Re:not bad by bergeron76 · · Score: 1

      Just what we need - a new DDos method. By using the scenario you described above, an attacker could easily prevent rightful remote users of a service, by simply knocking on random ports.

      It's a very interesting idea, and I tend to think if it can be done properly, it could provide just one more hurdle for haX0rs.

      --
      Don't think that a small group of dedicated individuals can't change the world. It's the only thing that ever has.
    30. Re:not bad by kburkhardt · · Score: 2

      I don't buy it. "Port knocking" feels like more administrative overhead for not much gain.

      a)It causes me to have to remember, code, and administrate another password, which by the way, is common to all users
      b)It is trivial to sniff out anywhere between client and server

      It's akin to hiding your door key under a rock - it's secure until the first time someone sees you retrieving it and opening your door with it.

    31. Re:not bad by cybergrue · · Score: 1

      Even better, implement a time based crypto knock sequence (the knock sequence would change over time) so that repeating a heard knock would be useless. Combined with the lockout period for wrong knocks could kill sniffer based attacks cold unless they intercepted enough signals to guess the crypto.

    32. Re:not bad by Jerf · · Score: 5, Interesting

      ignore the proper knock so that if somebody's trying to brute force all the possible knocks, they'll never get feedback when they have the right one.

      Re "brute forcing"... the number of possible knocks is (ports used for knocking) ** (ports in knock sequence). Yes, that's exponentiation.

      In fact, I'd suggest making the knock sequence much longer then in the article; ten might be good. Then, if you allocate 100 ports to the knocked and randomly select a 10 port sequence for the knocking, you get 100 ** 10 possible knocks, or 100,000,000,000,000,000,000 (100 sextillion) possible knocks.

      With just a few more ports in the sequence and just a modest investment in ports, you can make brute forcing impossible.

      (And if you mix up the ports so they aren't sequential and the attacker has to guess THOSE ports, it goes to approx. (2**16)**(number of knock), so for a 10-port sequence on potentially all TCP ports it's 1,461,501,637,330,902,918,203,684,832,716,283,019, 655,932,542,976 possible knocks, a.k.a. "way the hell more then can be brute-forced".

      (I love posting big numbers on Slashdot.)

      You need to worry about sniffers way more then brute forcers. (And as this is another layer of security, hopefully on top of an already fairly secure protocol like SSH, it's a good thing; now the 'man in the middle' has to have advanced knowlege to even know there's something to get into the middle of!)

    33. Re:not bad by pantycrickets · · Score: 2, Interesting

      It isn't more secure. It's just more obfuscated, because it's more complex. But that doesn't make it more secure, it makes it potentially _less_ secure.

      I think the idea is that an attacker would install a hidden sshd on your system, and you wouldn't know. You wouldn't even see an open port. You wouldn't see concentrations of connections to one "closed" port, but sporatic attempts at a few seemingly random ports. The attacker would use this as a backdoor into your system. I think you got the wrong impression that this would be a keen tool for system administrators for some reason. I didn't RTFA, but jeez.. at least read the summary.

    34. Re:not bad by pballsim · · Score: 1
      Think of it this way... it's an extra password combined with bonus security-by-obscurity of not having a visible password prompt.

      "Famouse last words"...I'm sorry but security-by-obsecurity is not security. Everybody on /. should know that, in fact everybody in the computer industry knows that. It's just a matter of time before somebody breaks it. People have been reverse-engineering obsecurity to get past security for years. Obsecurity sometimes make it a little bit more of a challenge.



      And you know everybody will have the same default knocking pattern. Remember spaceballs? (Person 1) What's the password? (King) 1..2..3..4.. (Person 1) That's the stupidest password ever? (Governer)Change the password on my luggage.

    35. Re:not bad by Feanturi · · Score: 1

      b) every minute the admin cares about "port knockin" lowers the time he can spend for something else

      So? Play UT2k3 at home rather than work.

    36. Re:not bad by Dukael_Mikakis · · Score: 1

      But isn't this precisely a form of security through obscurity? And is it really going to work? Adding another layer of a similar sort of security (where you have to know a password of sorts) is just delaying invasion and likely (slightly, at least) burdening legitimate traffic.

      It's like adding a second metal detector at the airport. If you make it past the first metal detector, then you'll probably make it past the second metal detector also (it'll just take longer), and you slow down all the legitimate non-terrorists in the process.

      It does make it harder, which is good, but superficially so (I think).

    37. Re:not bad by nolife · · Score: 1

      I think if you can't run SSH out in the open, you shouldn't run it thru an obscurity filter.

      My firewall only allows port 22 connections from a few source addresses (an obscurity filter). Are you saying I should be as secure allowing connections from everywhere? I do not see the logic. This whole time, I thought security models were based on a series of layers.

      --
      Bad boys rape our young girls but Violet gives willingly.
    38. Re:not bad by Roofus · · Score: 3, Interesting

      It's like saying that if sshd asked consecutively for two passwords before granting access, that would be more secure.

      In a way it does. It firsts asks for a username, and then a password. If one of them is incorrect, you don't get access. But SSH doesn't tell you which one was incorrect.

      Port knocking is very similar (but not exactly the same). You need to have both keys (port combination) and login info in order to get access.

      The difference is, without the port combinations, you can't tell if the service is up, or your port combination is wrong.

    39. Re:not bad by jrexilius · · Score: 2, Insightful

      well, he worded his point badly but I agree with no service is more secure than protected service. His scenario works for him but not for all of us.

      I will have servers in datacenters spread around the US and possibly overseas. His solution wont work for me. So cost/benefit/risk compromises come in to play, which is where extra layers comes in.

    40. Re:not bad by Anonymous Coward · · Score: 0

      Just like this can be used to obscure backdoors, it can be used to hide remote management interfaces from the port scanning public. Attackers won't get to the part where they try to match your sshd version with their exploit database because they don't even see your sshd.

    41. Re:not bad by LostCluster · · Score: 2, Insightful

      I'm in the camp that all security methods are, at their core, security by obscurity. You're only as safe as your code and key are secret... once that's compromised by either guess and check or outright leak, you're not secure anymore.

    42. Re:not bad by Anonymous Coward · · Score: 0

      I can sniff your pussy, faggot!

    43. Re:not bad by smcpeek · · Score: 1

      It's actually more akin to hiding your door lock under a rock. If someone happens to find the lock, it's still locked. Luckily, most script kiddies would say "hey, a door with no way to open it" and move on.

    44. Re:not bad by bluntmanspam · · Score: 1

      Security by obscurity is not secure by itself. Combined with real security, it is simply another layer.

      I'm not saying that "port knocking" is any kind of real solution at all, in fact I'm inclined to believe otherwise. It's just that it bugs me when people react so automatically to the idea of obscuring a secure service. Think of it this way:

      What if that key under a rock is not the key to the house, but is the key to the lock that covers the lock to the house. Now even if someone holds you up with a gun and takes your keys from you, they can't open the door without knowing where the other key is.

      Sure, obscurity is trivial to break, but its a layer, and that's all. Obscuring a secure service makes it take a little bit longer to break, and sometimes runs off $Cr1pt KiDDIE5. And sometimes that's enough to justify the little bit of extra work.

    45. Re:not bad by platypus · · Score: 4, Insightful

      Ok, let me rephrase what I wrote in another message.

      Open ports per se are not insecure!

      The whole point behind port knocking is the wrong impression that "open" ports are more insecure than "closed" ports. This is totally bogus.
      It's about the applications behind the open ports, and it's not more complicated to write code which listens to a specific port and drops the connection if it doesn't recieve some secret number as the only payload of the first packet, than it is to write the kernel tcp/ip stack.

      That brings me to another mantra

      Kernel code is not intrinsically more secure than application level code!.

      There are many examples for buggy and overflowing tcp/ip stacks (ping-o-death comes to mind if you're somewhat older).

    46. Re:not bad by ComputerSlicer23 · · Score: 1
      Yes, and no. That's fine. As long as you know and trust the IP's that allowed. What I'm saying, is that this port knocking allows anyone from anywhere who knows the trick to "knock" and open the port. You have a specific filter, and you run it in the open. That sounds like security (a compromise between complete security, and your practical need for access). The knock sequence sounds a lot like running telnet to me. There is nothing particularly secure about knocking. It's all done in the clear. Sure there is a secret to it, but there's a secret involved in telnet too.

      My guess is that having a knocking sequence isn't any more secure then not having one in the long run.

      Now, if there we're a one-time pad, and/or the sequence of knocks changed to be cryptographically secure, and shutdown for ten minutes everytime there was something attempted to connect but failed. That's starting to sound a lot more secure to me. Yes, someone could do a denial of service by just constantly port scanning you, but it's definitely more secure then allowing someone to do it via trial and error.

      Above and beyond all that, I'd probably force a page to be sent out when the SSH dameon started up. Thus alerting everyone that someone is getting remote access from a untrusted source.

      Kirby

    47. Re:not bad by C10H14N2 · · Score: 2, Funny

      Great. Just what you want to do is hard-code a quicker way to DoS you system.

      TERRIFIC.

      This will be used only on systems storing highly sensitive Star Trek Fan-fiction.

    48. Re:not bad by Everlasting+God · · Score: 1

      Bravo, I was begining to think I was the only one who looked at this and though 'security through obscurity'. I don't know the numbers for breakins from inside the network vs outside the network off the top of my head, but I do know that the number of inside jobs is certainly high enough that all the people saying 'but to sniff your network they have to have broken in already' are deluded.

    49. Re:not bad by jmv · · Score: 2, Insightful

      Note sure I like the idea, but I think it would really be more secure in one case: worms. That's because they can't really sniff the knocking, unlike a real intruder.

    50. Re:not bad by S.Lemmon · · Score: 1

      Then why not just add a protocol wrapper to the port that requires you to send some special plain-text cookie before you can log in using SSH or whatever? Sure it's not secure in itself, but it's still "more secure" than plain SSH - right?

      Why stop there even - add another wrapper around the first, add port knocking to that and place it all over a VPN! Of course the VPN will also have port knocking, maybe a wrapper or two, and while were at it some special packet timing checks.

      Why we'll all be so very secure then I tell you! Of course each connection will take 15-30 minutes to establish, but hey it's a small price to pay!

    51. Re:not bad by bugnuts · · Score: 1

      Calling something more secure is misleading. It's also more secure to shut off all ports for 2 seconds per day, and this is very much along those lines.

      How much more secure is it? is the real question. It stops a cursory scan, and that's about it. It fails on an attack that knows anything about the network, since all users have to have extensive knowledge of how to access it. It also can cause a denial of service, because a scan occurring while you're trying to knock would garble your own knock.

      The article is slashdotted, but from what I gleen here, it fails horribly on a busy network, too, where the ports will be opened often.

      An interesting method would be to assign each user a "password" of ports, and it would only allow that person to login. You could even implement a one-time secret knock, such as the challenge-response hash s/key, so that the knock would be different each time. It would be both a one-time password, and a highly obfuscated method (covert channel) of delivering the password.

    52. Re:not bad by Anonymous Coward · · Score: 1, Insightful

      You're missing the point. Port knocking hides the existence of an open port from anybody who can't sniff your network. For many systems this means that a large percentage of attackers won't come close enough to your actual daemons to exploit protocol vulnerabilities. This buys you time when a new exploit is released and keeps your system low-profile the rest of the time.

    53. Re:not bad by Carnildo · · Score: 1

      But isn't this precisely a form of security through obscurity? And is it really going to work? Adding another layer of a similar sort of security (where you have to know a password of sorts) is just delaying invasion and likely (slightly, at least) burdening legitimate traffic.

      It's like adding a second metal detector at the airport. If you make it past the first metal detector, then you'll probably make it past the second metal detector also (it'll just take longer), and you slow down all the legitimate non-terrorists in the process.


      Actually, it's more like adding an x-ray machine to the metal detector. They're both looking for the same thing (in the case of the airport, weapons; in the case of port knocking, secret information), but they do it in different ways. As a result, even if you get past one, you've got a good chance of being tripped up by the other.

      --
      "They redundantly repeated themselves over and over again incessantly without end ad infinitum" -- ibid.
    54. Re:not bad by _bug_ · · Score: 2, Insightful

      Of course, you can still sniff to see what ports are actually in use...

      Bingo!

      With a knocking daemon a port scanner is going to see an IP address with no machine on the other end because no response is sent to its connection attempts. It's a great way to conceal the location of a server from broad port-scanning that you currently see on the internet.

    55. Re:not bad by starm_ · · Score: 1

      but it's not a very obscure technique once it has been published on /.

    56. Re:not bad by dpilot · · Score: 1

      Throw in a little salt.
      Throw in the source IP, from whence you knock.
      Throw in the destination IP, upon which you knock.

      Upon detection and acceptance, have IPTables open a point-to-point hole in the firewall between the two IPs, and not generally open the port. Of course this is still security-by-obscurity - barely a step beyond simply knocking.

      It could become strong if you had a password-strength formula to turn source and destination IPs into the knock sequence, assuming Mr. l33t can't reuse your IP, later. At that point, you want to push a time/date stamp into the knock formula, too.

      --
      The living have better things to do than to continue hating the dead.
    57. Re:not bad by trmj · · Score: 0, Offtopic

      just testing my new sig, thanks for thinking of it for me :-)

      stupid 120 char limit though, I had to cut some of it out.

      --
      Work sucked, until it became unemployment, when it became slightly more tolerable. -Tet
    58. Re:not bad by h4x0r-3l337 · · Score: 5, Insightful
      The whole point behind port knocking is the wrong impression that "open" ports are more insecure than "closed" ports. This is totally bogus.

      No it isn't. A closed port does not accept any data, therefore you cannot attack the application "behind it". A port that is open is only as secure as the application listening on that port, which AT BEST is as secure as a closed port, assuming the listening service is absolutely perfect, and has no flaws whatsoever.

      There does seem to be some confusion as to what it means for a port to be "closed", judging from most of the posts I've seen so far. You can close a port, but send "connection denied" replies to anyone trying to connect. This makes the port itself safe, but tells the attacker that there is in fact a machine there on the network (which could be a reason for an attacker to continue to probe and/or attack you in other ways). You can also close the port by not responding to anything directed at it at all. If *all* of your ports are like this, an attacker won't even know if your machine is turned on or off, or if there's even a machine there at all. In a way, you've become invisible. Ideally, that's what you want. Port knocking is simply a way to allow your machine to be invisible while still being able to initiate connections to it from arbitrary IPs.

    59. Re:not bad by laddhebert · · Score: 1
      You could take it a step further and carry a keyfob such as the RSA one time password keyfobs that output a number that you attach to your password when you log in. The number changes at timed intervals so sniffing the password would not be very effecient because 1) it times out after about 10 seconds and 2) it can be used only once. Suppose you have an ACE server running that did the same thing, except it did knock sequences, so you just type your ssh command as this:

      ssh --knock-sequence=98789 yourserver

      The server would then take that number and crunch it to match the sequence.

      Or at least that is how I would envision it working...other than that, it would be a pain the ass to deal with...

      -L

      --
      Don't Panic.
    60. Re:not bad by wolfdvh · · Score: 1
      Ok, let me rephrase what I wrote in another message.

      Open ports per se are not insecure!

      Of course that is true, but it goes back to the old saw about 'defense in depth'. Yes, someone can compromise a machine on the same switch, and ultimately listen to the sequence for replay. However you have greatly increased the cost to the attacker. Unless you, in particular, are the target it is not a cost any will bother to pay.

      Even if they manage it, now they have an open port and then still have to compromise ssh. The more layers of defenses, the higher the cost to the attacker. This seems like an elegant way to raise that cost.

    61. Re:not bad by falter · · Score: 0

      Further more, brute forcing could be prevented if each knock were expected to come from a spoofed address. An algorithm could be developed that would take the source addresses of each knock, in addition to their source ports, and compute what the source address (and, maybe, source port number) will be for the final "legitimate" connection. This way, even if the connection is sniffed, it would be useless unless the person doing the sniffing were to attempt a connection from the same address (which is possible behind NAT, I suppose)..

    62. Re:not bad by pla · · Score: 1

      The whole point behind port knocking is the wrong impression that "open" ports are more insecure than "closed" ports. This is totally bogus.

      Tell me, then, why we all rush to patch our SSH installations every time a new weakness comes out?

      I agree, in theory, a visibly open port does not pose a security risk. Something, however, has to listen on that port, and programmers do make mistakes.

      Adding something like port knocking (see my previous post on this topic for my idea on a more useful generalization of port knocking), a potential attacker needs to find a weakness in both the knock sequence and the SSH (or whatever) server.


      Kernel code is not intrinsically more secure than application level code!.

      I'll agree with you wholeheartedly, on that point. In fact, I'd call kernel code potentially less secure, since, while bad user-space code can cause a few problems, bad kernel code can easily compromise an entire system. And, while I'd like think that kernel hackers take extra care for that exact reason, I'll reiterate - Programmers do make mistakes.

    63. Re:not bad by bobbotron · · Score: 0

      Hm - couldn't a cracker DOS connections to this kind of system rather easily? Yuo could write a program that tries to connect (knock) on ports to the system say while you're program is on knock 200031, and throw the rest of the knock sequence right off..

    64. Re:not bad by Anonymous Coward · · Score: 4, Informative

      It is a common misconception that an attacker can't tell a system which doesn't send reject packets from a system which is disconnected/off. This is not true. The difference lies in the reply from the next hop router. An existing system will not cause a response from the router, but you will get a "Destination unreachable" ICMP packet from said router if the target system is offline. This is because the router times out the target system's ARP entry and then, when the router needs to reach it, can't find the target if it is actually offline. A connected system cannot not answer arp requests (or it doesn't get its packets), so the router always knows where to send the packets and doesn't return "destination unreachable".

    65. Re:not bad by emdean091876 · · Score: 1

      Actually, by crptographic standards, it is not more secure.

      Remeber our mantra: security through obscurity is no security at all.

      The strength of the SSH channel is defined by the symetric key size which, in the case of 3DES, is 168 bits. Concenptually by using port knocking, all you are really doing is adding and additional key to the SSH key. This key is relatively small, and extremely easy to decrypt, all you need is a packet sniffer. So now you're throwing a crappy key, in front of the strong 3DES key. If it takes you 3 months to crack the 3DES key, and 3 seconds to sniff out the knock sequence, then all you are doing is adding 3 seconds to a 3 month hack. That's not really an improvement at all.

    66. Re:not bad by Anonymous Coward · · Score: 0

      What if someone is sniffing your network?

      Change the knock sequence every time after a successful login.

    67. Re:not bad by chhamilton · · Score: 1

      It doesn't have to be that way. There could be a 'secret' shared between the server and the client doing the knocking. This 'secret' could then be used to 'sign' (any strong cryptographic hash) some command, which is then translated into a knock sequence. In this manner, knocks can be authenticated. You'd want to 'salt' the knock as well, so that no two knock sequences would likely be the same. This could be done by using some combination of the source IP/port and date (probably not time, too many synchronization issues there). The knock, when decoded on the server end, could poke a hole in the firewall for the knocking IP only.

      Another way of producing 'salt' to make the knock signatures unique would be to keep a knock-server (a low risk app, IMO) running on a single port. Before knocking, the client would query the knock-server and get some 'salt'. This could then be used as above. I think there are still some possible attacks, but I'm sure with more thought a secure system could be devised.

      In this manner, it most definitely WOULD be another layer of actual security, and not just obscurity (only knowledge of the shared 'secret' would allow successful knocking).

    68. Re:not bad by GooTi · · Score: 1

      It isn't more secure. It's just more obfuscated, because it's more complex. But that doesn't make it more secure, it makes it potentially _less_ secure.

      So? Let's use simpler, one-char passwords then. They must be safer...

    69. Re:not bad by pclminion · · Score: 5, Funny
      In a way it does. It firsts asks for a username, and then a password. If one of them is incorrect, you don't get access. But SSH doesn't tell you which one was incorrect.

      This reminds me of a cgi driven website I visited a loooong time ago (1996?)

      I was creating a user account, and was using the password "beelzebub". However, the system refused to let me create the account. It displayed a page which stated "That password is invalid: It is being used by another user. Please select a unique password."

      Apparently, some genius thought it was good security to ensure that no two users had the same password. I hope you can see the intrinsic flaw in this :-)

    70. Re:not bad by Sick+Boy · · Score: 1

      While you're editing it, you should probably change then to than. HTH. HAND.

      --
      Does narcissism count as a hobby? --Shawn Latimer
    71. Re:not bad by Anonymous Coward · · Score: 0

      Think of it this way. The common network service structure has services listening on an open port waiting for connections. Those services may be protected, but they can be circumvented by exploits like good ol' buffer overflows. This is like having a building's door sitting open, but protecting the door with very large men with nasty looking weapons. Of course, if you can take out the guards in the way, the door is just sitting open.

      With knocking, the door is closed. In order to even get the door open so you can talk to the guard you need to know the knock. If you don't know the knock, you don't even get a chance to punch the guard in the face.

      As for being weak, this is no more or less weak than any passwording scheme. You can prevent brute forcing just by increasing the number of ports used and the sequence length. You can also use classic password rotation techniques. If the server can communicate back to the client, you can implement challenge-response protocols.

      Many people are saying that sniffing is the only problem with this, yet even that isn't a problem if you implement knocking correctly. For example, if you use a random sequence generator as your shared secret, suddenly sniffing becomes useless in the short term because the same sequence will never work twice.

      In the end, this is a very good thing. It's a simple idea that could minimize the chances of exploits in services becoming major issues. It is not merely more obfuscated. It is indeed more secure.

    72. Re:not bad by Rysc · · Score: 1

      It's not like he's suggesting telnet+knocking instead of SSH. It's SHH + knocking. I don't see how that could possibly be construed as a bad thing.

      No, there is not actually any more security once someone connects to the port. But... a random sniffer is unlikely to even SEE the open port, and so will be more likely to move on without attempting a compromise. Any situation which fools a few attackers some of the time into thinking that there's no meat here definitely enhances the "security" of the thing being protected.

      Maybe it's illusionary, but as a small-time guy running a personal ssh server, I know that the only one who would ever have know the sequence of knocks would be me. It's not like there's only once sequence of knocks for all servers, I can pick how many and which ports, like a password.

      So first I find my machine and give it the "it's me" password, so it shows its port. And then I give it my login and password, and I'm in. No one is likely to be attacking my machine, but if they do this one extra level of indirection will make it much less likely that they'll get anywhere. This is more secure! No, it's not REAL security, but it does lend itself to fewer attacks, and attack prevention is close enough to security in my book.

      The one-time-pad idea sound even better, but is really overkill for me.

      --
      I want my Cowboyneal
    73. Re:not bad by owlstead · · Score: 1

      The whole point behind port knocking is the wrong impression that "open" ports are more insecure than "closed" ports. This is totally bogus.
      It's about the applications behind the open ports, and it's not more complicated to write code which listens to a specific port and drops the connection if it doesn't recieve some secret number as the only payload of the first packet, than it is to write the kernel tcp/ip stack.


      Ok, I'll start to rewrite all the applications on my linux server right away...

      There are many examples for buggy and overflowing tcp/ip stacks

      I would root for a fast and well tested linux TCP/IP stack before I would try 20 different (badly tested?) solutions for filtering IP packets. Anyway, you can still do both. I mean, they will have to travel through the IP stack anyway.

    74. Re:not bad by Kwil · · Score: 1

      Open ports per se are not insecure, but they are more likely to come under concentrated attack.

      --

      That Jesus Christ guy is getting some terrible lag... it took him 3 days to respawn! -NJ CoolBreeze

    75. Re:not bad by dotwaffle · · Score: 1

      Sniff-wise, how about connecting to the server on a completely open port, that upon the port being connected to, immediately send info then closes the connection. This info is the DSA info, verify that there has been no swap-arounds. Knocking then occurs to open port 22, and client connects as normal. I can't see any reason why ports 40000-50000 could not be used, I can't think of any game or app that uses this range. There are 65536 ports right? That's plenty... As earlier in thread, 10000 ** 10 is a hell of a big number! In fact, why not make it 100 knocks, which although slow, has no chance of being hacked, as each port connect takes what, 1/100th of a second? 1 second extra to log-in... Big deal! And yeah, carry around the DSA key and the latest knock sequence on a USB Memory Stick. And at the end of every connect, a new sequence is generated and sent to the stick... I think it'd be really safe, and if I'm right, it'll be resistant to DoS as well, won't it?

    76. Re:not bad by bugnuts · · Score: 1

      Typically, information-gathering is a significant part of a targetted compromise. (Ignore the opportunistic compromises using automated script-kiddie worms.) To attack a specific target, you would spend way more than 3 seconds figuring out the knock sequence.

      Mathematically, this poses no challenge whatsoever. But practically it adds to the complexity, and is like the hiker putting on sneakers to outrun his partner when he heard a bear. It makes someone else more attractive to attack.

    77. Re:not bad by onta · · Score: 1

      Port knocking is no more about "security through obscurity" than firewalls are. And it's commonly accepted that firewalls are quite useful.

      Think about port knocking as a "firewall extension", which allows the firewall to filter out a bigger amount of unwanted connections.

      Also, just like this concept can be implemented via port knocking, it could also be done in some other fancy ways, like sending one time passwords via UDP which get no response from the server except the opening of some ports.

    78. Re:not bad by Anonymous Coward · · Score: 0

      Open ports per se are not insecure!

      Not in an absolute sense, but if you're going to make generalizations, let me make one too:

      Open ports per se attract hackers!

      There are many levels of hackers/crackers. Let's consider just two, the script kiddies who will try to get into anything and the hired gun who is paid to get into your company's data center.

      Against the hired gun, this doesn't make it any more secure, true. It will take him a couple of hours to figure out something is going on, and thanks to slashdot, he might consider the possibility of port knocking. If it happens to be a low traffic port that gets only used twice a week in emergencies, he'll have to wait that long to learn the combination or try to get in while the door is open, but in the end, it's no more secure than what's behind the door. You are right.

      But against the script kiddies who just look for any easy targets and move on if they find nothing, having the port closed and blocking packets makes it less likely they'll bother. Heck, under a fully-port-knocked machine, no replies/denies would be sent back unless you knock right, so it will look like the machine doesn't even exist at that IP, let alone figuring out operating system and services. The script kiddy moves on, and you just saved yourself some trouble. Very useful in that 1 hour window before you upgrade your machine after a remote exploit is found.

      (And about your kernel code thing, that's not the issue. Complicated server code that does crypto and spawns processes is more likely to be buggy than a program that listens for 5 pings, with no buffers to overflow, and opens a port to SYNs for 5 minutes. That's what makes port knocking slightly more reliable even if not more secure).

    79. Re:not bad by Anonymous Coward · · Score: 0

      Actually, it's more likely SG-1 Fanifiction.

      In Stargate SG-1 (The TV show), Earth's stargate has an Iris that is usually closed. If you want to come in, you need to radio in a code so they'll know you're a trusted person, (rather than a nuke) and open the iris.

      If you try to come in through the wormhole while the iris is closed, you go Splat! and die. Sucks to be you.

    80. Re:not bad by Anonymous Coward · · Score: 0

      Actually, mroe secure would be making a very large one-time-pad and use that to encrypt all your communication.

      Simply carry a DVD with a few gigabytes of Truly Random numbers, and whenever you connect, the server sends the last ofsset used to communicate, and your client reads from that spot on the DVD, so no part of the sequence is read twice.

      It can be proven to be impossible to decode your communication without the OTP, and it should be impossible to get the OTP without compromising the machine or stealing it from you (but of course, you have the password, which was encrypted by normal means on top of the OTP, in fact you'd want to encrypt everything by normal means so they can't decode your past transmissions easily either).

      You'd need a new DVD after every few gigabytes of transmission, but for emergency uses only it should last you for quite a while. Maybe make a 3.5 inch, wallet-cut DVD so you can always carry it.

      Of course, if you lose the DVD you can't connect and your enemies possibly can.

    81. Re:not bad by h4x0r-3l337 · · Score: 1
      This is because the router times out the target system's ARP entry

      So the attacker cannot tell the difference between a system that doesn't send reject-packets, and a system that has been turned off within the last few minutes or so. If it makes the script-kiddie move on to the next victim, I'm all for it.

    82. Re:not bad by poot_rootbeer · · Score: 3, Insightful

      In fact, I'd suggest making the knock sequence much longer then in the article; ten might be good. Then, if you allocate 100 ports to the knocked and randomly select a 10 port sequence for the knocking, you get 100 ** 10 possible knocks, or 100,000,000,000,000,000,000 (100 sextillion) possible knocks.

      And this number is only relevant if the attempted cracker knows your knock sequence is exactly 10 ports long. Add or subtract a couple steps from the sequence, and the number of possibilities increases factorially.

    83. Re:not bad by platypus · · Score: 1

      (And about your kernel code thing, that's not the issue. Complicated server code that does crypto and spawns processes is more likely to be buggy than a program that listens for 5 pings, with no buffers to overflow, and opens a port to SYNs for 5 minutes. That's what makes port knocking slightly more reliable even if not more secure)


      But the point is that you can't stop using "Complicated server code that does crypto and spawns processes", because "port knocking" is as secure as a telnet connection, is this so hard to understand??

    84. Re:not bad by Anonymous Coward · · Score: 0

      Hey smartass, i'm not going to rip off those locks, but after i've installed the tenth lock on the door i will be going through the window.

    85. Re:not bad by LostCluster · · Score: 1

      Actually, the second airport metal detector shouldn't be as much burden as the first. Why? Because most of the problems were already discovered at the first one. There should never be a line in front of the second metal detector, because it would have the same throughput ability as the first, but would never be challenged with anything more than the actual output (always less than the potential) of the first.

    86. Re:not bad by trmj · · Score: 1

      heh, that would be a good idea. I wish I had thought of it first instead of looking like an idiot for a couple of hours.

      --
      Work sucked, until it became unemployment, when it became slightly more tolerable. -Tet
    87. Re:not bad by marcosdumay · · Score: 1

      And you can aways use an algoritm key to send a diferent sequence each time a connection succedes.

    88. Re:not bad by Anonymous Coward · · Score: 0

      Kernel code is not intrinsically more secure than application level code!.

      There are many examples for buggy and overflowing tcp/ip stacks (ping-o-death comes to mind if you're somewhat older).


      Certainly you can still DoS the system, but actually getting access to the system is a lot harder without an application to exploit. This nearly eliminates one of the worst forms of security failure.

    89. Re:not bad by Anonymous Coward · · Score: 0

      Well, *obviously* the sequence of ports to "knock" would be unique for each attempt.

      Kind of like "one time passwords", where the password (or sequence) changes after each successful connection. And there must be some method for you to remotely determine what the next "knock" sequence would be...

      Steven P.

    90. Re:not bad by perljon · · Score: 1

      you could also use some kind of encryption and changing keys to make the exact ports that you had to knock different each time. Sniffing no longer gets you useful information...

      --
      This isn't the sig you are looking for... Carry on...
    91. Re:not bad by zoney_ie · · Score: 1

      With computers, two things hold more true than in any other area:

      A little knowledge is a dangerous thing.

      and the other is of course:

      Murphy's law - if anything can go wrong it will.

      --
      -- *~()____) This message will self-destruct in 5 seconds...
    92. Re:not bad by ocie · · Score: 1

      There is no need for the sequnce to stay the same. You could use some sort of code hopping algorithm (Like they use in modern garage door openers and remote keyless entry systems). It should also be possible to use some sort of time-based system or a challenge-response system based on a private key. You could also use one-time passwords on a USB dongle or something. Once you are logged in. you could generate some more passwords for the next time you log in.

      --
      JET Program: see Japan, meet intere
    93. Re:not bad by Anonymous Coward · · Score: 0

      But it's not bogus at all. Take the beloved OpenSSH, the supposed "secure" communcation daemon. That code has had as many remotely exploitable bugs as any other "less secure" commonly used network service. If you have port knocking in place you can prevent people from performing recon and using unknown attacks against you. Security through obscurity is not always bad. People who think otherwise have been reading too much Schneirer.

    94. Re:not bad by miyoo · · Score: 1

      It seems like this is a good idea that has to be done in a workaround kind of way by transmitting a port number sequence as a sort of password. It might have been nice if IPv6 had some kind of authentication system directly incorporated. It still couldn't be secure against packet sniffing, but I think it could improve firewall effectiveness against barrage port scanners and the like. Security-by-obscurity alone is not enough, but obscurity does help.

    95. Re:not bad by Anonymous Coward · · Score: 1, Insightful
      A closed port does not accept any data, therefore you cannot attack the application "behind it".


      Don't kid yourself--under port-knocking, every port becomes open, and there's a kernel process listening "behind it" which may or may not have exploitable bugs. Maybe knocking in some weird order could trigger a buffer overflow which grants a root shell or something. You haven't improved the situation at all beyond listening for udp datagrams with plaintext passwords on some udp socket (which gives no indication that it's listening) and opening ports in response to that.

    96. Re:not bad by shaneo · · Score: 1

      Point well taken.

      But I'm most intrigued by the "it's an extra password" comment...why not just add an extra password?

      Create a fake telnet daemon that looks like a telnet daemon and smells like a telnet daemon, but the "shell" provided for the successful login is actually just to allow inbound SSH for 5 seconds.

      No it's not as secure (due to the lack of "obscurity", assuming you by the whole security-through-obscurity argument), but it would be accessible from virtually any machine without the need for a client to do the port connects.

      The whole port-knocking thing is vulnerable to traffic sniffing (as would be a telnet login), so this doesn't seem decidedly worse, while far more convenient.

      Yes, there's an issue if your faux telnetd has vulnerabilities, but it's up to someone somewhere to right good code, isn't it?

    97. Re:not bad by Anonymous Coward · · Score: 0

      carefull, internet protocol does not gaurentee order of packet delivery, there is a practical limit as to how long of a knock secquence you can use. tied of course to how fast you send them. Don't forget about dropped packets either.

    98. Re:not bad by BLAG-blast · · Score: 1
      But it does seem like a layer of obscurity to what should otherwise be a secure port. What if someone is sniffing your network? Unlike an encrypted password, they could easily replay this sequence and gain access to your "hidden" port.

      Use one use knocks, so the same knock doesn't work more than once. Once a knock is used it will no longer be useful and a new knock is required. This could be stored as a list on a pda, watch, back of hand, whatever. It could generated from a formula or something, but this would introduce the chance somebody would sniff a few logins a crack your formula...

      --
      M0571y H@rml355.
    99. Re:not bad by kir · · Score: 2, Insightful

      You've got to be kidding. Right?

      You do not allow SSH connectivity for remote administration even from a few identified hosts (even to only a single host in a dmz with non-port forwarding connectivity in to the rest of the network)? Why? Do you also not allow email in to your network? Do you not allow your users to browse the web (particularly with IE)?

      If you're not doing the other things I mentioned, then you're niave. If you are... ummmm...

      --
      3cx.org - A truly bad website.
    100. Re:not bad by ComputerSlicer23 · · Score: 1
      Nope. I don't have a static IP offsite. You want to fix something you walk someone in the building thru to setup an tunnel to you, initiated from the inside. Alternatively, you get to the building. It's not like building an SSH tunnel is hard. It's a simple script, you just walk someone thru it. All they have to do is log in read the password off the password list (kept in sealed envelopes so we know if someone has accessed one). They have to have get access to the server room. Which is restricted to managers (for emergency cases like this, and the two IT guys). They have to be walked thru the KVM to get to the correct machine. They have to log in, and run one script. If no one is in the building, I don't care if things are broken (for the most part). We have offsite DNS, and I believe offsite mail queuing.

      We have one SSL site, and one public HTTP site. We have 2 exteranl DNS servers, and 2 SMTP relays, and one FTP server. That's it. A total of 3 machines. Oh, plus a couple of routers, none of which have any external access. Even when inside the building, you have to physically be at a console to access the core router. You shouldn't be fooling with routing if you aren't in the building.

      Security is a tradeoff between security, and convience. We pick security every time we can. We work pretty hard to run a static only website. It has very, very little functionality. The SMTP servers aren't the real mails servers, they just queue mail and forward it via an SSL tunnel to the internal network. When I figure out how to have the internal machine request access to the DMZ SMTP relays, I'll be happier (we try and always pull from the private network, rather then push from the DMZ). Our DMZ allows virtually nothing to the private network.

      Everything that leaves the network passes thru a firewall. It either goes via a proxy, or it doesn't leave the network without prior authorization. The FTP server, turns files into e-mails. The FTP server, can only talk to the mail server. The person who should receive the file gets it in an e-mail. Every e-mail has all attachments that could conceivable be executable (screens savers, .pif, .exe, .com, .bat, and a myraid of others), are stripped out of all incoming e-mails. You can't download executable files via HTTP. I can't remember if we figured out how to lock out ActiveX controls or not (I think we did on most of them). You can't do a lot of things on our network. It's a shame, but we run a business, not an amusement park. A handful of people who need better access off the network can get it via a password protected HTTP squid proxy. We log every outside HTTP access. Several different layers of firewalls protect the various networks from letting packets in our out that shouldn't be.

      Last virus we had that was active on our network. 3 years ago. We run a webmail client instead of outlook for 90% of the staff. The rest of the clients are Outlook of some form or another. I miss most of the virus and worm alerts, because none of them has ever affected us. I hear about them via slashdot, but that's all that it ever affects.

      We have centralized syslogging. We have the real machine that logs, which is hooked to the switch via a machine that bridges. Every UDP packet that is destined for the syslog server, is logged by the bridge transparently. That bridging machine has no IP connectivity. So even if some clever fellow blows our network all to pieces, we should still get our syslogs out of the machine that doesn't have a network port to attack. If someone finds a way to compromise a bridge via the packets passing thru it, I'm so screwed it's not funny, but there is nothing I can do to mitigate that.

      We aren't as diligent as we should be. We should more proactively check the logs. We should more proactively setup IDS. We should run more things like tripwire, and rootkit sweeps. However, there are only two guys here. We do all the

    101. Re:not bad by TheLink · · Score: 1

      Open ports are more likely to be insecure than closed ports. Open ports generally involve more software than closed ports.

      If your kernel code is exploitable, it is likely to be just as exploitable whether you have closed or open ports. It is also hard to imagine a kernel programmer being more likely to get drop wrong than get reset/accept wrong.

      Port knocking adds a bit of software (e.g. some perl program following the firewall logs ) to reduce the chance of exposure to attackers of a lot more software especially software written in riskier languages (where it is common for a bug to allow attackers to run arbitrary code of the _attacker's_choice_), by programmers who have proven time after time that they are unable to not make such mistakes.

      Given the risks/impact of turning on firewall logs (diskspace, IO saturation) and a program parsing the logs written in a high level language not prone to buffer overflows (CPU) are reasonably well understood and controlled, the only significant risks I see are the parts where the firewall rules are changed dynamically, and/or services are started. Much care has to be taken here.

      But it seems more likely for a decent programmer to get these right, or otherwise fail in a controlled/safe manner than for say the OpenSSH programmers to get OpenSSH right or fail in a controlled/safe manner.

      The other services (http, smtp) probably have to be opened anyway, and their risk accepted and controlled (e.g. using qmail/postfix instead).

      If http/https services are always exposed I'd personally use a webapp to achieve the same thing (login to get access) - you gain a bit more flexibility and ease of administration esp in multiuser environment. This and variations are commonly implemented for WiFi networks.

      But if you don't have any services you need open all the time, or the services don't allow easy and safe extension, then this "port knocking" is a good tool/idea.

      --
    102. Re:not bad by Fallen_Knight · · Score: 1

      As i see it, the kernal has to deal with requests on closed ports, and i do belive it logs said requests, so to implement this you take said logs and watch for your sequance and when seen open. It would not change existing kenral level security at all. Its all in the implemention.

    103. Re:not bad by platypus · · Score: 1

      Yeah, and you'd have to be damn careful when writing the software which manages that to avoid a DOS attack. First, now you have to log every single knocking, second, you have to track the sequences of every single IP adresses "knocking". Since, I believe, this knocking can be easily spoofed, it should be possible to start ugly DOS attacks just by sweeping the victim with IP packets for every port, with alternating src adressess.

    104. Re:not bad by Fallen_Knight · · Score: 1

      true, but to DOS a user from connecting you would need to know that 1) port knocking is being used, 2) the ip the user is trying to connect from.

      neither witch would be easy to know if your some script kiddie, or even someone with some skill, scanning port ranges for open ports/servers ect

  5. Invasive Security by Anonymous Coward · · Score: 2, Interesting

    This is secure in the same way 50-character passphrases are secure, sure they are harder to crack but who the hell is goig to remember them. The harder you make something to use, users will start trying to find ways around it.

    whats more, connection attempts are easy to sniff, you might as well be using telnet...THIS THING IS BEGGING FOR A "REPLAY ATTACK".

    1. Re:Invasive Security by Catskul · · Score: 1

      But with a password for example, you know where the servics is listening and therefore can attempt to exploit problems with the service that can be exploited without a password. This is like putting the password before the protocol is even accessed.

      All services should be this way. Passwords entered after the service has been accessed in some way always gives a chance for exploitation. This only gives the oportunity to attempt to expoit the OS's basic network funcationality.

      --

      Im not here now... Im out KILLING pepperoni
    2. Re:Invasive Security by Catskul · · Score: 3, Informative

      Also, its not used for the only password. It is added security. Only people who can intercept packets for the host can replay the sequence. This prevents whole sale port scanning being productive.

      --

      Im not here now... Im out KILLING pepperoni
    3. Re:Invasive Security by platypus · · Score: 1

      No, you are allowing yourself to be confused by the fact that there's just a shift of complexity, not a removal of complexity.

      If, say, the Openssh programmers liked this idea and wanted to implement something analogous, they would just insert a step at the very start of their protocol where the client just has to send, unencrypted, a tcp data packet containing just a secret number. Now the server would check if this secret number was correct, and if not, would just drop the connection.
      Do you really think they wouldn't be able to implement this as securely as the kernel code needed for the "port knocking"?
      If yes, look at tcpwrappers and inetd.

      So if we came to the conclusion that something like "port knocking" might be a sensible idea, it surely wouldn't be design as "port knocking".

    4. Re:Invasive Security by Catskul · · Score: 1

      Except that each program wanting to use this technique would not have to implement it at the application level, as it would be taken care of at the OS level. Allowing all existing programs to take advantage of this right now without modification All fixes would happen by patching the OS level implementation rather than doing each for each application. So really there is a removal of complexity. The gains are in eliminating duplicated code.

      Less importantly, the configuration of this for all services could be done

      --

      Im not here now... Im out KILLING pepperoni
    5. Re:Invasive Security by platypus · · Score: 1

      Except that each program wanting to use this technique would not have to implement it at the application level, as it would be taken care of at the OS level.

      You can take care of that problem at the application level (see tcpwrappers and inetd), and this is without doubt - and every kernel hacker I'm sure would agree - more secure than doing that on the kernel level.

    6. Re:Invasive Security by Catskul · · Score: 1

      Once again, though it would have to be done for each application. This takes care of all current and future applications without any consideration by the application programmer.

      --

      Im not here now... Im out KILLING pepperoni
    7. Re:Invasive Security by platypus · · Score: 1

      I'm not sure I understand.
      Tcpwrappers or (x)inetd are exactly what you are looking for, and they proof that this kind of security at the application level doesn't lead to code duplication.

    8. Re:Invasive Security by Catskul · · Score: 1

      After reading what tcpwrappers do, and interpreting what you are saying, using tcpwrappers is effectivly performing the functionality at the OS level. Which revalidates my original point.

      Now you could argue what "OS" encompasses, and while a browser may not be part of the os, by most people's definitions initd as well as tcpwrappers are part of the OS.

      --

      Im not here now... Im out KILLING pepperoni
    9. Re:Invasive Security by platypus · · Score: 1

      No, we are not talking about some semantic games here ("application" vs. "os" level), we are talking about ring 0 vs. ring 3.

      See for instance http://en.wikipedia.org/wiki/Ring_0 for a short description. The point is that code running inside the kernel just doesn't have to abide to the os rules (like file permissions, or capabilities, etc.). That's why rootkits have to manipulate the kernel.
      Tcpwrappers and inetd are running outside the kernel, the tcp/ip stack runs inside.

    10. Re:Invasive Security by Catskul · · Score: 1

      The OS is more than just the kernel

      --

      Im not here now... Im out KILLING pepperoni
  6. Belch by Anonymous Coward · · Score: 0

    Ahhhhh!!

  7. Knock knock by Anonymous Coward · · Score: 0

    Land shark

    1. Re:Knock knock by Anonymous Coward · · Score: 0

      You're showing your age.

    2. Re:Knock knock by Call+Me+Black+Cloud · · Score: 1

      Candygram, anyone?

  8. My idea by Catskul · · Score: 4, Interesting

    I though about this along time ago as a way of hiding a trojan. Of course I didnt patent it so no money for me : /

    --

    Im not here now... Im out KILLING pepperoni
    1. Re:My idea by Anonymous Coward · · Score: 0

      Maybe we should patent it and then never enforce the patent to keep other people from patenting it.

    2. Re:My idea by Anonymous Coward · · Score: 0

      We should encourage a credible organization to be doing this. What other way is there to stop people/companies from enforcing there patents based on common sense?

    3. Re:My idea by Anonymous Coward · · Score: 0

      This idea has been around for a long time. If you think about it, it's no more secure than a plain text password. The idea is pretty dumb.

      "To get into my computer, you have to enter the correct sequence of letters in the correct order in a specified period of time."

      Sure, if you are using "port knocking" to start up an SSH server this adds one tiny layer of security, but it's no more than a password.

    4. Re:My idea by Catskul · · Score: 1

      Except that this way you dont even know that there is a service running. If you put some thought into it, which you have obviously not done, you will see that it has lots of merit.

      Try to avoid the knee jerk "this is dumb" reaction. Not only is it close minded, but if someone has put some time into something, most likely they would have considered the same issues that you have in your 2 seconds of thinking about this.

      --

      Im not here now... Im out KILLING pepperoni
  9. Sniffing by Anonymous Coward · · Score: 2, Insightful

    This security is easily defeated if the connection can be sniffed to find the 'secret handshake'.

    1. Re:Sniffing by Delirium+Tremens · · Score: 1

      Then just implement one-time handshakes in your system. Once a handshake has been used, it cannot be reused again. You have to use another fresh handshake.

    2. Re:Sniffing by tombou · · Score: 1

      well, then you would still have to break ssh. this just adds another layer, not actual security.

    3. Re:Sniffing by Speare · · Score: 1

      This security is easily defeated if the connection can be sniffed to find the 'secret handshake'.

      Consult the Security Design Patterns.

      Alice has a secret knock. And Bob will only communicate after seeing the secret knock. But Mary overheard the secret knock. What can you do to thwart Mary?

      1. Challenge/Response the knock. I knock sequence X, you knock me back sequence Y(X), I know you have the right Y table.

      2. Source Function the knock. I knock sequence Y+X, where Y is some component of my source address.

      3. Combine 1 and 2.

      The "arms race" of security layers is not very hard to predict.

      --
      [ .sig file not found ]
    4. Re:Sniffing by Tassach · · Score: 1
      The ONLY value I see in this is defeating (or at least raising the bar) on port scanning. The only time this would prove to be useful is if you want to conceal the fact that a given port is actually open.

      A grey hat use of this would be to evade a TOS/AUP restriction against running servers on your cable modem detection. A black hat use would be to conceal the fact that you've backdoored a box. I'd be hard-pressed to think of a practical white hat use for this technique.

      If you're really interested in having a stealthy back door, a UDP based listener is probably a better choice. Send a cryptographically signed datagram to port X. The listener send back a NAK, just as if the port were actually closed; but if the payload is valid, it opens up the requested port for a few seconds.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
  10. huff and puff by tombou · · Score: 2, Funny

    little pig little pig...

    let me in

  11. security through obscurity again? by Anonymous Coward · · Score: 0, Informative

    come on kids. Have we not learned our lessons? Even as a one time pad, this is lame

    1. Re:security through obscurity again? by Anonymous Coward · · Score: 0

      What the fuck do you mean, "one time pad"? Do you have any idea what you're talking about?

    2. Re:security through obscurity again? by finkployd · · Score: 1

      One time pad? Do you know what that is?

      And how is this bad? It is an additional layer of security built on top of an already pretty secure system. Security by obscurity is good, as long as it is not all you have. A little bit of obscurity adds a bit, certainly doesn't detract any.

      Finkployd

    3. Re:security through obscurity again? by Anonymous Coward · · Score: 0

      I'd say he doesn't.

      It's not perfect, but at least it uses existing hardware/software in a very simplistic fashion. Gosh, how terrible..

      The packet sniffer posters can give it up too. This is meant to be an outer line of defense, not something as sophisticated or important as secure shell.

    4. Re:security through obscurity again? by Anonymous Coward · · Score: 0

      Likely he's talking about a s3kr3t list of port-knock combinations, where each combination can be used only once.

    5. Re:security through obscurity again? by p7 · · Score: 1

      This is not security through obscurity. I can tell you that I use a port knocking scheme on my server and it doesn't allow you to get in. It will clue you in to the fact that could possibly packet sniff to get the key. Even than you could have a list of one time use knocks or maybe the knock is time based.

  12. Sure by Anonymous Coward · · Score: 0

    Sure it's great if the machine's not firewalled in the first place...

  13. Beavis? by tommck · · Score: 2, Funny

    Am I the only one who heard Beavis say "Port Knocker!"?

    Probably...

    --
    ---- It puts the lotion on its skin or else it gets the hose again. It does this whenever it's told.
    1. Re:Beavis? by Anonymous Coward · · Score: 0

      heh heh heh. You said knocker. heh heh heh heh.
      Yeah, heh heh heh knocker, heh heh.

    2. Re:Beavis? by Anonymous Coward · · Score: 0

      Okay Port Knocker.

      You made an important cultural referece to Beavis and Butthead.. Slashdot should give you more credit.

      B&B actually aren't that hard to draw (with a reference). Back in the day I sent out custom B&B christmas cards.

      I photocopied them in black and white onto card stock. Adding color with highlighters was really easy and very quick when done one color at a time. It is essential for the cartoon effect. I did about 20 cards.

      The people who got them generally flipped out.

      I haven't done that since. The Simpsons are *much* harder to draw, even with the howto's on the net.

    3. Re:Beavis? by jafiwam · · Score: 1

      Hahaha no! You just got me the "redundant" moderation. (See my post below, where I posted before seeing yours.)

      Beavis rules.

    4. Re:Beavis? by tommck · · Score: 1

      yeah... I hate when that crap happens... I think if something's tagged redundant, people should have to link to the exact posting that makes it redundant. If the time stamp is after it or too close in time, it won't accept it... that'd be cool.

      --
      ---- It puts the lotion on its skin or else it gets the hose again. It does this whenever it's told.
  14. Easy enough... by wishus · · Score: 4, Insightful

    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 implimenting it.

    Sniffing.

    1. Re:Easy enough... by Inuchance · · Score: 1

      Of course, you have to be on the same LAN for that to work. Also, note that even then, you'd need it to be a non-switched network for that. If you had access to the machine it was running on, then why would you even care about getting access anymore?

    2. Re:Easy enough... by Patrik_AKA_RedX · · Score: 2, Funny
      If you had access to the machine it was running on, then why would you even care about getting access anymore?
      Well, If you happen to be a trojan, you could log all those secret knocks and do trojan horse stuff with it.
    3. Re:Easy enough... by jdreed1024 · · Score: 1
      Sniffing.

      Sniffing only works on the same segment. It's totally useless on a switched network, which includes most networks these days. Additionally, if the knock sequence is has a sufficiently number of ports, it's simply going to look like a port scan. Which are fairly commonplace these days. Yes, a long knock sequence is complicated to remember, however the program can be automated (so the PHB just clicks on "knock" in the taskbar and it does the rest), to avoid that.

      --
      There is no sig, there is only Zuul.
    4. Re:Easy enough... by LordHunter317 · · Score: 1

      Sniffing only works on the same segment. It's totally useless on a switched network, which includes most networks these days.
      Its easy enough to trick a switch into "hub" mode simply by throwing arp traffic everywhere. More importantly, most switches and routers have a remote monitoring feature that allows you to copy all packets to an interface for monitoring purposes. Gain control of the network gear and then switching does nothing. Most "switched" networks aren't really switched either due to poor planning in many places.

      Additionally, if the knock sequence is has a sufficiently number of ports, it's simply going to look like a port scan. Which are fairly commonplace these days
      No, because if you do a "port scan" and then connect and hold a session on port 22, that looks obvious.

    5. Re:Easy enough... by jdreed1024 · · Score: 1
      Its easy enough to trick a switch into "hub" mode simply by throwing arp traffic everywhere.

      A $40 Linksys box? Sure. Not most enterprise switches. They have sufficiently large amounts of memory that it is difficult if not impossible to break the address table by spoofing MAC addresses and flooding the network.

      More importantly, most switches and routers have a remote monitoring feature that allows you to copy all packets to an interface for monitoring purposes. Gain control of the network gear and then switching does nothing.

      Gain control of the network gear and it's game over, man. Port Knocking or not.

      --
      There is no sig, there is only Zuul.
    6. Re:Easy enough... by Anonymous Coward · · Score: 0

      Thats the beauty of it! As others have pointed out you have to be on the same segment, but you also add in the fact that they have to be the CORRECT sequence and then you can even ban the IP that gets it wrong for X amount of time and it's like a password that can drop the person trying to log on illegitimately.

  15. Password by Kaa · · Score: 1

    Well, it's just a password to connect to a port where the password happens to consist of connection tries to specific ports.

    It's a nice hack, but I am sure there are other ways to implement password-protected port access...

    --

    Kaa
    Kaa's Law: In any sufficiently large group of people most are idiots.
    1. Re:Password by 26199 · · Score: 4, Insightful

      Except it hides that the port is open at all, which is useful.

    2. Re:Password by __past__ · · Score: 1

      Basically, it could be replaced with "ssh server enable_some_service", which would even prevent replay attacks (only drawback is that you have to have some port open). There are already many fine ways to tell a computer what to do, including to allow access to some service for a given time - and connecting to a random sequence of disabled ports does not look particularly elegant to me.

    3. Re:Password by noisehole · · Score: 1

      one could use Packet filter state synchronization to another public unknown box combined with authpf to use additional ports, rather than using "port knocking clients", which itself sounds kind of needless

    4. Re:Password by LordKronos · · Score: 1

      That's what UDP is for. Send the magic word in a UDP packet. If you get it right, you get a response back and can setup your TCP connection. If you get no response back, that could mean you got it wrong or it could mean that there is nothing listening in on that port.

      That would be WAY simpler than this multiple port idea. Plus it gives you more security options...you can use the server's public key to encrypt the magic word in the UDP packet. Nobody sniffing would be able to intercept the magic word, as opposed to the port knocking method, where anybody can sniff the port numbers out of the unencrypted packet header.

    5. Re:Password by Anonymous Coward · · Score: 0

      Except it hides that the port is open at all, which is useful.

      Which is even more useful if you're the author of a worm. With a port knocking worm someone would have to physically lay hands on a box to determine that if it had a backdoor.

      Couldn't the knock sequence be built up using public key cryptography? The sender would have a private key, and the listener would listen for a knock pattern (granted, it would be a lot of knocks) that jived with it's public key. With such a scheme, it should be impossible to remotely determine if a system has been backdoored.

  16. Man in the middle by Anonymous Coward · · Score: 0

    Snoop and replay the pattern.

    You'd need to change the "secret handshake" each time used.

    1. Re:Man in the middle by Anonymous Coward · · Score: 0

      As I said on a previous thread...

      Even as a one time pad, this is lame

    2. Re:Man in the middle by heironymouscoward · · Score: 1

      You can do this quite easily by using a hashing algorithm that incorporates a shared secret. Let's say you hash the current date and time and the shared secret and use this to generate four port numbers. Then a procedure such as 'knock on these three ports and then connect on this fourth one' can be implemented so that the same port sequence never occurs twice, and any sniffing is useless.
      Of course you now need a secure way of exchanging the shared secret.

      --
      Ceci n'est pas une signature
  17. Security by Obscurity by gtrubetskoy · · Score: 1

    I am not at all sure I see the benefit of it. It makes connecting more complicated and therefore troublesome, while sniffing out a "secret" knock should be trivial with tcpdump or whatever tool you like to use.

    1. Re:Security by Obscurity by 26199 · · Score: 1

      That's easy to fix -- just use one-time passwords. A good analogy would be the keyrings used to open car doors remotely; they would be incredibly susceptible to sniffing if they didn't use a different code each time.

    2. Re:Security by obscurity by EricWright · · Score: 1

      Obscurity on top of security is surely better than security alone, no? ssh is a pretty secure protocol as it is. This just obfuscates the path to port 22...

    3. Re:Security by obscurity by skiflyer · · Score: 1

      Because it's a layer, not a complete method.

    4. Re:Security by obscurity by RoundSparrow · · Score: 1

      Read this guy's reply.
      Passwords + keys are nothing more than difficult obscurity.
      Obscurity is the basis of all security, just that "hidden door only" is not good enough. Good security is multiple levels.

    5. Re:Security by Obscurity by Fulcrum+of+Evil · · Score: 1

      A good analogy would be the keyrings used to open car doors remotely; they would be incredibly susceptible to sniffing if they didn't use a different code each time.

      It's too bad that they don't, although it's probably a bit better than the door locks - there are typically only 20 or 30 keys for a given car model/model year.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    6. Re:Security by obscurity by hchaos · · Score: 1
      I thought that it had been decided - security by obscurity is bad! It creates a false sense of security, leading people to think they are safe when in fact they are not.
      How is this "security by obscurity"? Security by obscurity means that security is dependent on the attacker's ignorance of the security scheme. It does not mean that an attacker who has complete knowledge of a system will not be able to gain access. Under this scheme, even if an attacker does know that there is a port combination required, he still needs to know what that combination is before he can gain any access whatsoever. This is what is known as a "password", and I don't know of any secure system that doesn't depend on passwords of some sort. While others have pointed out that discovering the right port combination is trivial for someone who has access to the data packets, getting access to these data packets is generally not a trivial excersize.
  18. Worse? by glpierce · · Score: 4, Interesting

    Right now, script kiddies have their computers automatically try to access other peoples' computers, looking for ones without firewalls, etc.. If this happens, wouldn't you expect them to just send out random knocks in the hopes of getting something? If that happens, you will be more secure personally, but the increased traffic may cause more problems that it solves.

    --
    G
    1. Re:Worse? by crow · · Score: 1

      No, because you would also set it up to ignore all knocks from any computer that has attempted to connect to an invalid port number (one not in any active secret knock), at least for a good period of time.

    2. Re:Worse? by glpierce · · Score: 1

      Ignoring computers wouldn't help - the knock requests would still be made, which is the traffic itself.

      --
      G
    3. Re:Worse? by 0xA · · Score: 1
      What you say is true but it would also have another side effect. Lets say that your average knock sequence is 5 ports long. This happens in a "keyspace" of 64000, now you are scanning 65000 ports 5^64000 times.

      Scanning for open ports just got a whole lot more complicated, no? Almost to the point that it is useless.

    4. Re:Worse? by glpierce · · Score: 1

      If they're half as dedicated as spammers, I wouldn't put it past them.

      --
      G
    5. Re:Worse? by crow · · Score: 1

      If the typical systems using knocking also blocked hosts that used a bad knock, then any script trying to find a knock would have to be patient enough to wait a good long time between attempts. Since there would be no hope of getting through with a fast series of random knock attempts, attackers wouldn't try that. And if the time is long enough (even 5 seconds), they're not going to take months before they can scan for even relatively short knocks.

      Essentially, this makes the problem difficult enough that a brute force scan is not practical, so attackers wouldn't bother trying it.

    6. Re:Worse? by Patrik_AKA_RedX · · Score: 1

      Wouldn't it be possible to make responce relatively slow? Require between the port connection requests at least 1s time. That would effectively limit trafic.

    7. Re:Worse? by _bug_ · · Score: 1

      wouldn't you expect them to just send out random knocks in the hopes of getting something?

      Let's see, a default knock is 5 ports out of 65535, you've got 255^4 (roughly) IP addresses out there.

      I think I'd rather play the lottery, you'd have far better odds.

      It'd be a waste of time for a script kiddie to try and brute-knock one machine, let alone an entire network. Trying to randomly brute-knock the entire internet would be insanity.

    8. Re:Worse? by Kwil · · Score: 1

      Not really..

      Because the odds of a random knock getting to see the open port are astronomical. Their time is better spent going for those systems without port-knocking.

      Example scenario:
      Port 44 runs your service, and is protected by your various SSH and other normal security devices.

      On top of this, you have a knocking system running. Like certain firewalls, it listens for traffic but does not provide any response.

      Now, let's say you've got a very small knocking sequence, port 1223, port 45, port 788.

      First, any hacker coming in does not actually know that you have a port-knocking sequence in effect. You may just have a closed system.
      However, let's assume he's somehow found out that you do have something going on in your system, and determines there must be a port-knocking sequence in effect.

      How many ports does your system have total? Out of all of those, he has to choose the correct three ports to knock on.

      In addition, he has to knock on them in the proper sequence.

      And he has to do this while getting no response from your system indicating anything one way or the other. Once that's all done, only then does the port your service is running on even open. Until then, like every other port on your system, it just sits there silently. So now he has to figure out which port opened to use the service.

      How long do you expect a hacker would bang away at your system before deciding it would be more productive to move on to something else? Add into this, that the longer he bangs on the closed ports, the higher the chance somebody notices what's going on and starts tracking things back.

      The folks who are saying it's "Security through Obscurity" aren't realizing that this is more akin to a password than a hidden access feature. Put a knocking system into place, tell everybody that you're running a service, and even tell them that you're running a knocking system. They still have to crack what the sequence of knocks is in order to get in.

      Now, admitted, it's a particularly poor method for passwords, since anybody who knows the password has to transmit it openly, but as a first layer of security? Good idea.

      --

      That Jesus Christ guy is getting some terrible lag... it took him 3 days to respawn! -NJ CoolBreeze

    9. Re:Worse? by Firehawke · · Score: 1

      I had this exact idea some time back, actually, and that was precisely the answer I'd come to-- if you're blocking IPs for hitting a wrong port for twenty four hours, or even longer, then you're increasing the amount of time for a relatively simple scan by a LOT. Hell, a semi-permanent IP ban after three wrong guesses would be enough to discourage portscans.

      It's not so much security through obscurity as it's an additional layer on top of already good security practices. I'm amazed at how many kneejerk reactions claiming it to be "security through obscurity" without even really thinking it through..

    10. Re:Worse? by Anonymous Coward · · Score: 0

      don't have to. over the internet there is enough traffic that if your knocking packets are sent too fast, there is a good chance that they will arrive out of order. knocking has to occur slowly, whether it is a breakin or a legitimate knock.

    11. Re:Worse? by ACPosterChild · · Score: 1
      To try, yes, but to succeed? There are so many combinations, especially if you increase to 10 knocks (how are they to know exactly how many knocks you require anyway? they won't, so they'll have to start at 5 and work their way up, which makes the number of attempts grow factorially), that there's not enough time in the universe to fully scan a single machine (because you could have a squence of up to 20, 50, even 65K). Even keeping the sequence length at a reasonable 10, a distributed attack on a single server would take so long that it's virtually impossible. The best (even only) way to get past the knocks is to watch and see what someone else does.

      If you're still not convinced, verify it for yourself. Check above where somebody posted numbers for knock length 10. Assume each attempt takes 2ms (which is really LAN speeds, but we're being generous here; we're also ingnoring the timeout time due to there being no RST sent and the sure-to-be-implemented "block everything from an obvious break-in attempt for at least 5 minutes"). Now, since you can assume that the cracker will discover the correct code about halfway through the attempts, and we're using 2ms, you can just divide the number of combinations by 1000 to get the number of seconds (if not using 2ms, multiply by number of ms and divide by 1000). Then just divide by 3600 to reduce to hours, 24 for days, and 365.25 for years. That's the amount of time it will take to find one active server (http, ssh, etc.) on one single computer. Now they have to have an exploit for the particular application they found.

  19. Knock knock... who's there? by bc90021 · · Score: 4, Funny

    Knock knock...

    Who's there?

    Usher.

    Usher who?

    Usher wish I could SSH to your server!

    Sorry... ;)

    1. Re:Knock knock... who's there? by bugnuts · · Score: 1

      Hey, don't knock it until you try it! ... or vice versa.

    2. Re:Knock knock... who's there? by Anonymous Coward · · Score: 0

      Internet: Knock knock...
      SCO: Who's there?
      Internet: Deedee.
      SCO: Deedee who?
      Internet: DDOS!

      he he.

  20. One-time port knocking? by sleepingsquirrel · · Score: 2, Interesting

    Interesting. So the next step would be to have one-time port knock sequences a-la one-time passwords (to defeat adversaries who are grabbing a copy of all your packets). But it seems like there is a race condition between the delay after the knock and the actual connection. Anyone have a solution to this?

    1. Re:One-time port knocking? by v_1_r_u_5 · · Score: 2, Interesting

      After the knock has been verified, open the desired port for a brief time, but only accept incoming connections to that port from the verified IP address. There's still a slight race condition, but at least 99.99999% of the internet is now ineligible to get access.

    2. Re:One-time port knocking? by coyote-san · · Score: 1

      One time key protocols require that the second party communicate a sequence number or nonce or the like to the first party, something that's not possible in this model.

      Before you suggest that one of the ports could respond with the sequence number that determines subsequent ports... if you're responding you might as well make it a genie (as in "open sesame") that handles the authentication directly - if you can respond with the right value the other port is immediately opened without further knocking. But that's a different model....

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
    3. Re:One-time port knocking? by sleepingsquirrel · · Score: 2, Informative
      One time key protocols require that the second party communicate a sequence number or nonce or the like to the first party
      That's why you'd use something like this.
    4. Re:One-time port knocking? by Brooks+Davis · · Score: 1

      As long as you only use this for generally secure services like ssh and you update where there are exploits, the race isn't a very big deal. Effectivly an attacker would have to:
      - detect that you knocked and know what port you will be trying to connect to.
      - bump you off the network before you make a connection.
      - have a working exploit for the service.

      In practice this means they need to be the router since they will need to act as you (since any sane OTP system would include the your IP address in the hash). This is still a risk, but your overall risk is much reduced because the other 2^32-2^22-1=4.29billion valid unicast addresses can't attack the port[0]. Additionally, since you'll have logs on your machine and knowledge of the physical location the access took place from, you'll know exactly where to point law-enforcement.

      -- Brooks

      [0] It's worth noting that very few attacks are directed. Instead they are just hoping to find something. They don't care were it is other then that it has decent bandwidth they can use to spam or attack more hosts from.

      --
      -- Any statement of the form "X is the one, true Y" is FALSE.
  21. Before you complain about "Obscurity" by pclminion · · Score: 5, Insightful
    This adds a layer of obscurity to a security policy. It can't substitute for security, but it certainly can help.

    An analogy would be a military base with a ten-foot-thick steel blast door. This is like having a door that teleports around at random, which can only be frozen in one spot by speaking some magic word. Even if you know the word, you still don't have the key to the door. But if you do have the key, you still can't get in without the magic word because the door keeps teleporting around.

    Obscurity is great, if it is part of a layered security policy which is ultimately based on strong cryptography. This is a really cool idea!

    1. Re:Before you complain about "Obscurity" by Anonymous Coward · · Score: 1, Funny

      That was, quite possibly, the greatest analogy in the history of /.

    2. Re:Before you complain about "Obscurity" by Anonymous Coward · · Score: 0

      That's probably the dorkiest analogy I've ever heard.

    3. Re:Before you complain about "Obscurity" by skiflyer · · Score: 3, Funny

      It's called a secret knock and that's the best analogy you could come up with? Perhaps it's more like a ten-foot-thick steel blast door, but you can't even see the keyhole unless you knock on it just the right way?

    4. Re:Before you complain about "Obscurity" by BubbaFett · · Score: 1

      In a way, it's just a password made of port numbers, with the feature of added obscurity.

    5. Re:Before you complain about "Obscurity" by Nermal · · Score: 1

      Thank you. Couldn't have said it better myself. The only argument I can think of against this would be that the benefits to security are outweighed by the difficulty of deployment. Every client for every supported platform now has to be tweaked to support this "knocking". There's also user education, figuring out a secure way to inform clients of new knock sequences, etc.

      Then again, the same thing could be said for kerberos.

    6. Re:Before you complain about "Obscurity" by LearnToSpell · · Score: 1

      What, you don't like that it's a military base guarding stuff with a ten-foot-thick steel door, but they use teleportation and magic words to really enhance the security?

    7. Re:Before you complain about "Obscurity" by bug-eyed+monster · · Score: 1

      As far as I can tell, this only adds security (through obscurity) against remote attacks made directly to the server. However, a lot of attacks are made indirectly, by compromising the client and sniffing the client's communications.

      This is where obscurity fails, whether it's through plain old passwords or other secret handshakes. All the attacker has to do is gain access to the client, put some sniffer programs on it (key-loggers, packet-sniffers) and record all activities. They'll get all layers of security through obscurity in a single easy-to-use package.

    8. Re:Before you complain about "Obscurity" by Anonymous Coward · · Score: 0

      So we overload the knocking port.
      Big deal. If they do lockouts, we DoS the lockout mechanism. YOU CANNOT WIN EVER.

      Inverse hacking is wonderful, you provide the mechanisms to do it too! (under the false sense of being there to protect you we turn them against you:D)

    9. Re:Before you complain about "Obscurity" by MasterMnd · · Score: 1

      Actually, I think it'd be more analogous to having one of the door hidden in the bookcase things that you might see in the movies. You don't even know the door is there unless you remove the correct book, or know to pull on the torch next to the bookcase or whatever. Then behind that you have a normal locked door.

      The door doesn't bounce around at all, it's right in front of your nose, you just need to know how to make it visible.

      In this case it's more useful to a hacker then a normal sysadmin. a hacker really doesn't want his backdoor to be bound to a port all the time because he doesn't want it to show up in netstat and the like. If your installing a ligitimate service then you could more easily do things like listen on another port for a password before opening this port, or send a few packets to a UDP port that's listening but never responds (scanners wont pick it up, but netstat would), or if you have any public services listening (http, smtp, whatever) on the same machine, then just make it wait for some sort of "secret" request to one of those. Any of these ways of obscuring whatever service you want should be just as effective for the admin who is authorized to do so. Although I think I agree with the guy who effectively said that your time would be better spend just making SSH ask for 2 different passwords/keys/whatever before letting you in.

    10. Re:Before you complain about "Obscurity" by Firehawke · · Score: 1

      Not really-- just one tool on a given OS to do the knocks at the rate specified and where specified, then you go connect with your client of choice-- no changes needed to it. The open time should be enough to allow for you to get in, especially if something of this sort were designed to on-the-fly adjust IPTables configuration.

    11. Re:Before you complain about "Obscurity" by friscolr · · Score: 1

      I'd still rather have a whole tcp stack implemented on top of portknocking. Two machines, no open ports, yet still speaking tcp to eachother. April fool's is coming up. Anyone? Anyone?

    12. Re:Before you complain about "Obscurity" by ACPosterChild · · Score: 1

      You'll have to forgive him. He's seen Krull one too many times... ;)

  22. port 80 knock-off? by sabrex15 · · Score: 1

    I think the /.ers knocked one to many times on this mans port.

  23. Great! by Ex+Machina · · Score: 1

    I can't wait until I want to ssh into home from some cyber cafe behind a firewall or from an os where I can't replicate the knock!

    Security through obscurity rules!

    1. Re:Great! by Ziviyr · · Score: 1

      Means you're protected from nomadic blackhats.

      Did you really want to give anyone who'd drop a keylogger on there the key to do a local root exploit anyways?

      --

      Someone set us up the bomb, so shine we are!
    2. Re:Great! by Ex+Machina · · Score: 1

      s/keys are handy for this!

      Also, most blackhats have tons of rooted boxes to do this from, you PONCE!

  24. Alternate methodology is more secure by Anonymous Coward · · Score: 0

    Do a google search on 'port finger pulling.'

  25. Old stuff by Britz · · Score: 5, Funny

    That is a very old method i developed with my friends. We would only open the door after a "secret" knock sequence. We had seen this on TV and thought this would be cool. We jeopardized the security regularly when we said "wrong knock" after someone else knocked. Usually parents. Then they would say "open up". And we had to comply.

    1. Re:Old stuff by Anonymous Coward · · Score: 0

      A mate of mine and I had a similar system at back in the old days at summer camp. One of us would knock and the other would ask for a password which happened to be "Steve sucks dick for crack" The whole system worked pretty well untill Steve happened to walk past with two of his friends just as I spoke the password.

  26. Doesn't seem like such a great idea by ReciprocityProject · · Score: 1

    It seems to me that anyone who was watching your packets go by could pick out the knocking sequence. Granted, if no one suspects knocking, no one will notice. But, now that it's on the front page of slashdot, I don't think it's very obscure security anymore.

  27. Security by obscurity by DukeyToo · · Score: 1

    I thought that it had been decided - security by obscurity is bad! It creates a false sense of security, leading people to think they are safe when in fact they are not.

    Someone pls clue me in why this is any different.

    --
    Most writers regard truth as their most valuable possession, and therefore are most economical in its use - Mark Twain
  28. More complexity and obsification, not security. by CharlieHedlin · · Score: 1

    The only use I can really see for this is to run servers where you aren't allowed (brain dead ISPs, etc.) As a security method I think it is a bad idea.

    I think we need to focus on cleaning code, using proper passwords and encryption, and having sensible policies, such as locking out accounts for a pre determined amount of time after a login failure.

    Port knocking probably will never catch on for more than a few paranoid people because it requires too much of a change on the client side. It generates more traffic.

    We have secure protocols. I believe priviledge seperation, non-executable stacks, and strong authentication systems are a lot better than some knocking scheeme (which could be easily sniffed, unless it changes, but you would know it was there).

    We need to focus on security, not obsfication.

    1. Re:More complexity and obsification, not security. by Ziviyr · · Score: 1

      Its effectively an unprompted/unencrypted passcode. There is some security to that, though it lacks the mathematical hardness of adding more bits to an SSH key, it could well keep alot of people safe from the next SSH exploit.

      --

      Someone set us up the bomb, so shine we are!
  29. Equivalent to a password by crow · · Score: 3, Interesting

    I was thinking about implementing this a while ago; I guess it's an obvious enough idea that others have been thinking along the same lines. This is equivalent to to putting a password on access to the port.

    Ideally, the implementation will only consider connection attempts originating from the same IP address.

    1. Re:Equivalent to a password by sporty · · Score: 1

      All you'd need to have is for the pattern to change in a sequence, similar to skey. Rotating passwords woul dmake it even better.

      --

      -
      ping -f 255.255.255.255 # if only

    2. Re:Equivalent to a password by Anonymous Coward · · Score: 0

      In my opinion this is not equivalent to the password. Most of the attacks are based on buffer overrun or similar "accidental" bugs in software listening the ports, this method prevents these kind of attacks completely.

    3. Re:Equivalent to a password by crow · · Score: 1

      It's mathematically-equivalent to a password. You have to demonstrate secret knowledge to get access.

      Your point is valid, in that it prevents an attacker from getting access to the most common means of attack. My point is that this new layer of security is much like asking for a password (as opposed to simply obscurity, as others have suggested).

    4. Re:Equivalent to a password by pla · · Score: 4, Interesting

      This is equivalent to to putting a password on access to the port.

      This seems much better than a password, I would think (Though I certainly would still use a password as well).

      As an analogy, if you want to get into a house, and find a locked door, you have a few options... You can try one of those M x N position key blanks, which will take a very very long time (exhaustive search). You can try to pick it (exploit a weakness in the password algorithm). You can try to get ahold of a copy of the real key (packet sniffing, "shoulder surfing", etc). But you have no doubt that somewhere, a key exists that will open that door.

      Now compare that to a solid block of concrete, roughly the size of a house. What does it do? Do helicopters land on it? Does it cover something, or hold something down? Does it have something sealed inside it? You'd never suspect that that, if you utter the magic phrase "Sim sala bim bamba sala do saladim", a door will appear in the side of this large concrete block, allowing those with a key to gain entrance.

      The main difference involves knowing whether or not a way in exists. With just a passworded port, an attacker knows that enough effort will pay off. Adding in port knocking, that attacker doesn't know whether or not their hard work can ever gain them entrance, since a port might well not exist.


      Now, in my opinion, the more interesting question here involves how to hide this from one's ISP (ie, make it snoop-proof).

    5. Re:Equivalent to a password by RuneB · · Score: 1

      I was also thinking about a similar system to the one described in the
      article, except using ping packets instead of using connections to
      random TCP ports.

      The ping command in Unix allows you to specify up to 16 bytes to be sent
      with the ping packet, i.e. a password, which could be detected by the
      firewall and if it's correct, then some action could be taken. As a
      bonus, the standard Windows version of ping doesn't appear to support
      this feature.

      I think such a scheme could be made using a stateful firewall. For example,
      using iptables and Linux 2.6, it could be done using the ipt_string and
      ipt_recent modules.

      --
      dtach - A tiny program that emulates the detach feat
    6. Re:Equivalent to a password by scrytch · · Score: 2, Insightful

      Those are reasonably good descriptions, but you don't need port knocking for this. Just stuff the key in the SYN packet. Don't accept if it doesn't have the magic word. Same effect, no magic cookie, no open port. This only yields to latency analysis, which isn't reliable over anything but a local LAN.

      The only advantage of portknocking is that it's a hack that's doable in userspace without a modified net stack (you may be able to fashion raw packets, but good luck reading them). But enabling the userspace hack would mean poking so many holes in your firewall that you'd degrade the security of the system that you're trying to lock down with this hack.

      I'd file it under "another cute perl hack".

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    7. Re:Equivalent to a password by iminplaya · · Score: 1

      Prof. Wagstaff: " What's the password?"
      Baravelli: " Aw, you no fool me. Heh! Swordfish."
      Prof Wagstaff: "No. I got tired of that. I changed it."

      --
      What?
    8. Re:Equivalent to a password by _bug_ · · Score: 1

      This is equivalent to to putting a password on access to the port.

      This is much better. It's like trying to open a house with a key ring with every possible key on it.

      Problem is, you can't see the house, so how do you know where to stick the key in the first place?

      A knocking daemon is going to make an IP address appear dead. The attacker would get no response at all, not even a connection reset.

      Then you even slow down the attacker because their machine waits for a response until the timeout hits.

    9. Re:Equivalent to a password by pla · · Score: 1

      but you don't need port knocking for this. Just stuff the key in the SYN packet. Don't accept if it doesn't have the magic word.

      Putting the key in a SYN packet, you can snoop. knocking on a seemingly random set of ports, with some care in the implementation (such as using the current time as a component to the correct sequence), you cannot.

      I agree, a "good" implementation of this would require, at the very least, a firewall module... Though not necessarily poking holes in it, since none of those holes actually let traffic through.

      Personally, I'd like to see this idea extended to a general "machine" password, totally separate from any security associated with a particular server bound to a port - That way, you don't need to modify a million and one individual programs that already speak TCP/IP (both clients and servers), you just need a single extra program (a doorbell, if you will). Without ringing the doorbell, you simply can't connect to anything listening on that machine.


      I agree, though, that this goes beyond what the link in the FP had in mind. But take that original idea just a bit further, and you have something that sounds rather useful.

    10. Re:Equivalent to a password by analog_line · · Score: 1

      Now, in my opinion, the more interesting question here involves how to hide this from one's ISP (ie, make it snoop-proof).

      Fairly simple.

      Introduce garbage knocks in the knock sequence. Only knocks 2 5 7 and 12 are important, everything else is crap. Then change where the garbage knocks are after every connection. Then add a third rotation of different key ports. You'll be able to sniff it all, but it will be much much harder for a person to pick out any kind of pattern.

    11. Re:Equivalent to a password by dustmite · · Score: 1

      Something similar: An online banking user at a large South African bank was recently a victim of theft after his pin number was keylogged and sent to the thieves by spyware that he unwittingly installed on his computer by running a binary attachment in a strange untrusted e-mail. The media jumped on this, and made a big stink about how the bank's Internet banking system "was hacked", which of course it was not, as this person effectively was just careless with his pin. In any case, the bank spent a LOT on creating various improvements to the logon system, and one of the features they added was an additional logon password, which, when you log on, you must only enter a random subset of characters in the password, so that spyware keyloggers never capture the full password, making it much much harder for malicious spyware to get the pin.

      Other interesting features they added include a Javascript-based "virtual keypad" to enter your account number and pin (so once again, no keystroke capturing, and much much harder to use mouse capturing unless combined with intelligent screen image analysis), and an option for SMS notification of all transactions on your account, so you get notified on your cellphone when suspicious activity occurs on your account. They also even had a promotion for a while where they fully subsidized (i.e. gave away free) anti-virus software to clients, I think it was to new sign-ups.

    12. Re:Equivalent to a password by scrytch · · Score: 1

      > Putting the key in a SYN packet, you can snoop

      Yes, but you have to have the key in the first place. If you have the wrong key, it looks like the port isn't listening at all. You don't know there's a door, let alone the secret doorbell.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
  30. I see an easy way by Apreche · · Score: 4, Insightful

    There is an easy way around it. The problem is you will make yourself very obvious. Simply pick a time at which the server in question is in high use. Hammer the port. Eventually someone will knock on the door opening it for 10 seconds and you put your foot in the door before they do. The other way is if you can get a packet sniffer simply look at the packets that came before and determine the secret knock.

    This is still an interesting idea and definitely has at least a few places in which it would be an effective authentication mechanism.

    --
    The GeekNights podcast is going strong. Listen!
    1. Re:I see an easy way by Anomander · · Score: 3, Informative

      Any heavily accessed server would have to keep track of source IP. If the knock is abandoned by accessing the wrong port nobody would be allowed to enter as a new knock would start before the previous was finished.

      And if you track the source IP it is trivial to only allow connections from that IP to the server.

    2. Re:I see an easy way by Anonymous Coward · · Score: 0

      There is an easy way around it. The problem is you will make yourself very obvious. Simply pick a time at which the server in question is in high use. Hammer the port. Eventually someone will knock on the door opening it for 10 seconds and you put your foot in the door before they do. The other way is if you can get a packet sniffer simply look at the packets that came before and determine the secret knock.

      This is still an interesting idea and definitely has at least a few places in which it would be an effective authentication mechanism.


      I would think it would not allow just anyone to connect to the port, it would reject all packets unless they matched the ip/mac address of the machine entering the password.

    3. Re:I see an easy way by ballwall · · Score: 3, Informative

      Unless the port was only open to the source that successfully knocked.

      And the packet sniffer wouldn't be required at all if the port was just open to everyone all the time.

    4. Re:I see an easy way by dsojourner · · Score: 1

      Actually, if you require that the real conection come from the same port as the knocks, then the only feasilbe way around it would seem to be port sniffing.

    5. Re:I see an easy way by Anonymous Coward · · Score: 0

      Simply pick a time at which the server in question is in high use. Hammer the port. Eventually someone will knock on the door opening it for 10 seconds and you put your foot in the door before they do.

      Because the server will accept a connection from a different IP than the one that knocked????

      The other way is if you can get a packet sniffer simply look at the packets that came before and determine the secret knock.

      You could simply changed the knock after every successful login.

    6. Re:I see an easy way by Old+Wolf · · Score: 1

      Easily fixed - make the "real" port a non-standard port too (or even better, make it determined by the knock sequence)

    7. Re:I see an easy way by Anonymous Coward · · Score: 1, Insightful

      There is an easy way around it. The problem is you will make yourself very obvious. Simply pick a time at which the server in question is in high use. Hammer the port. Eventually someone will knock on the door opening it for 10 seconds and you put your foot in the door before they do.

      Problem is, servers with any sense of security would quickly firewall you for SYN flooding them.

    8. Re:I see an easy way by Anonymous Coward · · Score: 0

      Close, but IP tracking will block that concept.

      A better way would be to send trojan to someone who uses the service and capture the sequence. Then volia you know what they know (and probably more).

  31. Slashdotted? by Fulkkari · · Score: 5, Funny

    Is the site slashdotted...

    ...or do I have to knock my way in?

    --
    I demand the Cone of Silence!
    1. Re:Slashdotted? by Throat+constant · · Score: 1, Informative
    2. Re:Slashdotted? by savagedome · · Score: 1

      We all are knocking on the same door.
      They want you to knock all over the place.

  32. This sounds as insecure as... by Anonymous Coward · · Score: 0

    ...simply using open ports, but with a whole lot more bandwidth.

  33. 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.

    1. Re:Silent Bob by webbroberts · · Score: 1

      Silent Bob is one of the characters from the movie "Clerks". He was played by Kevin Smith, the director of the film.

    2. Re:Silent Bob by Roofus · · Score: 1, Insightful

      Clerks, Mallrats, Dogma, and (obviously) Jay and Silent Bob Strike Back. For some reason Chasing Amy comes to mind to, but I forget what the relation is as I've never seen it.

      How can you mention Clerks and not the others? Clerks was my least favorite! It had no plot, just that whiney bitch the whole time.

      I'm not even supposed to be here today

      SHUT UP BITCH!

    3. Re:Silent Bob by Anonymous Coward · · Score: 0

      Why must Alice always send to Bob? It seems to me that you're describing a fairly unbalanced relationship, no matter how much you may attempt to Secure your postion by Obscuring the facts.

      We live in Enlightened times. If Bob is negligent in his duty to maintain Protocol, Alice could easily join a Cluster of similarly Rejected women and Negotiate a new Connection with someone more acquainted with the unique Private needs of the modern woman.

      I mean, it's no Secret that Bob should be careful to Service Alice properly if he Expects to continue Pinging her Box.

      It's time to face facts: Sequence matters, and attention to the needs of others is the Key to prevent others from Compromising that which matters most to us all. Serve and ye shall be Served.

    4. Re:Silent Bob by Anonymous Coward · · Score: 0

      A few years ago Freenet implemented something similar to this called "Silent Bob"
      <mrflibble> then he sais
      <dm> "IIRC this wasn't actually implemented in Freenet, but it is the intention to add it at some point."
      <mrflibble> IIRC this wasn't actually implemented in Freenet, but it is the intention to add it at some point.
      <dm> "... Right as soon as we fix freenet. Cause it doesn't work."
      <mrflibble> lol
      <dm> mrflibble: yeah, what a wanker.

    5. Re:Silent Bob by Anonymous Coward · · Score: 0

      Jay and Silent Bob were in Chasing Amy also. They played (strangly enough) dope dealers who ended up being the heros of the main characters comic book.

    6. Re:Silent Bob by Abcd1234 · · Score: 2, Insightful

      Err, they were *in* Chasing Amy? Heck, the name "Chasing Amy" comes from a speech Silent Bob gave in the movie regarding some chick he always regretted never going after. A speech which is, incidentally, referenced later in J&SBSB... specifically, after their monkey got kidnapped by the Hollywood Animals people, Silent Bob attempted to tell Jay that their license plate said "Hollywood" on it. So, Bob started miming, and predictably, Jay simply would not clue in. Anyway, at one point Jay said something to the effect "you can tell that damn Amy story all the time, but you can't talk now?".

    7. Re:Silent Bob by Anonymous Coward · · Score: 0

      yeah, because we have achieved so much
      <dm> yeah, we are the greatest
      <mrfibble> bend over, i just need to fuck you
      <dm> ooh, ooh, fuck me fibble, fuck me

  34. hacker movies by dan2550 · · Score: 1

    this sounds like a really cool idea. not to mention being reminicent of tactics used in (cheesy) hacker movies (like "hackers")

  35. Sniffing Workaround by DeionXxX · · Score: 1

    I'm not sure sniffing would work. Imagine an algorithm for the password based on some variable (time for instance) and a seed (password) that is known to both machines but not transmitted. It would be a bit harder to reverse engineer and crack the "knocking code".

    Just an idea.

    --D3X

    The One Site for Free Adult Entertainment...

  36. ridiculous by mabu · · Score: 1

    Why do people insist on pursuing humanistic metaphors in cyberspace when there isn't a practical application? This whole premise is ridiculous.

    If you want to play with humanistic metaphors, remember the first rule of security is that its better to have ONE door in your house that you keep an eye on, than five windows and two doors with an elaborate security system. In the latter case, you have seven points of entry instead of one.

    1. Re:ridiculous by Linuxthess · · Score: 1

      But there is only one door, not five. The 'port knocking' would be the equivalent of a salesman knocking on pre-specified random windows before appearing again at your now visible front door with another password to gain access.

      --

      I sig, therefore I was.
  37. Re: Replays by Anonymous Coward · · Score: 1, Insightful

    There's no reason you couldn't change the knock sequence after each knock in a cryptographically hard-to-guess way (like the SSH one-time passcode mode) or use a hash of the time of day (to the nearest minute) plus some known pass code, exactly like SecureID cards.

    Preventing replay attacks is not difficult, and the port-knocking technique generally is a pretty cool hack.

  38. Re:CmdrTaco talks about "port knocking" all the ti by Anonymous Coward · · Score: 0

    You are a defamatory bastard! Taco has never been in a bathroom!

  39. Brute Force by savagedome · · Score: 1

    There are only 2^16 ports available. So, basically this knocking technique boils down to choosing a 5/6/7/8 letter password over a 2^16 alphabet. (To be more precise, you can ignore the port numbers 0 to 1023 as part of the alphabet as they are 'reserved'). So, effectively, it boils down to 2^16 - 1024.

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

    1. Re:Brute Force by Fulkkari · · Score: 1

      How hard can it be to implement a mechanism that ignores an IP address after a couple of tries? It would take a long time to brute force this and even though you would get trough this layer, there would still be the "real" layer left.

      --
      I demand the Cone of Silence!
    2. 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!
    3. Re:Brute Force by coyote-san · · Score: 1

      I think you (and the introductory article) have this backwards - you can only knock on unused ports < 1024. Ports higher than that might be legitimately used by the system by network clients and unavailable for "knocking." But it all comes down to the implementation details.

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
    4. Re:Brute Force by clausiam · · Score: 1
      Somebody do the math

      The math:

      5 letter password from 2^16 alphabet = 2^80 possibilities. ~10^24 for the binary challenged.

      In reqular text password terms this is ~ equivalent to a 13 letter password from a 70 character alphabet (uppercase + lowercase + numbers + special characters) (70^x = 2^80 => x ~ 13).

      Last time I checked a random 13 character password was pretty darn hard to brute force.

      /Claus

    5. Re:Brute Force by Janax · · Score: 0
      Actually the math is a lot more complicated than that. What it amounts to is a sequence of letters in a 64512 (2^16 - 1024) letter alphabet. Therefore each "letter" would have a (1/64512) or about 1.55e-05 chance of getting it right.

      Basically this comes down to permutations or combinations, depending if you can reuse the same "knocking port" twice and if the order matters. If you're using the strict "permutations" rule where order matters and you can't reuse the same port, then we get 64512_P_(5/6/7/8) which is:

      64512! / (64512 - 5/6/7/8)!
      Which is a nice huge-ass number. You then take that number, invert it, and that is the chance that you would have on the first try of getting the port-knocking sequence correct.

      Naturally your chances get (slightly!) better on each try after that.

    6. Re:Brute Force by Janax · · Score: 0
      OK - trial run:

      Using a sequence of 5 port knocks would give you:

      64512!/(64507)! =>
      64512*64511*64510*64509*64508=1.117e24
      1/x=8.95086e-25
      chance of getting it right the first try.
    7. Re:Brute Force by Anonymous Coward · · Score: 0

      What about using two different networks(say
      two cable modems from different providers or
      even a combination of dialup/ADSL/cable modem),
      and using the physical proximity of the two hosts
      (or interfaces) to enable or disable ports
      based on the knocks on one host. This should
      take care of the network sniffing. Then the
      only issue would be to avoid DNS hijacking,
      if both the hosts/interfaces use a compromised
      DNS. Just a thought!

  40. NOT security through obscurity by 3Suns · · Score: 5, Interesting

    It should be noted that this is NOT (necessarily) an example of security through obscurity. One could treat the port-knocking sequence as a "key". Long enough keys could make port-scanning impossible for anyone who doesn't know the key. Real mathematical cryptography is based on a similar principle.

    Also, this is only a defense against port-scanning. Even if someone did manage to break the knocking sequence, they would still have to use some kind of exploit against the machine on the port they discovered.

    --

    -3Suns

    ~~~~
    The Revolution will be Slashdotted
  41. VPNs already solved this problem... by zerofoo · · Score: 0, Offtopic

    I already have a solution for this scenario. It's called a VPN. Anyone who doesn't know the "secret handshake" (VPN encryption key) doesn't get past the firewall. I don't have to worry about port 22 on my server....or any other port.

    -ted

    1. Re:VPNs already solved this problem... by Anonymous Coward · · Score: 0

      What if you added this to your listening VPN port (or not listening port) then you're that much more secure!

      If someone doesn't know there's a VPN, why would they assume there's a port knocking service listening and bother trying that just to TRY and get through the VPN!

      I think this is a great idea! Adds another layer of security to existing security infrastructures.

    2. Re:VPNs already solved this problem... by Tet · · Score: 2, Interesting
      I already have a solution for this scenario. It's called a VPN.

      Congratulations. You've just extended your "secure" corporate network beyond the physical walls of the office, and into the house of one of your employees. Are you sure that the machine they're using as a VPN client hasn't been rooted? VPNs have their uses, but they're far from solving this problem, and in many ways weaken your overall security. The correct solution is to change the authorisation criteria from things you know (password, "secret handshake") to things you know plus something else, for example, things you have. We do this with one time passwords sent to a user's mobile phone. Once that's been entered, they're prompted for their normal password. Thus even if the box has been rooted, and has keystroke and network sniffers galore, it doesn't matter. So long as the black hats don't have my trusted employee's mobile phone, they're not going to get in (and furthermore, the unexpected passwords being sent to the phone act as an early warning system to let us know someone's trying to break in). Of course, no security measures are perfect, and theoretically, with root access, they could hijack an existing ssh connection once it's been opened, but it's non-trivial, and we've raised the bar considerably.

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
  42. Why is this usefull? by Anonymous Coward · · Score: 0

    Why not just filter by IP? If you need control over who is allowed to access a port, this seems to be a better solution.

  43. Re:LAST POST IN THIS THREAD GETS 10 DOLLARS by Anonymous Coward · · Score: 0

    No I DO

  44. doesn't sound very secret to me ... by Trygve · · Score: 1

    I could build a backdoor on the server that [...] detects connection attempts to closed ports 1026,1027,1029,1034,1026,1044 and 1035 in that sequence within 5 seconds [...]

    Then your secret handshake wouldn't exactly be very secret, now would it? Why not use something that actually would remain a secret. Something fairly cryptographically strong, for example. It could still run on an unrelated port, and manage access to other ports the same way, but wouldn't be (as) easily broken by restrictive firewalls, wouldn't be sniffable, and still has the added advantage of added security (though by no means a complete solution) without depending on any modification of whatever's listening on the port your restricting access to.

  45. 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...

    1. Re:Old Idea, Different Use by belloc · · Score: 1
      The shady side of hackerdom has been using this very technique to hide their backdoors from port scanning admins.

      Obligatory Wargames citation:

      Eddie Deezen: I can't believe it, Jim. That girl's standing over there listening and you're telling him about our back doors?

      Maury Chaykin: [yelling] Mister Potato Head! Mister Potato Head! Back doors are not secrets!

      Eddie Deezen: Yeah, but Jim, you're giving away all our best tricks!

      Maury Chaykin: They're not tricks.


      Belloc
      --
      I got more rhymes than Jamaica got Mangoes.
  46. Not good by glpierce · · Score: 5, Insightful

    "The "knocking ports" could also be configured that if there are random hits to the standard port without the proper knock, the system could lock down for 30 seconds and even ignore the proper knock so that if somebody's trying to brute force all the possible knocks, they'll never get feedback when they have the right one."

    That would just create a new variant to DOS attacks. Instead of taking you offline, they just persistantly knock on random ports, thereby disabling your ability to communicate with trusted sources.

    --
    G
    1. Re:Not good by KrispyKringle · · Score: 1
      Presumably the parent referred to blocking off that particular IP address. You could certainly spoof it, but this is really no different than current systems that block a session after a certain number of false password entries for a limited amount of time (long enough to make brute-forcing hopeless). It's marginally different, in that if someone spoofs the address of a legit client, he can have that client blacklisted for a short period of time, but this isn't a new idea (there's an Apache module, for example, that blocks hosts that appear to be mucking about or DoS'ing, leaving open a potential spoofing DoS; I run a little bottrap script on my website that blocks spambots, again leaving open the door to spoof attacks and a DoS).

      Not saying it's not a problem, but for people paranoid enough to implement this, it's likely a worthwhile trade-off.

    2. Re:Not good by Anonymous Coward · · Score: 1, Informative

      That would just create a new variant to DOS attacks

      Not true.

      Host 'a' (the server, 192.168.0.1) requires the correct knocking combination to allow access.

      Host 'b' (random knocker, 192.168.0.2) knocks on random ports attempting to cause a DoS. Host 'a' detects the wrong ports being knocked on and does not grant access from host b

      Host 'c' (geniune client, 192.168.0.3) knocks on the correct ports, host 'a' allows access from host c (192.168.0.3/32). Host 'b' can continue knocking on random ports, but at the same time, host 'a' does not grant access from the misbehaving host b, but it doesn't have to revoke access from host c either.

      So how does this cause a DoS?

      The server doesn't have to grant access from 0.0.0.0/0 when a single host knocks correctly, or did I misread the article?

    3. Re:Not good by theLOUDroom · · Score: 4, Informative

      Host 'a' (the server, 192.168.0.1) requires the correct knocking combination to allow access. Host 'b' (random knocker, 192.168.0.2) knocks on random ports attempting to cause a DoS. Host 'a' detects the wrong ports being knocked on and does not grant access from host b Host 'c' (geniune client, 192.168.0.3) knocks on the correct ports, host 'a' allows access from host c (192.168.0.3/32). Host 'b' can continue knocking on random ports, but at the same time, host 'a' does not grant access from the misbehaving host b, but it doesn't have to revoke access from host c either.

      So how does this cause a DoS?


      The ports being knocked are closed. This means that the server can never veify the the knocks coming from 192.168.0.3 are really coming from there, or if they're coming from 192.168.0.2.

      If the server is .1, I'm .2 and you're .3, I just keep knocking ports at random spoofing my ip to say that I'm .3 You can't IP block me, and my knocks look just like your knocks. This keeps screwing up your login and you can never open the connection.

      --
      Life is too short to proofread.
    4. Re:Not good by 0x12d3 · · Score: 1

      I agree, add a spoofed hostname and you've got yourself a canned DOS attack!

    5. Re:Not good by Anonymous Coward · · Score: 0

      That would require .2 has to know that .3 is where the connection attempt is comming from. That is not what the goal of this system is, the goal was to allow a stealth server to accept connections from arbitrary ip addresses. .2 has no clue what the ip of the propper connection attempt is.

    6. Re:Not good by Anonymous Coward · · Score: 0

      So how does this cause a DoS?

      From the original porst, you are missing that the system could lock down for 30 seconds and even ignore the proper knock so any attacker could randomly knock on ports to provoke a 30 seconds delay, denying access even for legitimate users.

    7. Re:Not good by Anonymous Coward · · Score: 0

      The denial or 30 second delay would be for the IP address that goofed.

      The IP1 for the client is part of the IP packet and part of the knock's encrypted data. IP2 the "DOS"er does not know the encyption details and will take much effort to figure it out.

      If both the knock encrypted IP and the source IP of the knock packet are not the same, block the source of the attempt, in this case IP2, for say 30 seconds or even more.

      Use a list of IPs that failed and a timestamp to disable their future attempts for an extended period if they failed the knock attempt X many times.

      Place trigger ports above and below the minimum port to instantly set off alarms. Move the minimum port to different places by date or time.

      There are all kinds of ways to enhance, but unless you know a machine is using the knocks, what does it matter. Admins can see the blind attempts on machines not using the knocking and block the IP from any travel on their networks. Even labelling it as a dummy's DOS attempt.

  47. Retarded by TheRealMindChild · · Score: 1

    This could easily be sniffed detected by malicious parties, as well as exploited pretty easily. The only way I would feel secure with this is if the pending port connection checked the IP of the incoming connection, at which point, the knocking becomes pointless

    --

    "When life gives you lemons, don't make lemonade. Make life take the lemons back!" -- Cave Johnson
  48. secret knock should also be coded by six11 · · Score: 1

    Some people have already pointed out the obvious weakness of this, that the secret knock is only an added layer of obscurity, and security by obscurity is flawed in many ways. But this scheme could be a little more secure if the knock itself was a function only known to those 'in the know'. For example, it could be a function of time, so if time.nist.gov says it's time X, then I look in my secret list of knocks and get the port and timing sequence for this particular f(X).

    A third party could be watching your knock, and as soon as they recognize the knock they could try it themselves. But by then, the knock-as-a-function-of-time would have changed, so it would do them no good.

  49. Re:LAST POST IN THIS THREAD GETS 10 DOLLARS by Anonymous Coward · · Score: 0

    Nuh uh! I am the winner of the ten bucks. It's okay, I'll buy you a beer.

  50. Port knocking IS Patriotic: +1, Hilarious by Anonymous Coward · · Score: 1, Funny

    Before you Slashdot about "port knocking", please
    send your text through a spellchecker.

    "implimenting" should read "implementing".

    Remember, the "President"
    was AWOL

    Regards,
    Kilgore

  51. Possible problems by Mr.+McGibby · · Score: 4, Interesting

    What if multiple attempts from the same IP are made to access the port at the same time? Wouldn't the knocks get all mixed up?

    --
    Mad Software: Rantings on Developing So
    1. Re:Possible problems by rossz · · Score: 1

      Properly done, it would match the knocks to the sending ip address.

      --
      -- Will program for bandwidth
    2. Re:Possible problems by Mr.+McGibby · · Score: 2, Interesting

      RTFC. That's what I asked. What they *are* from the same IP.

      --
      Mad Software: Rantings on Developing So
    3. Re:Possible problems by Dark+Paladin · · Score: 1, Redundant

      You'd probably want to have it check by IP address, so you could have:

      Knock: 1143 5547 1212 = port 22 open

      IP1: Hit port 1143.
      IP2: Hit port 1143.
      IP1: Hit port 5547
      IP2: Hit port 5547
      IP1: Hit port 1212
      IP2: Hit port 3354

      IP1 allowed, IP2 port still closed.

      This would also help to stop timing issues, such as someone hitting port 22 every second in the event that a valid user "knocks" and opens the port - only the IP address of the port that performed the valid knock gets inside.

      It's really just another layer of security, but an interesting idea.

    4. Re:Possible problems by Shurhaian · · Score: 1

      What would be so critical that you need to open two connections to the same host at the exact same time? Open one, then open another if you need to.

      For an automated system, enforce a wait time(possibly small) between requests - or ensure that another application cannot access the same resource until the first is done; subsequent attempts would be queued. This notion of mine would imply that requests are actually being routed through a single local process and not directly by the accesesing application, so is probably impractical, but nevertheless, why do you need to open two connections to the same place at once?

      Even if it's to two different ports on the target machine, you should be able to wait for the knock sequence to be completed and the first connection opened before starting the second knock.

      --
      NB: YMMV. IANAL. Take the above with a grain of salt.
    5. Re:Possible problems by Mr.+McGibby · · Score: 1

      If I have a script that encasulates this process and I tell some other app about the script, this app rightfully thinks that all it needs to do is call the script to get access. Say it's web site mirroring tool. If the app tries to download two things at once, there is a good chance of problems.

      Your solution of routing everything through a single app is probably the only solution to this problem. Maybe the kernel.

      --
      Mad Software: Rantings on Developing So
    6. Re:Possible problems by forrestt · · Score: 1

      What would be so critical that you need to open two connections to the same host at the exact same time? Open one, then open another if you need to.

      You may have a point for a workstation, but if you are on a server and wish to open a port on another server, you may need to do that at the same time. For example, if your webserver runs an app that needs to talk to your database server, it will need to knock to open a port. It may need to make several connections at once during busy times of the day. This will need to be addressed.

    7. Re:Possible problems by Glog · · Score: 1

      Also if the algorithm uses specific timings between knocks it can get screwed up due to the fickle nature of network latency.

    8. Re:Possible problems by back_pages · · Score: 1
      I wonder myself about that. It would seem to me that having a dynamically changing knock sequence would be very beneficial.


      The server can basically eliminate "port knocking collisions" by arbitrarily adjusting the dynamic sequence as necessary. The message could be like, "You know the normal next port? Yeah, go one up from that."


      The password challenge has three outcomes: Right pw, Wrong pw, and Wrong Port. Any legitimate user could screw up the password now and then, but no legitimate user should ever get the Wrong Port failure. To make this work, though, I'm thinking that your "profile" would have to consist of something like your username, your (human typed) password, and something that your client stores like a PGP signature. A bad guy would have to steal both your password (in your brain) and your PGP-style signature (on your computer) in order to spoof your identity to such a session. If you have an extremely high prejudice against Wrong Port failures (which isn't unreasonable, since it should be immune from human error) then your password becomes necessary, but not sufficient to gain access.


      I think the port knocking has great potential but perhaps isn't quite mature. But hey, maybe I'm just missing the obvious stuff.

    9. Re:Possible problems by Anonymous Coward · · Score: 1, Interesting

      You havent looked at how TCP/IP works evidently.

      Lets say you had to knock on port 333, 555, then 444. And you did this with two applications at once. The firewall should see it like this if your knocking application is programed properly.

      TCP SRCIP PORT 1024 DESTIP PORT 333
      TCP SRCIP PORT 1024 DESTIP PORT 555
      TCP SRCIP PORT 1026 DESTIP PORT 333
      TCP SRCIP PORT 1024 DESTIP PORT 444
      (the first connection has authenticated now)
      TCP SRCIP PORT 1026 DESTIP PORT 555
      TCP SRCIP PORT 1026 DESTIP PORT 444
      (the second connection has authenticated now)

      It looks like if it was programmed correctly port knocking would work fine.

    10. Re:Possible problems by Mr.+McGibby · · Score: 1

      MOD PARENT UP

      This is the solution and I hope that this is how it's done. One question though. The application is making multiple connections. How does the app guarantee that the outgoing port is going to be the same every time?

      --
      Mad Software: Rantings on Developing So
    11. Re:Possible problems by Pheersome · · Score: 1

      If the client is coded st00pid like it is now, then yes. (No insult to the people that actually developed this... it's a great idea, and the implementation is reasonable, but not how I would've done it.)

      The problem is that a new socket is created for each knock, so you have a different address (=IP/port pair) for each knock. If the knocks from one access attempt all came from the same port, we'd be golden.

      So how do we fix this? Well, we could try binding to the same (though random between executions) high port for each knock. I haven't experimented enough to see if this can be done reliably on a busy system, but it might be possible.

      Also, the daemon would have to take the source port into account for verifying access attempts.

      --
      Better to light a candle than to curse the darkness.
    12. Re:Possible problems by Shurhaian · · Score: 1

      Ah, good point. Being a purely workstation user myself it's easy to lose sight of such constraints. Routing everything through a daemon that enforces a delay(or even sequence) would quickly result in huge performance losses on a busy server, I can see that now. It also might not be enough if the server being knocked just drops the packets, rather than sending back a refusal.

      Having the port "time out" and lock with respect to the source IP only after a specific time(it need not be long, depending on turnaround time) might help to fix this, but results in decreased security.

      So this might only be useful for things that don't make so many requests - like SSH. HTTP, SQL, even e-mail might overload it. (SMTP, at least - retrieval mechanisms like IMAP or POP would be more likely to run workstation-server instead of server-server, and note that I don't mean server vs client here.)

      --
      NB: YMMV. IANAL. Take the above with a grain of salt.
    13. Re:Possible problems by Anonymous Coward · · Score: 0

      standard bsd style sokets apis (ie what practically every os includeing windows uses) allow you to choose the local port to bind on for an outgoing connection

    14. Re:Possible problems by Shurhaian · · Score: 1

      Perhaps a program that acts as a proxy, then? Anything you need to have knock elsewhere, you tell to connect to your local proxy, with the information required to knock. It would try connecting to the remote server, and return some sort of failure - connection refused would be closest to the literal truth, authentication failed would be what it actually means...

      Anything I try to think of would be a hack. And while there's nothing wrong with that in the short term, it's looking like it'd be much more reliable to write a knocking SSH (or whatever) client that expected you to have a particular service or daemon running, and attempted to communicate with it. Thus there would be some resistance to implementing this mechanism.

      For those who want the additional (NOT replacement) layer of security, it might be worthwhile to overcome that resistance. Someone could write the "listening" routine and a compatible "knocking" daemon, and a man page detailing how to communicate with the daemon is all developers for it need to know if they only want to make programs to call this daemon. I daren't go into further detail until I actually know something about how processes communicate beyond "kill (PID)" (kill -s KILL if it's sticky, kill -s HUP if I'm getting inetd to reload its .conf).

      Maybe it would be an option to have the program connect to the daemon, give the details, and the daemon would tell the program when to actually try connecting to the server(via a "done" message and disconnect)?

      As I am not a developer, I realise I've probably bent the accepted syntax to hell and back, but if the meat of my post is unclear, I'll definitely try to clarify(with better syntax if I get suggestions on same).

      --
      NB: YMMV. IANAL. Take the above with a grain of salt.
    15. Re:Possible problems by Shurhaian · · Score: 1

      The software might have to be written to only use a single port, perhaps? i.e. if a port stays open, wait for it to close/force it to close before proceeding. I can see this causing problems if multiple attempts collide, though.

      Of course, this might be because I just don't know how the TCP stack actually works deep down. But so long as the connection attempts are in series rather than in parallel...

      --
      NB: YMMV. IANAL. Take the above with a grain of salt.
    16. Re:Possible problems by theTerribleRobbo · · Score: 1

      What about NAT, say, from Uni, or from behind a company firewall? One is the right connection, the other belongs to the 1337 haxx0r in the room next door.

      > For an automated system, enforce a wait time(possibly small)
      >between requests

      Effectively leaving a way open to DoS yourself - the aforementioned cracker sends a number of 'knock' attempts, thereby locking you out while the system enforces the wait time.

      Cracker resends, wait time, cracker resends... DoS.

  52. Great for SSH by zulux · · Score: 2, Interesting



    OpenSSH is a great peice of sodtware - but it's so huge that I can't help but think that their could be flaws in it (like the one of 6 months ago)

    I would love to layer another peice of security infront of OpenSSH and this seems like a great idea.

    --

    Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.

    1. Re:Great for SSH by Anonymous Coward · · Score: 0

      If it its so fucking bad, why don't you use SSH.com or some other implemtation? I just love you jerkoff homo faggots that bitch and moan about OpenSSH but do abso-fucking-lutely nothing to help the project.

    2. Re:Great for SSH by runswithd6s · · Score: 1

      Bogus argument. SSH is large, but its functionality is well received. If you're looking for a small, simple encrypted remote login client-server, look into SSL(and SASL) enabled telnet. netkit ships with SSL support now. ftp://ftp.uk.linux.org/pub/linux/Networking/netkit . (The netkit README does not suggest running telnetd, however. Take it as you will.) The FSF also has a telnet daemon under the GNU inetutils project. I don't see SSL encryption, but I do see kerberos.

      --
      assert(expired(knowledge)); /* core dump */
    3. Re:Great for SSH by zulux · · Score: 1

      Bogus argument. SSH is large, but its functionality is well received.

      A year ago I would have agreed with you - but OpenBSD has been reviewed by muitiple *experts* for years - and yet there still was a problem.

      There is the potential for more problems - and I just can't quite trust it perfectly anymore. -Ben

      --

      Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.

  53. Reverse-knock by Seft · · Score: 5, Interesting

    Has anyone implemented a system where a service would be stopped if the ports next to it were scanned? i.e. if 1024, 1025, 1026, 1027 were scanned, a service running on 1028 would stop.

    1. Re:Reverse-knock by Maljin+Jolt · · Score: 1

      That one's easy. Randomize scan. More, it would be a cheap dos attack, just by scanning.

      --
      There you are, staring at me again.
    2. Re:Reverse-knock by slartibart · · Score: 1

      That would work for a while, until people started scanning ports out of order.

    3. Re:Reverse-knock by Seft · · Score: 1

      Even so, it would provide an extra layer of security.

    4. Re:Reverse-knock by Gerret+Swearingen · · Score: 1

      Yes. I can't remember what the project was called, but I found it on Freshmeat.

    5. Re: Reverse-knock by rk · · Score: 1

      Unfortunately, you have just created a way to DoS yourself. I just repeatedly hit ports 76-79 and your web server stops. Others I'm sure will cover scanning in non-numeric order as a way around this.

      I had a firewall configuration once that looked for connections to closed ports. If I saw one IP address connect to three different closed ports, it dropped ALL subsequent packets from that IP address for an indefinite and highly extended (i.e. weeks) length of time. I could probably adapt that code to do something like this.

    6. Re:Reverse-knock by _bug_ · · Score: 1

      Has anyone implemented a system where a service would be stopped if the ports next to it were scanned?

      Probably not a good idea. It'd be an easy way to DOS the server on port 1028. Just keep scanning and you effectively shut the server down from accepting any connections.

      Perhaps in environments where a service can be shut down like that (small, very high security networks) that might be worth something.

    7. Re:Reverse-knock by dk.r*nger · · Score: 2, Interesting

      That's easy.. hit three unassigned ports, and you buy your IP-adress a nice firewall rule for an hour or so...

      Your legit users (' software, anyway) usually knows how to connect to the real port first time.

    8. Re: Reverse-knock by dustmite · · Score: 1

      Unfortunately, you have just created a way to DoS yourself. I just repeatedly hit ports 76-79 and your web server stops. Others I'm sure will cover scanning in non-numeric order as a way around this.

      This is probably a stupid/naive question, but why not just (in above example) block port 80 temporarily ONLY FOR the source IP address of the scan? So everyone else gets in fine except the port scanner doesn't see the listening port. (And IP spoofing is not relevant over the Internet anyway, i.e. no point in faking source IP or you won't know the results of your scan anyway.)

    9. Re:Reverse-knock by ADRA · · Score: 1

      Yes, It is called PSD for iptables. Once an IP address has reached a certain port scanning threshold, the match rule is evoked, and you can reject/drop or any other iptables jump target.

      --
      Bye!
    10. Re: Reverse-knock by rk · · Score: 2, Interesting

      Not at all, and it's not a half-bad idea, but it's also not what the other poster was saying. He was talking about temporarily shutting down a service, which I interpret differently than firewalling a single IP out.

      What I used is really just a variant of your idea, just taken to paranoid extremes. Instead of blocking just port 80, I blocked all of them. Instead of temporarily, it was essentially permanent, except that I was too lazy to work up a "save the updated rules automatically" script, so when I rebooted, those IPs could play again. Since that system had an average uptime of months, those IPs were effectively banned for quite some time.

    11. Re: Reverse-knock by theTerribleRobbo · · Score: 1


      NAT. One person scans from behind a University NAT box, and the entire Uni is blocked. Or, at least, that particular NAT box.

    12. Re: Reverse-knock by Seft · · Score: 1

      That's a much better idea. I'll try and give it a go.

    13. Re: Reverse-knock by rk · · Score: 1

      True, things need to be tailored to the environment they run in. This was not a box that offered services to the world at large, but I still wished to be accessible to the world at large (I'm out-of-town and want to quickly log in from an unfamiliar place). If I was running I huge E-commerce site, I wouldn't recommend my strategy.

    14. Re:Reverse-knock by Maljin+Jolt · · Score: 1

      That one's easy too. In scan, fake IP to any of server's peers, dns, gateway or clients. Thus, a paranoid server will dos itself by his own firewall rules, for hours...

      --
      There you are, staring at me again.
  54. I had this idea a while back by jaylee7877 · · Score: 0

    Yeah, I know I'm always saying that, I need to start taking out patents instead of letting other people steal my idea. Anyway there's a few issues here: 1. The "knock" ports need to be open all the way to the server. This means that you'll have to punch holes in your main firewall or else not use 1 main firewall but instead indiv. firewalls per server which tends to be less managable/less secure 2. There's no real set way of implementing this yet. Try telling your users to first run telnet 1023, then telnet 1059, then telnet 1236 then actually ssh into the real port. Course if your this paranoid it's probably an ultra secure box anyway. It'd be awesome to see this implemented and allow for easy "keying" of the ports, so I can choose any number combo I prefer. Of course it should then also make sure the ssh connection is coming from the same IP that knocked. And it might take a while but a sniffer would crack the combo...

  55. Implementations? by crow · · Score: 2, Interesting

    Could this be implemented with IP Tables under Linux? I remember seeing a set of rules to detect a port scan; could a similar set of rules be used to unlock a port for a given remote IP number?

    Of course, this won't take off unless there's also knocking support built into the clients (like ssh).

    1. Re:Implementations? by Firehawke · · Score: 1

      That's what I'm waiting to see, myself..

      Though, you don't need knock support in clients, really. Just create a knocking tool that will do the process and run it before you start your first connection.

  56. Impressive until you start thinking about it: by Sabu+mark · · Score: 1

    Hmm - port knocking is all well and good, until someone finds out about the secret knock through some means (e.g. "hello, I work with the security department and we need your password and secret knock").

    So, we'll need to change the knock every so often, and we'll have to securely communicate what the new knock is to everyone who needs to know it.

    So we'll use encryption so we can securely communicate the port-knocking key so we can securely communicate.

    Hey, I have an idea: let's just use encryption in the first place and not even bother with port knocking.

    --

    What Would Jesus Do
    (for a Klondike bar)?
  57. "Port Knocking" by Unknown+Kadath · · Score: 0, Funny

    It sounds like a euphemism for something obscene. I bet it's illegal in Texas.

    -Carolyn

    --
    Like Daddy always said: if you can't dazzle 'em with brilliance, baffle 'em with bullshit.
    1. Re:"Port Knocking" by Ancil · · Score: 1


      Only if you're accessing a backdoor.

  58. Site down - anybody got a mirror? by RicJohnson · · Score: 1

    it's been slashdotted Anybody got a cache?

    1. Re:Site down - anybody got a mirror? by Anonymous Coward · · Score: 0

      You are just using the wrong knocking sequence.

      The combination to their air shield is
      1..2..3..4..5..

  59. Port knockers could just use... by Anonymous Coward · · Score: 0

    ...silicone implants to spoof their way in. This will cause the so-called Pam Anders or 'Andersing' of your server.

  60. Great, except for the bugs by ilovekimmy · · Score: 1

    This will work great, until someone finds a bug in the knock processor, and uses it to root your box.

    --
    I love Kimmy!
  61. Re:Uh, by Anonymous Coward · · Score: 0

    Pon mah dick, nigga!

  62. Cisco Reflexive ACLs by csmacd · · Score: 1

    Cisco ACLs can be configured to change when a particular login is observed.

    I would think that this method would be slightly better, since the router can require authentication before opening the port.

    --
    Don't pick up the pho*(@)$*@&@!@ NO CARRIER
  63. did anyone else... by SkArcher · · Score: 0

    just see a Microsoft "get the facts" advert on /.?!?!

    --

    An infinite number of monkeys will eventually come up with the complete works of /.
  64. to those making the obvious "sniffing" comments by dAzED1 · · Score: 1
    In the linuxjournal article (yeah yeah, who could be bothered with actually reading these things?) this was actually discussed.

    The justifiably paranoid administrator can open the ssh/22 port on his system by initiating TCP connections to ports 31,32,30. At the end of the ssh session, the port would be closed by using the second sequence shown above. If the host from which the administrator is connecting is not trusted (if, say, keystrokes may be snooped), the use of the third sequence would deny all further traffic from the IP, preventing anyone from duplicating the session. This assumes the port sequence and system login credentials are not captured by a third party and used before the legitimate session ends.

    A simple extension to this is that instead of blocking the current IP, you could simply use a smarter script client and server side. The first time you successfully log in, it goes to the next thing. You don't even need to disable the port - it only keeps it alive for your current session. The client and server both know what the next (different) sequence then should be...if it was 32,30,31 before, now its 30,32,31. That sort of thing. Obviously, this qould work better with more than 3 ports, but as the article (that darn thing) points out, even in the sub-1024 range, about a quarter are usable for such things.

    Also note, for those that didn't F@#$ing read the article, that the sequence merely opens a port - the reference was SSH, as an example. So if you get the sequence, it allows you to attempt an SSH login. Its not just security through obscurity at that point. Its additional security through obscruity :P

    I'd love to see this paired with a dynamic set of sequences. Or...nah, I won't mention the idea I just had. I might want to patent it [snicker]

  65. Heee heeee by Anonymous Coward · · Score: 0

    Did you say fart knocker....

  66. But in the end, don't open port 22 by Imperator · · Score: 1

    I have sshd running on my machine, but on a high port number. Even if someone found it was open, they wouldn't know it was ssh without some further investigation. So this scheme is fine, but at the end it shouldn't open ssh on 22, but on some other pre-arranged port.

    --

    Gates' Law: Every 18 months, the speed of software halves.
    1. Re:But in the end, don't open port 22 by DeepDarkSky · · Score: 1

      It doesn't matter. If you only open the port to someone who presents a correct knocking sequence, then for all practical purposes, the system can be configured so that it's completely invisible (like the IP address doesn't even exist). This way, you could even implement a web server that doesn't simply response to port 80, until the proper knocking sequence has been presented.

    2. Re:But in the end, don't open port 22 by dAzED1 · · Score: 1
      gosh, that would be a brillant solution...

      ...if it weren't for the fact that any attempt to connect to whatever port it is will respond in a very ssh-server way. IE, it will be completely recognizable. The port is hit, the server responds back "yeah, what do you want?" and the client says "oh, I was just looking for you...would you like to buy some viagra?"

      Hopefully you read past the humour.

  67. Security through obscurity by Dominic_Mazzoni · · Score: 5, Insightful

    As everyone else is saying, this is just security by obscurity. That doesn't mean that you shouldn't use it, because it probably would help a lot in keeping out script kiddies and casual hackers. But the flip side, as always, is that you're giving yourself and your users a false sense of security when you pretend that measures like this will actually prevent motivated hackers from getting past it.

    The most obvious way to break into a system like this is to compromise a nearby machine first and install a packet sniffer. Once you can see the traffic to the host running this port knocking system, it would be easy to discover the pattern. In fact, port knocking is less secure than a lot of other nonstandard authentication mechanisms because you could figure out the secret simply by looking at packet headers (since they contain the port numbers).

    The other problem I see with this system is that it requires users to either memorize the secret knock, or use a program that automatically knocks for them. Since most people have a hard time even remembering all of their usernames and passwords, you'd see a lot of people writing down the knock, sending it via email, or writing scripts to knock for them. Dozens of opportunities to a hacker, especially one skilled in social engineering, to figure out the knock.

    1. Re:Security through obscurity by radish · · Score: 2, Insightful

      Sure, it's breakable. But once they have broken the knock, they still have to get past the regular, strong, security. It's a layer of obscurity, but it is on top of the existing stuff - whatever happens you will remain at least as secure as you were before.

      The vast majority of s'kiddies will just scan 22, see there's nothing there, and move on to the next host. There will _always_ be far easier targets for them to attack. Why waste their time trying to guess my knock?

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    2. Re:Security through obscurity by HeelToe · · Score: 2, Interesting

      But if your knock sequence was generated similar to a one time password, the knock sequence would be unique each time and not replayable.

    3. Re:Security through obscurity by prisonercx · · Score: 2, Insightful
      All of your objections have been dealt with in one way or another.

      1) ...compromise a nearby machine first and install a packet sniffer...
      Use a one-time pad system, as mentioned above.

      2) ...you'd see a lot of people writing down the knock...
      If you'd read the Linux Journal article, they address that by saying the program that executes the knock needs to be very secure. Say, like the USB key they mention.

      This isn't a great system for continued, heavy use as this guy pointed out, but it could be used for emergency purposes. For example, if you had to remotely administer a server. You have an emergency USB key that you plug in your local machine, knock, then gain remote access with the opened port (using whatever authentication you would have if the port was simply open).

      I think, at very least, the concept needs to be thoroughly debated and vetted. (Maybe that's what we're doing here, or maybe we're just wanking ;)

      PrisonerCX

    4. Re:Security through obscurity by Swanktastic · · Score: 1

      The vast majority of s'kiddies will just scan 22, see there's nothing there, and move on to the next host. There will _always_ be far easier targets for them to attack. Why waste their time trying to guess my knock?

      Two admins are walking in the woods when one of them spots a bear. The first admin desperately throws his backpack down, and puts on a pair of running shoes. The second one says "You're crazy, you'll never be able to outrun that bear!"

      "I don't have to," the first admin says, "I only have to outrun you!"

      Hiyo!

    5. Re:Security through obscurity by Shurhaian · · Score: 1

      In theory, a system could be tolerant of (or even expect) a number of false knocks to unrelated ports.

      Let's say the key sequence is 30, 32, 31. What if it actually expects 30, 1-3 random knocks(but not 32), 32, 0-1 random knocks(but not 31), 31?

      No single security option is likely to be enough, of course, but if the knock string is seemingly of varying length, it would certainly provide another layer.

      --
      NB: YMMV. IANAL. Take the above with a grain of salt.
    6. Re:Security through obscurity by WaKall · · Score: 1

      Sniffing from a compromised machine on a switched network segment just won't work. Most cable modems filter traffic by IP address, and DSL modems only spit down what they are directly responsible for. In short, you'd have to

      a) compromise an end-host on the same (or closer-to-source) non-switched network segment, or
      b) compromise a switch or router in the network

      Not saying it isn't possible, but it does raise the bar considerably.

    7. Re:Security through obscurity by teeker · · Score: 2, Insightful

      But the flip side, as always, is that you're giving yourself and your users a false sense of security when you pretend that measures like this will actually prevent motivated hackers from getting past it.

      If any admin ever feels secure, they have other problems. Any admin worth their salt is always paranoid.

      The whole point of it is to make things a little more obfustacated. If a cracker already knows you're running a service they are interested in exploiting, you are already at risk anyhow. If somebody with some real skills was taking a shot at compromising your network, then this will not stop them, but it is a little smarter than inviting every script kiddie with a port scanner and their dog to smash at your SSH port.

      It is a reasonable addition to a balanced security breakfast.

      --
      teeker
    8. Re:Security through obscurity by Anonymous Coward · · Score: 0

      Obscurity at it's best is that which occurs only once. I like this idea of port knocking, but as it's strength is obscurity, I would implement it in my own way, (hopefully) unlike any other.

      The problem of sniffing is a real issue if you want to knock in from a untrusted system or network. Even without sniffing, someone could also wait for a valid knock and attack while the port is open.

    9. Re:Security through obscurity by Anonymous Coward · · Score: 0

      Who said the knocking had to be a manual process? Actually, it must not be!

      As others has calculated here, it would be easy to make the sequence impossible to brute force, and it would not be hard to implement a system where the wisiting process gets the sequence to use next time some time in the session.

      And it would of course not be very hard to make an encrypted key that would translate to a first knock knock when someone legit needs access for the first time.

      Social engineering of course can never be totaly ruled out.

    10. Re:Security through obscurity by Anonymous Coward · · Score: 0

      Sniffing from a compromised machine on a switched network segment just won't work.

      You'd be surprised.

    11. Re:Security through obscurity by Lost+Race · · Score: 1
      The most obvious way to break into a system like this is to compromise a nearby machine first and install a packet sniffer.
      That reminds me of a Steve Martin joke: How to get A MILLION DOLLARS and PAY NO TAXES. First, get a million dollars. Then, don't pay any taxes.

      Golly, port knocking doesn't protect against an attacker standing behind me and watching what I type either. And it doesn't protect against someone opening up the computer with a screwdriver and taking out the disk drives. It doesn't even protect against someone capturing me and forcing me to confess the secret sequence.

      On the other hand, it does offer an extra layer of protection against 99.999% of Internet-based attacks, so maybe it has some benefit after all.

  68. rotate the knock by CSIP · · Score: 2, Interesting

    one could also change the sequence of ports that are used to be based on some key/progression/timestamp? so the knock is constantly changing... so even if someone sniffs the knock, it wont help.

    --
    "Nyquil - The stuffy, sneezy, why-the-hell-is-the-room-spinning medicine."
  69. not good either. by junkymailbox · · Score: 1

    My gripe is that we're supposed to have 65k+ ports .. but i am only allowed to use a couple. 53/80/443. so i have to tunnel everything. why dont we just tunnel everything on 1 port and have the server scan for public keys and open apps based on that from just 1 port. would pretty much accomplish the same thing.

    1. Re:not good either. by Ruzty · · Score: 1

      Because the system can only support a fixed number of concurrent socket connections to any one specific port. Sockets are files and there is a max file descriptors value that the kernel can handle. If everything went to the same port you would hit such a limit fairly quickly.

      This does not even take into account the ability to selectively disconect clients attached to a specific application (port) without detrimentally affecting all other open sockets.

      Neat idea but not very practical on any type of a large scale.

      -Rusty

      --
      The Master (Angelo Rossitto) in Mad Max Beyond Thunderdome, "Not shit, energy!"
  70. Not the point by s20451 · · Score: 4, Insightful

    come on kids. Have we not learned our lessons? Even as a one time pad, this is lame

    You are very much missing the point. Yes, security through obscurity is terrible when it is the only security method you use. However, it can be used to augment a better security system. Even if somebody figured out the secret knock, they would still have to get past your sshd. And if an sshd exploit was found, your secret knock might give you enough time to patch the system before it could be exploited. More security is always a good thing.

    Disbelief in security through obscurity doesn't mean you have to paint a bull's eye on your head and dare people to attack you.

    --
    Toronto-area transit rider? Rate your ride.
  71. Easier to DOS by BlueFall · · Score: 1

    This introduces several additional points of failure in every connection. For example, suppose you had a 5 port knock before connecting to your final real port. If any one of these fails to reach the end point, you're denied service. Thus, if I have the ability to stop some of your packets from coming through, I only have to stop one packet per connection attempt -- a new low bandwidth DOS.

    Even if there's nobody malicious in between you and the server, you need to make sure that 5 packets get through in sequence. That's not terribly easy.

  72. Finally!! by xorbe · · Score: 1

    I thought of this years ago while working at DEC!

  73. Well... by dfj225 · · Score: 1

    I've been knock, knock, knocking on port 80, but no one is answering!

    --
    SIGFAULT
  74. hmm... by Kitsune · · Score: 5, Interesting

    Improperly done, the knock sentry could become a security/QOS issue in itself.

    This definitely is security through obscurity and perhaps would work in the same way as a car alarm. There's lots more systems out there that are easier to break into, and if someone does try, just hope that they get fed up and moves on to the next one.

    If you've gone this far, why not do something like they do on radio. Open up severable ports at the same time and multiplex your signal over several of them while sending noise over the ununsed ports randomly switching between ports using a syncronized random selector.

    1. Re:hmm... by LordK2002 · · Score: 1
      Open up severable ports at the same time and multiplex your signal over several of them while sending noise over the ununsed ports randomly switching between ports using a syncronized random selector.
      Synchronised? On the Internet?

      K

  75. Re:Ninnle Linux has this by Anonymous Coward · · Score: 0

    whoever modded this "informative" obviously did not even bother trying to search for "ninnle linux"

  76. go a step further by Casca · · Score: 5, Interesting

    Implement it in combination with a onetime type password arrangement. You look up what the series of knocks is supposed to be on your secureID card (or whatever), then knock in the combination it tells you to use. Tie it in with the server you want to get into, and the port you actually connect to for ssh can be different every time.

    IE, secureID says sequence is "1234 1441 1114 5123", you knock on the first three, and 5123 is the ssh port activated for you only.

    --
    Casca
    1. Re:go a step further by Anonymous Coward · · Score: 0

      1234 1441 1114 5123

      All someone has to do is to simultaneously make connections to every possible port (there are maybe only 65535 of them) before the legitimate user connects to 5123.

    2. Re:go a step further by Lost+Race · · Score: 1

      What about packet loss / mixup / duplication? Since you get no feedback from the knocks, there's no way to tell if some of them got lost or otherwise screwed up, hence your OTPs can get out of sync. How do you detect this, and how do you resync?

  77. Watch out for easy Denial Of Service by Kosmatos · · Score: 1

    To send the sequence of port knocks there will have to be a slight delay between each one in order to make sure the packets arive in the right sequence.

    Which means that there is ample enough time for someone to "ruin" this sequence of knocks... thus preventing an authorized communication from taking place.

    No?

    --
    I'm your huckleberry
    1. Re:Watch out for easy Denial Of Service by Ann+Elk · · Score: 1
      The DoS you describe would probably be possible only when trying to connect through a proxy. From the Linux Journal article:
      ...a method is required to extract the sequences of ports from the log file and translate their payload into usable information. In this step it is important to be able to (a) detect when a port sequence begins and ends, (b) correctly detect a port sequence in the presence of spurious connection attempts that are not part of the sequence and (c) keep track of multiple port sequences arriving at the same time from different remote IPs.
      I think using failed connection attempts as a covert channel is Pretty Damn Cool (tm).
  78. Even Better by Anonymous Coward · · Score: 0

    I've got a great new idea for secure data transmission. Rather than sending encrypted data inside a frame, you just access certain ports in a certain sequence. Set aside 16 ports, and you can send four bits of data by noticing the order in which people try to access the ports, without opening a single port at all. Repeat at will for arbitrary length messages.

    Now, just layer on some uuencoding in case it has to be compatible with some 300 bps 7-bit serial link somewhere -- make that base-64 in case of escape characters -- and we've got a great new transports for warez and pr0n on thos P2P apps.

    Nobody will ever figure this one out.

    1. Re:Even Better by HermesHuang · · Score: 1

      Great idea except for one thing: in order to make sure the sequence gets there correctly you probably have to space out the port accesses. Which means your datarate will be horrible. And if you're on a high-bandwidth line with the computer you're sending data to, then measures like this probably are redundant anyways.

  79. another thing about sniffing... by dAzED1 · · Score: 1
    same quote as I used last time, different point:

    This assumes the port sequence and system login credentials are not captured by a third party and used before the legitimate session ends.

    Simple solution - limit the number of open sessions to the port then. Duh. Allow only 1 login. Have the script watching to see when the session ends, then close the port up directly after. That, combined with the dynamic sequences, and viola - you could almost forget about needing a password! I kid ;)

    Now that we'll have scripts out there that randomly knock on various sequences, trying to get luck. Geeze....great.

  80. Security != Inconvenience by RAMMS+EIN · · Score: 1

    This seems very inconvenient and only marginally secure. It's a major hassle to have to go to this sequence every time you want to connect. Adapting software to do it for you could help, but you can't do that for everyone.

    And what if you wanted to offer your service to others, or even the general public? Do you require them all to run specially adapted software? Or do you tell them the sequence, with the risk that they forget and have to ask for it again, or leave it on a note that some malicious person could find, or even just tell it to someone else?

    If you wanted to keep your knock all to yourself, rest assured that someone could sniff it just fine.

    I suggest you keep your SSH port open and make sure your sshd is patched. You can then use all your other services through SSH tunnels if you like.

    --
    Please correct me if I got my facts wrong.
    1. Re:Security != Inconvenience by Tumbleweed · · Score: 1

      The same argument can be made for passwords, but I don't see anyone complaining about that. Noone's advocating that this be implemented for every site, or as a substitute for other security measures. This is a neat idea that someone's come up with as an OPTIONAL and ADDITIONAL layer of security. Stop looking for something to complain about.

    2. Re:Security != Inconvenience by RAMMS+EIN · · Score: 1

      ``The same argument can be made for passwords''

      Not quite.

      1. Passwords are kind of an accepted standard, and allow services to be found the same way whether or not they are used. For example: Some IRC servers require passwords for access, others don't. The procedure for connecting is the same for both (look up IP address in DNS, connect).

      2. Passwords usually go together with usernames. This means that different users can be distinguished, and can have different passwords. Implementing something similar using port knocking is tedious and _reduces_ security, because it increases the chances of randomly guessing a valid sequence.

      Finally, you are right that passwords aren't the best security either. Without further measures, they can be sniffed, read from notes, and forgotten. Plus using a password (or port knocking, for that matter) doesn't keep your data private. Using assymetric key cryptography solves many of these issues. I wonder why it isn't used more.

      --
      Please correct me if I got my facts wrong.
    3. Re:Security != Inconvenience by Tumbleweed · · Score: 1

      Let's try this again. Here's the part you missed:

      > This is a neat idea that someone's come up with as an OPTIONAL and ADDITIONAL layer of security.

      Please to note the word 'additional.'

      Thank you for your time.

  81. Take example of garage remote controls by smart_ass · · Score: 1

    Have a rotating sequence of acceptable knocks.
    This way any sniffing doesn't know that the same knock won't work next time.
    Further screw them up by having repeats in your rotation so a dedicated sniffer sees a repeat and think the rotation is complete.
    Knock1, Knock2, Knock3, Knock1, Knock4 ... Knock(n)
    The client knows all the knock sequences and tries them in order with some reasonable time separation.
    Sniffer doesn't know which one opened the ports (random time to open ports from successful knock ex 1-20 seconds) and if he repeats, knock may or may not work.
    As others have suggested will work fine as part of multi-layered system.

    --
    Ouch ... did I just say that.
  82. Re:FP? by Anonymous Coward · · Score: 0

    Here's my FagPG key.

    VSBBUkUgVEVIIEZBSUxVUkUKWU9VIEFSRSBURUggRk FJTFVSRQoKWVlPVSBBUkUgVEVIIEZBSUxV
    UkUKCllPVSBBUk UgVEVIIEZBSUxVUkUKT1UgQVJFIFRFSCBGQUlMVVJFCllPVSBB UkUgVEVIIEZB
    SUxVUkVZT1UgQVJFIFRFSFlPVSBBUkUgVEVI IEZBSUxVUkUKCllPVSBBUkUgVEVIIEZBSUxVUkUK
    IEZBSUxV UkUKCllPVSBBUkUgVEVIIEZBSUxVUkUKCgpZT1UgQVJFIFRFSC BGQUlMVVJFCiMgUGxl
    YXNlIHRyeSB0byBrZWVwIHBvc3RzIG 9uIHRvcGljLgojIFRyeSB0byByZXBseSB0byBvdGhlciBw
    ZW 9wbGUncyBjb21tZW50cyBpbnN0ZWFkIG9mIHN0YXJ0aW5nIG5l dyB0aHJlYWRzLgojIFJlYWQg
    b3RoZXIgcGVvcGxlJ3MgbWVz c2FnZXMgYmVmb3JlIHBvc3RpbmcgeW91ciBvd24gdG8gYXZvaW Qg
    c2ltcGx5IGR1cGxpY2F0aW5nIHdoYXQgaGFzIGFscmVhZH kgYmVlbiBzYWlkLgojIFVzZSBhIGNs
    ZWFyIHN1YmplY3QgdG hhdCBkZXNjcmliZXMgd2hhdCB5b3VyIG1lc3NhZ2UgaXMgYWJv dXQuCiMg
    T2ZmdG9waWMsIEluZmxhbW1hdG9yeSwgSW5hcHBy b3ByaWF0ZSwgSWxsZWdhbCwgb3IgT2ZmZW5z
    aXZlIGNvbW1l bnRzIG1pZ2h0IGJlIG1vZGVyYXRlZC4gKFlvdSBjYW4gcmVhZC BldiMgUGxlYXNl
    IHRyeSB0byBrZWVwIHBvc3RzIG9uIHRvcG ljLgojIFRyeSB0byByZXBseSB0byBvdGhlciBwZW9w
    bGUncy Bjb21tZW50cyBpbnN0ZWFkIG9mIHN0YXJ0aW5nIG5ldyB0aHJl YWRzLgojIFJlYWQgb3Ro
    ZXIgcGVvcGxlJ3MgbWVzc2FnZXMg YmVmb3JlIHBvc3RpbmcgeW91ciBvd24gdG8gYXZvaWQgc2lt
    cGx5IGR1cGxpY2F0aW5nIHdoYXQgaGFzIGFscmVhZHkgYmVlbi BzYWlkLgojIFVzZSBhIGNsZWFy
    IHN1YmplY3QgdGhhdCBkZX NjcmliZXMgd2hhdCB5b3VyIG1lc3NhZ2UgaXMgYWJvdXQuCiMg T2Zm
    dG9waWMsIEluZmxhbW1hdG9yeSwgSW5hcHByb3ByaWF0 ZSwgSWxsZWdhbCwgb3IgT2ZmZW5zaXZl
    IGNvbW1lbnRzIG1p Z2h0IGJlIG1vZGVyYXRlZC4gKFlvdSBjYW4gcmVhZCBldmVyeX RoaW5nLCBl
    dmVuIG1vZGVyYXRlZCBwb3N0cywgYnkgYWRqdX N0aW5nIHlvdSMgUGxlYXNlIHRyeSB0byBrZWVw
    IHBvc3RzIG 9uIHRvcGljLgojIFRyeSB0byByZXBseSB0byBvdGhlciBwZW9w bGUncyBjb21tZW50
    cyBpbnN0ZWFkIG9mIHN0YXJ0aW5nIG5l dyB0aHJlYWRzLgojIFJlYWQgb3RoZXIgcGVvcGxlJ3Mg
    bWVz c2FnZXMgYmVmb3JlIHBvc3RpbmcgeW91ciBvd24gdG8gYXZvaW Qgc2ltcGx5IGR1cGxpY2F0
    aW5nIHdoYXQgaGFzIGFscmVhZH kgYmVlbiBzYWlkLgojIFVzZSBhIGNsZWFyIHN1YmplY3QgdGhh
    dCBkZXNjcmliZXMgd2hhdCB5b3VyIG1lc3NhZ2UgaXMgYWJv dXQuCiMgT2ZmdG9waWMsIEluZmxh
    bW1hdG9yeSwgSW5hcHBy b3ByaWF0ZSwgSWxsZWdhbCwgb3IgT2ZmZW5zaXZlIGNvbW1lbn RzIG1p
    Z2h0IGJlIG1vZGVyYXRlZC4gKFlvdSBjYW4gcmVhZC BldmVyeXRoaSMgUGxlYXNlIHRyeSB0byBr
    ZWVwIHBvc3RzIG 9uIHRvcGljLgojIFRyeSB0byByZXBseSB0byBvdGhlciBwZW9w bGUncyBjb21t
    ZW50cyBpbnN0ZWFkIG9mIHN0YXJ0aW5nIG5l dyB0aHJlYWRzLgojIFJlYWQgb3RoZXIgcGVvcGxl
    J3MgbWVz c2FnZXMgYmVmb3JlIHBvc3RpbmcgeW91ciBvd24gdG8gYXZvaW Qgc2ltcGx5IGR1cGxp
    Y2F0aW5nIHdoYXQgaGFzIGFscmVhZH kgYmVlbiBzYWlkLgojIFVzZSBhIGNsZWFyIHN1YmplY3Qg
    dG hhdCBkZXNjcmliZXMgd2hhdCB5b3VyIG1lc3NhZ2UgaXMgYWJv dXQuCiMgT2ZmdG9waWMsIElu
    ZmxhbW1hdG9yeSwgSW5hcHBy b3ByaWF0ZSwgSWxsZWdhbCwgb3IgT2ZmZW5zaXZlIGNvbW1lbn Rz
    IG1pZ2h0IGJlIG1vZGVyYXRlZC4gKFlvdSBjYW4gcmVhZC BldmVyeXRoaW5nLCBldmVuIG1vZGVy
    YXRlZCBwb3N0cywgYn kgYWRqdXN0aW5nIHlvdXIgdGhyZXNob2xkIG9uIHRoZSBVc2Vy IFByZWZl
    cmVuY2VzIFBhZ2UpCiMgSWYgeW91IHdhbnQgcmVw bGllcyB0byB5b3VyIGNvbW1lbnRzIHNlbnQg
    dG8geW91LCBj b25zaWRlciBsb2dnaW5nIGluIG9yIGNyZWF0aW5nIGFuIGFjY2 91bnQubmcsIGUj
    IFBsZWFzZSB0cnkgdG8ga2VlcCBwb3N0cy BvbiB0b3BpYy4KIyBUcnkgdG8gcmVwbHkgdG8gb3Ro

  83. Dash-Dot-Dash by 4of12 · · Score: 1

    An idea like this occurred to me a couple years ago when I was listening to a computer security class.

    Namely, the knocking attempts can become a communications channel if they're timed right. cf Also Red October ("One ping only.").

    Low-speed, to be sure, and kind of "1-way" dominant, but more surreptitious, if there's a need for that.

    And more difficult to detect in the log files, if knock timing is done for port 80.

    --
    "Provided by the management for your protection."
  84. Obscurity IS Security by CedgeS · · Score: 5, Insightful

    There is only one form of security for a publicly accessible interface: obscurity. What is a password? It is a piece of information that you know that someone else doesn't - it is obscurity. The key to your house is something you have that someone else doesn't. If they knew the obscure details of your key they could make one. What is a private key, a key for SSH, a kerberos function? They are all information you know which (hopefully) a potential attacker doesn't. This is obscurity.

    If you have a security system for a public interface (the front door to your house, a computer port, etc...) that does not rely on obscurity you have a system better than any theoretical system anyone has ever thought of. (Biometrics don't count - they are just another piece of information that you have that someone else probably doesn't. That's obscurity.)

    1. Re:Obscurity IS Security by Dinny · · Score: 1, Insightful

      Oh the Humanity! I have no mod points!

      To further the point, the best security is complete obscurity. If no one knows you have a server no can hack it. Or, if no one knows that you stashed your treasure in the woods no one can steal it. Unfortunatly complete obscurity is impossible for most things. Having an IP address removes the possibiltity for your server to have complete obscurity.

      Which brings up another point. The more obscure some thing is the less effect it can have on the world at large. Interesting.

    2. Re:Obscurity IS Security by cheezit · · Score: 4, Insightful

      I think you are overreaching here. As far as I'm concerned, the phrase "security through obscurity" means obscurity of system design. If you don't tell anyone about your unprotected resource, that's security through obscurity. All I need to do is discover your resource.

      Most security is based on secrets of one kind or another---that doesn't make it "obscurity."

      --
      Premature optimization is the root of all evil
    3. Re:Obscurity IS Security by TrollBridge · · Score: 2, Interesting
      I don't think he's reaching at all, and I think the great-grandparent post illustrates his point very well.

      In the context of the theoretical shifting door in the wall, part of what makes it secure is that outsiders don't know how the door works; they only know that it moves away when an unauthorized person tries to open it.

      However, people who oppose "security through obscurity", especially when in conjunction with blind open source advocacy, would argue that giving would-be intruders the blueprints of the door system would somehow deter them and make the system more secure.

      --
      There's a Mercedes gap too. I want one and can't afford one, but it's not government's job to do anything about it.
    4. Re:Obscurity IS Security by Xenographic · · Score: 4, Insightful

      We usually call such a thing a secret, not "obscurity" ... at least, when talking about a password.

      So this just makes part of the protocol secret, and one of our assumptions about security protocols is that the protocols are known.

      Yes, it's an interesting and reasonably clever little hack (it is not, however, new), it does tend to hide some information (e.g. that the ports are even open) but if you're going to make the port look closed, anyhow, why not just listen on that port for something that would cause the service to "wake up"? I guess they thought it seemed a bit more clever the other way, who knows?

    5. Re:Obscurity IS Security by Daniel+Boisvert · · Score: 2, Interesting

      Most security is based on secrets of one kind or another---that doesn't make it "obscurity."

      I think that's the point the grandparent is making. The key to this is that folks around here aren't real clear on the difference between "obscurity" and "secrets". One is touted as being worthless by itself, the other is accepted as the cornerstone of electronic security in general (I posit that the cornerstone of physical security is violence).

      the phrase "security through obscurity" means obscurity of system design.

      This is an excellent point, and deserves to be modded up because *way* too many people both here and elsewhere miss this fundamental concept. In my opinion any method that makes accessible hosts look the same as unaccessible hosts to a port scan is a great idea, no matter what folks here choose to call it.

      Dan

    6. Re:Obscurity IS Security by jonabbey · · Score: 1

      However, people who oppose "security through obscurity", especially when in conjunction with blind open source advocacy, would argue that giving would-be intruders the blueprints of the door system would somehow deter them and make the system more secure.

      So how do you distinguish 'blind' open source advocacy from any other sort?

      In cryptographics, the security of the system comes down to the mathematics and the implementation thereof in a practical system. If open source makes it more likely that someone with a brain will notice an insecure facet and be motivated to fix it for their own benefit, in addition to the common good, then open source has proven a virtue for the system's security.

      If open source just means that bad guys can see what you're doing (in a given installation of particular interest, for instance) and you're not getting the benefit of peer review and shared technical progress then you should probably ask yourself why your project hasn't gathered a productive community around it.

      The community that grows up around successful open source projects is more important than the quality of the code, in many respects, after all.

    7. Re:Obscurity IS Security by Anonymous Coward · · Score: 0

      Some places have a bouncer, or security guard. Therefore they have better security than any other system ever thought of? I wouldn't say so.

    8. Re:Obscurity IS Security by Anonymous Coward · · Score: 1, Interesting

      By that definition port knocking isn't security by obscurity either. The secret is the sequence of knocks and the server port number, the protocol is that connections to the server port will only be accepted after the knock sequence has arrived from the same ip address as the connection to the server port. The security of this protocol doesn't drop if the protocol is revealed. If you know about the port knocking protocol (you do now), can you tell if a server uses it without knowing the secret?

    9. Re:Obscurity IS Security by gblues · · Score: 1

      This is not the type of obscurity that is decried by the "security through obscurity" mantra.

      We say a system uses "security by obscurity" when the knowledge of how the authentication system works provides enough information to break in without having to know the secret of a particular user.

      The reason that encryption such as Blowfish is secure is that, even with the mathematical formula used to perform the encryption, you still have to perform a bazillion calculations to try to "brute force" the decryption, and there are (hopefully) no flaws in the math that make it possible to shorten the keyspace of the algorithm.

      Contrast this with NTLM authentication where if you know how it works (i.e. passwords are converted to all-uppercase and truncated to 12 characters), you can crack a password fairly quickly.

      But even the most advanced encryption is useless if you publish your decrypt key out on the internet for anyone to grab. :)

      Nathan

    10. Re:Obscurity IS Security by maomoondog · · Score: 1
      Why hasn't this thread been ripped up by security professionals yet?


      If you're going to call your obscure protocol security, you have to subject it to the same rigid cryptanalysis that you subject an encryption key to. How did you create your protocol, and who did you let know about it? Is it discoverable by replay, or man in the middle attacks? Etc.


      Other threads have discussed how the protocol fails these tests. Sniffing creates a huge problem unless you vary your key, in which case you're really using some other encryption protocol. As far as noone knowing about it... well, would you use a 40-bit encryption key if the first 20-bits were already posted to slashdot? Depends what you're doing and who you're trying to protect from.


      You're technically right about the English definition of obscurity, but there's a good reason to make the distinction from security. We discuss protocols and keys seperately because we understand that part of our authentication process will be easily observable from the outside (the protocol) and part of it is a secret we intend to keep anyway (the key).

    11. Re:Obscurity IS Security by YoJ · · Score: 1

      The parent post has somewhat of a valid point; the reason passwords work is that attackers don't know them. Port-knocking works because of the same principle, that attackers don't know which ports to knock on to get in. But if you take the analogy further, you realize the weakness of port-knocking: it sends the password in the clear! The security model of port-knocking is no different than telnet. The security you get from attackers not knowing you are using port-knocking is the same as the security you get from attackers not knowing you are running a telnet server (i.e. not much!)

    12. Re:Obscurity IS Security by Anonymous Coward · · Score: 0

      There is only one form of security for a publicly accessible interface: obscurity.

      "Security through obscurity" means that unproven, and possibly insecure methods are used to achieve security, and that the security of these methods relies on obscurity rather than proven security.

      As an example, most everyone is familar with ROT13. Nobody would argue that it is secure. If I design an authentiation system which sends passwords encrypted in ROT14, that's security through obscurity. My security relies on you not knowing about my sneaky variant of an insecure algorithm. As long as you don't know, then my system is "secure".

      Public key cryptography says "here's exactly how it works. We'll tell you how it works and even give you one of the keys, but you still can't crack it." There's no obscurity there.

      As far as port knocking is concerned, it is performing similar functionality to preventing the enumeration on users on a windows box. In this case, you're taking away attack vectors. Ok, you're not taking them away, you're adding an additional layer of security which must be passed before someone gains access to them. This is a good thing.

    13. Re:Obscurity IS Security by _Sprocket_ · · Score: 1


      There is only one form of security for a publicly accessible interface: obscurity. What is a password? It is a piece of information that you know that someone else doesn't - it is obscurity.


      A password is a secret. It is not obscurity.

      Sure - you can argue the semantics of it and do a rather good job at blurring the line between the two. However, in cryptographic and security circles, the two have very distinct connotations.

      Obscurity is more about hiding how a system functions. The usual issue with this approach is that keeping this much information hidden is difficult. It is also possible to begin figuring out details by carefully analyzing the function of the system. If a system relies on what can not be hidden (or remain hidden) to be secure, then it is depending on obscurity. And will likely fail.

      A secret is a particular piece of information that can be kept hidden and not (easily) discovered. Usually the information is relatively compact - which aids in keeping it hidden. And analysis of the system involved will not reveal the secret.

      This is not to say that a system that does not rely on obscurity will not have flaws.
    14. Re:Obscurity IS Security by cheezit · · Score: 2, Insightful

      I believe that a secure system is one where "giving would-be intruders the blueprints" does not weaken the protection. This should be provable on paper and could be backed up with practice if necessary.

      Foisting crappy code on the public and hoping that nobody breaks it is a very Darwinian head-in-the-sand approach. I can see your point that "we're against obscurity" provides a justification for that approach.

      It puts the cart before the horse and shouldn't raise anyone's confidence in the code. Proving that one could do so, however, should raise confidence in the code.

      --
      Premature optimization is the root of all evil
    15. Re:Obscurity IS Security by BigBadBri · · Score: 1
      why not just listen on that port for something that would cause the service to "wake up"?

      The way this implemented, no connection is made until the knock sequence is sent - all packets to the server port will be dropped.

      If you're listening on the port, there will be a SYN-ACK transaction before you are able to send the 'wake up' data, and it will be obvious to all that the port is alive, even if difficult to get into.

      Getting the port not to appear until authorised is the neat trick in this system - to make a port appear dead until a wake-up message is sent would require some heavy work rewriting TCP stacks, or maybe some clever tricks with TCP Wrappers.

      --
      oh brave new world, that has such people in it!
    16. Re:Obscurity IS Security by CedgeS · · Score: 1

      You're right. The phrase "security through obscurity" is usually asociated with obscurity of system design. It is a totally unacceptable security method, because the "obscurity" does not actually exist.

      As I posited, security is based on obscure, or secret, information which you have and others do not. Why doesn't "security through obscurity" work? Because the "obscurity" is not really very obscure. Anyone with a similar system would know how it works. Do you trust everyone who uses or accesses the same system you do? Aditionally, such as in the case of hiding services on non standard port numbers, there may be methods of finding out the "obscure" information. If so, it isn't very obscure, invisible, or secret anymore. If it can be guessed in a small amount of time, or can be deduced easily, it is not very secure at all. That is why we use larger pieces of obscure information for more secure systems, such as "stronger" passwords, or larger keys, or challenge response systems whos' communiques will not function in a different session - to make it harder to guess or deduce the obscured information.

    17. Re:Obscurity IS Security by mech_knight · · Score: 3, Insightful

      Actually, security from man-in-the-middle attacks is what cryptography is normally concerned with. Real security is achieved when transmitted information is still "unknowable" despite knowledge about the process of transmission.

      That's the whole point of public and private keys. Statistical impossibility of dechiphering the private key--not obscurity--is its goal.

      --
      "Size matters not. Look at me. Judge me by my size, do you?" --Yoda {whips out green light saber}
    18. Re:Obscurity IS Security by klem · · Score: 1

      I think a "wake-up message" system is not that hard to do.

      One can filter a port with iptables/ipfw/whatever (with a rule that sends back RST, so the port appears closed), and then, put a little daemon that uses libpcap to passively sniff the network (like tcpdump).

      The daemon can wait for the magic packet, and then add a firewall rule to allow the authorized client to connect to the port...The magic packet can be any IP packet, doesn't has to be a TCP packet to the same port, doesn't even has to be a TCP packet..

  85. How is this different from a password? by DaMeatGrinder · · Score: 1

    How is this different from a password transmitted plain-text over the wire? The author is trying to use the port number as an information channel. As an information channel, all the same security problems exist as for regular channels. In this case, the "port number sequence" is unencrypted. So we're back to plain-text passwords...

  86. been there done that by adot · · Score: 0

    message144 (also known as xor) has been doing that since 99? yeah its not new.

    --
    -green is the color of the rainbow
  87. MOD PARENT UP!! by Anonymous Coward · · Score: 0

    Exactly the argument to counter the overplayed "security through obscurity" card. Absolutely correct! Mod up!

  88. Senseless by Negative+Response · · Score: 1

    I don't get this idea. How is this knocking fundamentally different from, say, a password? It's a sequence of signals you make which only you and the server are supposed to know, thus to verify your identity. But compared with password or RSA/DSA keys, it's slower, consuming more resources, and cannot be solely relied on -- too easy to sniff. If you want your security to be tighter, you might as well make your passwd harder to guess.

  89. More apt than you think by glpierce · · Score: 1

    This isn't about having multiple doors - it's about turning doors into doorbells.

    --
    G
  90. Firewall, meet hackhammer... by blcamp · · Score: 1


    I can see it now:

    1024-1025-1026-1027-1028... nope.
    1024-1025-1026-1027-1029... nope.
    1024-1025-1026-1027-1030... nope.
    1024-1025-1026-1027-1031... nope.

    0.003 seconds later:

    1024-1025-1157-2009-2087... nope.
    1024-1025-1157-2009-2088... nope.
    1024-1025-1157-2009-2089... nope.
    1024-1025-1157-2009-2090... nope.

    0.002 seconds later:

    1024-1025-1500-1111-1836... nope.
    1024-1025-1500-1111-1837... nope.
    1024-1025-1500-1111-1838... nope.
    1024-1025-1500-1111-1839... nope.

    Multiplied by the hundreds, or thousands.

    Nice.

    Let's give 5CR1P7 K1661E5 a new, simpler idea on how to bust into firewalls... ...or DoS trying.

    --
    The problem with socialism is that they always run out of other people's money. - Margaret Thatcher
    1. Re:Firewall, meet hackhammer... by calebb · · Score: 1

      Adjust your script so that there must be a 250 millisecond delay between knocks. (and, of course, check the originating IP address so that if someone else attempts to knock, it doesn't interrupt your knock sequence!)

      Caleb

  91. implications for fighting spam? by VegetariMan · · Score: 1

    What a novel idea. I wonder if there is a way to extend this to fighting spam. Perhaps not by using the actual "knocking" mechanism but by pairing a sent message with some information contained in another protocol.

    Imagine: I send an email to a buddy, through my ISP's mail server. My email client also contacts my buddy's mail server directly, "knocks" on it and informs it to expect my message. If an unexpected message shows up it's flagged as spam.

    I'm not sure how feasible this is-- I'm just trying to think outside the box on spam fighting. :)

    --
    --Nick
  92. And Yer Typical Knock Would Likely Be.. by Anonymous Coward · · Score: 0

    ..some variation on 'shave and a haircut, two bits'.

  93. quick let's patent! by xutopia · · Score: 1

    before someone else does!

  94. Well by mindstrm · · Score: 1

    I've used this in the past.. but it's only real value is that nobody knows you are doing it. Someone with a sniffer and a brain can figure it out.

    In the end, it's only a gimmick. If you have to knock a few ports.. that can be sniffed out, just like a password. Though it might seem at first like it's more secure, it's not.. it just adds obscurity.

    Now.. obscurity of this nature does have some value... it's obscurity.. and not likely to be detected by some script kiddie...

    but don't kid yourself into thinking this is revolutionary, or in any technical way more secure. It's not.

  95. Slashdotted by BlueTooth · · Score: 3, Funny

    Does anyone know the secret knock for www.portknocking.org:80 ?

    Thanks.

    --
    SPAM
    1. Re:Slashdotted by Anonymous Coward · · Score: 0

      I know this is lame but it has to be said

      Shave and a hair cut...

      TWO BITS!!!

  96. Knock Knock Honey Pot by ifreakshow · · Score: 5, Interesting

    One interesting way to use this would be to forward incorrect knocks to a honeypot instead of the legitamite service. Then the attacker could never determine if he had indeed knocked successfully and would waste time running around in a fake system giving you valuable data about there intrusion methods and freeing up the actual service for legit users.

  97. Knockin on someone's port by Anonymous Coward · · Score: 0

    Ma take this computer off of me
    I can't use it anymore
    Its screen's blue, too blue for me
    And I feel like knocking on someone's port

    Knock, knock, knocking on someone's port

    Ma take these scripts from me
    I just can't run them anymore
    There's a crowd of lawyers a-followin' me
    And I feel like knocking on someone's port

    Knock, knock, knocking on someone's port

  98. Send Knock knock - tcp 80 by indros · · Score: 1

    Slashdot's here to take down your system.

  99. Shared secret knocking by GoRK · · Score: 1

    To prevent sniffer attacks against port knocking, one could very easily implement a shared key based system where the knock sequence and timing were defined by an algorighm that generated the sequence based on a shared key and current time. It's still just another password and layer of obscurity; however, it's more cryptographically secure than a fixed knock that can be sniffed out.

    I can't think of a way to implement a public key based knocking system without the server needing a copy of each possible user's public keys; and that would sort of defeat the intention of such a system to begin with.

    Perhaps I will hack something into that reference implementation. The idea sounds pretty fun to implement, especially for folks who have completely shitty ISP's who get irate about listening services..

  100. Christ people! by Stonent1 · · Score: 4, Informative

    How many people are going to say sniff and repeat the sequence. You still have to get through the service after it opens. The whole point is that they don't know what is going on in the first place. And rotating keys are a good idea anyway. I like this idea for running some kind of server behind your ISP that normally doesn't allow such things. When I had excite@home I would regularly get firewall logs that said "authorizedscan.home.com" portscanning me.

    1. Re:Christ people! by Sir+Spank-o-tron · · Score: 1


      Me too.
      So I set my firewall to REJECT scans from them, so they would not notice that I was running a webserver.
      To them, port 80 was closed.

      --
      -- Spankmeister General
  101. So what's the secret knock for their webserver? by pegr · · Score: 1

    And someone should tell Taco how to spell "implement" (To miss it once is a typo. To miss it twice is a "d'oh!";)

    1. Re:So what's the secret knock for their webserver? by pegr · · Score: 1

      Aw, Taco! If you're going to correct your article after its posted, I want to correct my posts! ;)

  102. Port Knocking from Slashdot by Helevius · · Score: 1
    Apparently a visit from Slashdot is "secret code" for "kill httpd." Here's the Google cache of www.portknocking.org.

    Helevius

  103. HURRAAYYY, by Anonymous Coward · · Score: 0

    finaly some stupid implementing this stupid idea,
    until now there were only stupids suggesting it all the time.

    The only place it not totally stupid, is if noone
    else uses it and noone else know that you use it.
    (Or may think about it).

    Otherwise it is like opening the tellnet port and only allowing connects if you give the correct passwords. (With the addional feature that writing telnet-daemons is streight-forward, so that you are not so likely to implement buffer overruns...)

  104. Mod parent up! by Anonymous Coward · · Score: 0

    I was about to post the exact same thing. You people can be such insufferable whiners sometimes...

  105. port 80 by Jos+Louis · · Score: 1

    Did anyone get to the site before it got slashdotted? I'm guessing 20,000 knocks at port 80 in under 5 seconds isn't the entry.

  106. rotate the knocks... by grimace1969 · · Score: 1

    Don't automatic garage doors rotate the frequency they use to open the doors, to prevent simple scanning (which would be analogous to sniffing in this case)? I could see where this idea could be used in combination with a lot of other ideas (Port Sentry) to make it a far less trivial task to find an open port on a machine. The reason script kiddies are successful and abundant is because its cheap and easy, this might not keep someone determined out, but it actually makes it a lot more work for the lazy intruder.

    -G

    --
    "Immolation is the sincerest form of flattery."
    1. Re:rotate the knocks... by SnapperHead · · Score: 1

      You could always add an algorithm to it, which could be as simple as:

      a = (yesterdays sunrise time * todays sunrise * tommorow moonrise) / 3
      b = (yesterdays moonrise time * todays moonrise * tommorow moonrise) / 3
      c = (yesterdays high tide time * todays high tide time * tommorow high tide time) / 3
      d = (yesterdays low tide time * todays low tide time * tommorow low tide time) / 3

      Then from then, you can specify the order of the key ... ABDC, ACDB, AADD, ABDD, etc

      You can go very crazy with it, or make it so silly and stuiped no one would figure it out.

      Eitherway, this is a really cool idea I am going to look into.

      --
      until (succeed) try { again(); }
  107. easy way to secure by way2trivial · · Score: 3, Informative

    the 'hammer' will have a different IP than the authorized 'knocker'

    --
    every day http://en.wikipedia.org/wiki/Special:Random
  108. A Question about packet sniffing by Stone316 · · Score: 2, Interesting
    I've always been curious of packet sniffing but really never investigated it indepth. Would the person who wants to sniff your network be on the same subnet or have access to some major hub? ie, How is a guy in Russia going to sniff and find the right port combo if the server is in Seattle?

    Wouldn't he have had to hack a computer closer to his target in order to be successful?

    Wouldn't the best option be to have some type of SecurID based password in order to access the port? Unless there is a bug or hole in the software isn't a randomly changing password that requires a pin about as good as it gets?

    And as they say, Security through obscurity isn't.

    --
    "Thanks to the remote control I have the attention span of a gerbil."
    1. Re:A Question about packet sniffing by jrexilius · · Score: 1

      This would make for a complex client but:

      an RSA ACE server that listens to knocked ports for a given segment of time that would match the changing value on the token, if proper sequence for that time frame is given it opens the port for the given client IP that is doing the knocking (not just open the port to the world as many people are talking about here).

      This is complex, however, it is pseudo-one-time (precludes it being sniffed and replayed beyond a 60 second window), the rule would only open for the IP that is doing the knocking (no spoofing), and it would effectively be implementing two-factor authentication (the client and FOB). You could mitigate the risk of the sequence being replayed in that same minute by setting it is invalid if it worked.

      Yeah, complex and resource intensive but you could reduce the risk of remote access protocol exploits .

    2. Re:A Question about packet sniffing by gcalvin · · Score: 1

      Basically, you're right. You can't sniff if you don't have access to the packets, which means being on the same ethernet. But you should be paranoid about what may already be on your network. Do you really know your router isn't sniffing and sending logs to somebody? How about your DNS server? How about that Windows box that UPS put in for the shipping dock? How about that webcam with the built-in web server?

      As for getting SecurID authentication before giving access to the ethernet port, how are you going to do that? It has to authenticate to something, and if it can't use the network, what is it authenticating to? And how secure is that?

    3. Re:A Question about packet sniffing by Tassach · · Score: 1
      How is a guy in Russia going to sniff and find the right port combo if the server is in Seattle
      1. Compromise a peer machine on the same net. Set this machine to promiscuous mode. The usefulness of this technique is limited on a switched ethernet, but can still be effective (other machines can be spoofed into using the compromised machine as thier gateway)
      2. Compromise a machine through which the target machine's traffic is routed
      3. Compromise the routing tables of the target machine or an upstream machine to route traffic through a machine you control
      Of course there are always the old standbys of social engineering and physical intrusion.
      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    4. Re:A Question about packet sniffing by Atzanteol · · Score: 1

      Notice that each solution you list involves a hacker compromising other machines, making more noise, and being a lot more 'visible'. This is a *good* thing. The more work you make a hacker do, and the more visible you make them, the more likely they are to be noticed and stopped.

      Obscurity may not be great at stopping hackers, but it can be fantastic at making them more visible.

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
    5. Re:A Question about packet sniffing by Tassach · · Score: 1

      Security is only as strong as the weakest link in the chain. Hiding a port doesn't increase security unless the fact that the port was visible *was* the weak link in the chain. If that's the case, hiding an insecure port still isn't giving you any real security, it's just providing the illusion of security. IT would be less effort and more effective to secure the port properly rather than obfuscating it's presence.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    6. Re:A Question about packet sniffing by 0x12d3 · · Score: 1

      Well the issue is your _application_ logs get a lot shorter here. You won't show 50,000 entries in your apache access logs from the million and one script kiddies who found your box with a port scan and try to run some 7 year old NT 'sploit-- They won't ever make an actual HTTP request!! Also this isn't exactly sec. through obsc. Anymore than an "obscure" password is; it just allows for a bit more flexibilty. Just as a pwd can deny access without proper auth this does the same-- a side effect is that you don't even have to inform the user that they were denied access.

    7. Re:A Question about packet sniffing by Atzanteol · · Score: 1

      But you don't understand. If it's the *only* security, then it's not good. But combine it with other good security practices, and you're probably good. After a known hole was discovered in SSH, all the kiddies write simple scripts to scan for SSH servers. If your server doesn't show up because they didn't use the 'knock', then you aren't found.

      It's just another layer of security the kiddies have to peel back. With this simple action, you may have stopped 90% of script kiddies out there because they don't bother to do more than a quick 'nmap' scan of a subnet.

      How does this not help?

      --
      "Ignorance more frequently begets confidence than does knowledge"

      - Charles Darwin
  109. Useless behind firewalls by LostCauz · · Score: 1

    Unless you open all ports on the firewall, at which point why have a firewall?

    Or am I wrong?

    1. Re:Useless behind firewalls by LCookie · · Score: 0

      Well all ports are closed on the firewall. The point is that the firewall logs the failed tries . A script would then monitor that logfile for special (secret) connection sequences and then re Once it detects some special sequence of failures it can react.. Like: Failed connection on port 8292 Failed connection on port 8293 Failed connection on port 8211 makes the script modify its rules to open port 22 for SSH for 10 seconds so the "knocker" can get into the machine. So if you don't know you have to attempt to connect to ports 8292, 8293 and 8211 in that order before making an SSH the port will be closed.

  110. Good idea by MicroBerto · · Score: 1
    This is one of those ideas where I go "damn, why didn't *I* think of that?!"

    There was a good response about your network being sniffed and you could get the knocking sequence, but maybe the knocking sequence could also be changed regularly and you get a key that somehow deciphers what knock sequence to use on what given day or whatever.

    I've never implemented anything like that, so that's just a general idea. You can see what I'm saying -- yet ANOTHER layer somehow that changes.

    --
    Berto
  111. I like this idea by mrdaveb · · Score: 2, Insightful

    Although people are right in saying that packet sniffing can easily defeat this, I think it still improves security.

    It leaves the impression that the machine has no ports open, so script kiddies will leave you alone. Also, an attacker can't just exploit a server bug to crack the system without also being in a suitable location to packet sniff the knock combination to get the port open in the first place.

    --
    Homme petit d'homme petit, s'attend, n'avale
  112. Open a whole range of ports by Imperator · · Score: 1

    Don't just open the ports on which remote clients are to knock. Open a whole range of ports--say, a couple thousand. Then an attacker won't (easily) be able to try all the possible knock sequences.

    --

    Gates' Law: Every 18 months, the speed of software halves.
    1. 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.
    2. Re:Open a whole range of ports by Shurhaian · · Score: 1

      The article summary states that the ports involved are closed, including those knocked on. I cannot read the article itself from work, so can't personally verify the validity of that summary at this time.

      --
      NB: YMMV. IANAL. Take the above with a grain of salt.
    3. Re:Open a whole range of ports by lactose99 · · Score: 4, Insightful

      That depends on the NAT gateway, as per the original poster. If the NAT gateway is dropping all packets that aren't part of a) valid incoming connections or b) a port knocking scheme, a portscan would reveal some or all of the ports utilized in the port knocking scheme. Ports that are closed but part of the knocking scheme would return a connection refused, while all the other (filtered) ports would simply be dropped.

      Granted, most anyone implementing this sort of security setup on their firewall would most likely think about this and either a) open an entire range of ports, only some of which would be used for port knocking (as a previous poster mentioned) or b) simply close everything at the NAT gateway and not drop any packets, thereby not revealing any detail regarding a port knocking scheme.

      I'm sure there are several other ways to deal with this at a NAT gateway, but they just aren't coming to mind at the moment.

      --
      Fully licensed blockchain psychiatrist
    4. Re:Open a whole range of ports by Short+Circuit · · Score: 1

      It would be very easy to implement this using the ULOG target in iptables. Have a userland app watch the log file, and issue iptables commands when a pattern is matched.

      Sounds like fun, actually.

    5. Re:Open a whole range of ports by essreenim · · Score: 1

      I'm not sure that's the intention

      Port scanning can get you in once you find an open port.
      With this, even ehen you find an open port you cannot use it unless you have the magic "knock"!
      So in effect all ports would be closed, you give the magic knock - it's accepted, the port is open to you..!

      This kind of thing should have been introduced along time ago and should already be highly advanced but alas..

    6. Re:Open a whole range of ports by Anonymous Coward · · Score: 0

      why would their be a "connection refused" ack on ports that are involved in port knocking?

      why wouldn't to the client, all ports simply be dropped?

    7. Re:Open a whole range of ports by blazerw11 · · Score: 5, Insightful

      That depends on the NAT gateway

      No, the gateway or direct host has ALL PORTS CLOSED, however it does log port requests. If the log shows the knocking sequence, then and only then, will it open a port.

      --
      A great many people think they are thinking when they are merely rearranging their prejudices. -- William James
    8. Re:Open a whole range of ports by complete+loony · · Score: 1

      Who said the client needed to receive connection refused responses?
      Just don't wait for a successful connection to the knocking ports.
      Also only allow the host who knocked access to the opened connection, this shouldn't be to hard to implement within a NAT gateway, since all you really need to do to open the port is start fowarding to the appropriate machine which would already be listenening.
      This still shouldn't be hard to implement.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    9. Re:Open a whole range of ports by kidlinux · · Score: 1

      "Ports that are closed but part of the knocking scheme would return a connection refused, while all the other (filtered) ports would simply be dropped."

      Why can't ports in the knocking scheme drop the packets? I don't see any reason why the knocking ports should have to return a refused connection. IPtables, for example, could drop the connection on all ports, but it would still be able to record which ports were being requested. So after it detects connection attempts on certain ports (and drops them) it could then open a port for a connection.

      --
      -kidlinux.
    10. Re:Open a whole range of ports by lactose99 · · Score: 1

      No, the gateway or direct host has ALL PORTS CLOSED, however it does log port requests. If the log shows the knocking sequence, then and only then, will it open a port.

      Right, but if you are behind a NAT gateway that is filtering packets, a drop will still appear differently than a closed connection to someone scanning the host.

      Thinking about this again, I suppose you could still trigger with all filtered ports as well, so long as the firewall software is configured to log dropped packets to those ports and you have a script capable of triggering such a setup. The original post said closed ports, so I mentioned a caveat if a filter is also dropping packets somewhere in there.

      --
      Fully licensed blockchain psychiatrist
    11. Re:Open a whole range of ports by Bill+Privatus · · Score: 4, Interesting

      Sorry, wrong. There are several messages in this thread that mention REJECT (response to packet) instead of DROP (total silence). With this scheme in place, you need not listen on *any* ports, and you need not respond in any way. You can have a totally silent box, even with 10 or 20 services "listening". Nothing gets through until your iptables/ipchains software allows the traffic through.

      Admittedly, if you're running a public site, you're mixing two kinds of solution --- publicly available vs secured, but analogous statements can be made here - you can't tell a public site using port knocking for some special services from a public site that doesn't support same.

      This is like a void fn() in C (no return status). You knock on the 5, 10, or 25 ports in the right sequence to "send your message". You get nothing back. You then try to open the port that is your ultimate destination - if it's open, you're fine, if it's not, you have issues. This isn't a full-duplex kind of protocol, folks. I love it :-)

      Thus, it is impossible to distinguish a totally silent box (listening on no ports, dropping all packets) that has implemented port knocking from a box that is merely totally silent.

      As a two-laptop user who attaches to corporate LANs and public high-speed networks in hotels, I just love the idea of having all packets dropped until someone sends "shave & a haircut!" - then letting them in for a bit.

      It would certainly be better than my current approach - using ethernet addresses (maclist in Shorewall! :-) to allow ftp and http etc to my linux box.

      --
      Redundancy is good; triple redundancy is twice as good! - Me.
    12. Re:Open a whole range of ports by Thing+1 · · Score: 1
      I just love the idea of having all packets dropped until someone sends "shave & a haircut!" - then letting them in for a bit.

      Heh, two bits, natch. ;-)

      As other posters have said, this is the coolest thing I've seen on /. in quite some time. (SCO is great humor and morbid curiosity like rubbernecking at car crashes, but that's not really why I come here -- I love the technology bits, and nanodot.org doesn't update fast enough.)

      --
      I feel fantastic, and I'm still alive.
    13. Re:Open a whole range of ports by zerocool^ · · Score: 1

      NOT a new idea.

      Item 16605 on Packetstorm, posted June 13 2000:

      cd00r.c is a proof of concept code to test the idea of a completely invisible (read: not listening) backdoor server. Standard backdoors and remote access services have one major problem - the port's they are listening on are visible on the system console as well as from outside (by port scanning). To activate the remote access service, one has to send several packets (TCP SYN) to ports on the target system. Which ports in which order and how many of them can be defined in the source code. Homepage: http://www.phenoelit.de/. By FX

      --
      sig?
    14. Re:Open a whole range of ports by ACPosterChild · · Score: 1
      until someone sends "shave & a haircut!" - then letting them in for a bit.

      You mean 2 bits, right? ;D

  113. Promiscuous mode by A+nonymous+Coward · · Score: 1

    Most, if not all, ethernet chips have a promiscuous mode. Normally they are configured to ignore all packets with a destination address other than theirs. But they have a promiscuous mode where they capture all packets.

    It is trivial to capture other packets on the same ethernet.

    1. Re:Promiscuous mode by crotherm · · Score: 2, Informative
      It is trivial to capture other packets on the same ethernet.


      Not if your network is using a wired switch to connect the hosts. By definition, you should only see broadcast and unicast to your IP, not the whole network. This could be more of an issue if you are using a shared network link 10base2 or 802.11.

      --
      "Those who make peaceful revolution impossible, make violent revolution inevitable" - JFK
    2. Re:Promiscuous mode by _Sharp'r_ · · Score: 4, Informative

      Most switches have, uhh.... "features" that allow an experienced attacker to trick them into broadcasting traffic to multiple ports.

      Essentially, with a little judicious arp spoofing and a flood or two, the switch can be confused into just "making sure" the packets get to the right destination by broadcasting like a hub when it would normally be switching.

      --
      The party of stupid and the party of evil get together and do something both stupid and evil, then call it bipartisan.
    3. Re:Promiscuous mode by Anonymous Coward · · Score: 0
    4. Re:Promiscuous mode by Anonymous Coward · · Score: 0

      pfft. DSniff, ettercap, and hunt among others can sniff switched networks.

    5. Re:Promiscuous mode by Hardwyred · · Score: 1

      Not true sir. Utilities like ettercap make it pretty darn easy to sniff a switched network. Download it and give it a shot. Note, ettercap will almost definetly set off just about any IDS that is sitting on the segment you are peaking into, also, ettercap is still limited to your broadcast domain, so dont try to use it to sniff a segment that is out of your subnet.

      --
      www.linux-skunkworks.com
    6. Re:Promiscuous mode by Anonymous Coward · · Score: 0

      This is crap. Switches are for performance, not security. There are a lot of ways to jump the little speed bump of percieved security of a switch. Tell the segment that you are the router using ICMP redirects or intercepting DHCP requests (both broadcast traffic) then you can sniff traffic. Most switches also have a fixed number of MAC addresses that they can handle (depending on memory). If this is full, the will failsafe into hub mode. Flood the subnet with enough MAC addresses to make it a hub and you can sniff traffic. There are probably many other ways, so never think a switch is a security device.

    7. Re:Promiscuous mode by Yokaze · · Score: 1

      Flood the table of the switch with lots of bogus MACs and it will behave like a hub.

      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
    8. Re:Promiscuous mode by Anonymous Coward · · Score: 0

      A switch is a little more secure than a hub because it forces an attacker to send. A sniffer can be entirely passive on a hub, which means it's hard to detect (there are ways but none is reliable if the attacker knows what he's doing). A sniffer on a switch is easily detectable. Of course there's only a security gain if you actually look out for sniffers.

    9. Re:Promiscuous mode by nr1 · · Score: 2, Informative

      actually, you only really need arp spoofing, or rather poisoning. By sending spoofed arp reply packets you trick the target into thinking your computer is the router and vice versa. You can then forward the traffic between the two, so that it is totally transparent to them. It's the classical man-in-the-middle attack.

      Switched networks are definitely not safe from sniffing, it just makes more "noise" to do so.

    10. Re:Promiscuous mode by Anonymous Coward · · Score: 1, Informative

      Most switches have, uhh.... "features" that allow an experienced attacker to trick them into broadcasting traffic to multiple ports.

      Yes, and many managed switches allow you to lock the mac addresses for that port. Very handy to prevent mac address/arp spoofing.

  114. I thought of this 2 years ago by cr@ckwhore · · Score: 3, Interesting

    Interesting concept... I thought of this 2 years ago and I'm now kicking myself in the balls for not acting on it! (not literally)

    In my version of "port knocking", everything was going to be controled via ICMP echo packets.. aka "ping".

    A single Ping packet can contain arbitrary data of an arbitrary length less than 64k. Through a config file, the system admin could define ping sequences using time, data, and/or packet size, along with a specified script to execute on each successful reception of the ping sequence.

    Then, remotely, people who know the ping sequences could use almost any available ping utility on any machine to open remote ports, etc.

    The concept of executing a script, rather than opening or closing ports, allows for more flexibility. Not only can the admin open and close ports via scripts, but could do other useful things.

    --
    Skiers and Riders -- http://www.snowjournal.com
    1. Re:I thought of this 2 years ago by jrumney · · Score: 1

      I thought about something similar around a year ago too. In my version, the port would be opened by connecting to a certain URL, known only to me, on my https server. I never got around to implementing it though. Another related idea I never got around to implementing was to maintain a dynamic blacklist of IPs that tried to connect to certain ports, or access certain URLs (worms, hack attempts and spam spiders) on my webserver. At the moment I'm tarpitting the latter, which manages to keep some worms busy for a while.

  115. Timing could add another layer by ChiralSoftware · · Score: 1
    Some posters have suggested sniffing as a way to get through a port knocking defense. That is true, but what if the "knock" pattern changed in some pseudo-random way and the same knock could never be used twice? Think s/key. Then even sniffers wouldn't know what to do. Sometime when I have time I'm also going to write a PAM module for Cryptocard authentication for SSH to provide two-factor authentication, too.

    I think this whole idea is a cool technique. It isn't the same as security through obscurity because the security still relies in a key. It is more like "network protocol steganography" actually.

    ---------
    Create a WAP server now

  116. man in the middle? by Darth_brooks · · Score: 1

    I didn't RTFA, so maybe this was already covered.

    This doesn't seem like it would help in the case of a man in the middle attack. The knock sequence would show up along with the rest of the sniffed traffic, right?

    --
    There are some people that if they don't know, you can't tell 'em.
  117. You guys make this so freakin hard... by TheNarrator · · Score: 0

    I did this forever ago and it was a helluva lot easier than the above hack. You just make a 3 line perl cgi on your website somewhere that accepts a password and a note. When the user puts in the right password you puts their host at the end of /etc/hosts.allow file you let them in. Duh... Now that was easy.

  118. HOWTO by Anonymous Coward · · Score: 0
    So, you are probably asking yourself right now:

    How can this ingenious troll produce this high-value crapflood data?

    Well, my friend, it is actually quite easy.

    Open your favourite editor, which is of course vim.

    1. Paste some random bullshit, if you excuse my lingo, into a running vim session
    2. Select a big region of text with the line-wise C-V selection (in NORMAL mode)
    3. Pipe the region through the encode-base64 command: with the region still selected, enter
      :'<,'>!encode-base64<RETURN>


    That's all, faggots!
  119. been there done that by el_salvador · · Score: 0

    just get xinetd to dispatch a bunch of bash scripts when you connect to a port. hook up some scripts together, and get them to launch the ssh server when done in the right sequence. i also use that to shutdown my local serverbox just by telnetting to a certain port on it.

  120. I don't know why by The+Unabageler · · Score: 1

    so many people are in a fuss about how insecure this is. Gansters have been using secret knocks+password for ages to get into their hideouts.

    "knock, pause, knock knock, pause, knock"

    "what's the password?"

    "new england clam chowder"

    --
    perl -e '$_="\007/4`\cp%2,".chr(127);s/./"\"\\c$&\""/gees; print'
  121. Knock Knock Knockin' on Heaven's Port.... by Prince+Vegeta+SSJ4 · · Score: 1

    Axl Rose:

    Hey, hey hey hey

    Knock Knock Knockin' on Heaven's Port....

  122. Looks like we found the secret knock by pantycrickets · · Score: 1

    Looks like the secret knock for this site was just hitting port 80 a few hundred thousand times.

  123. Shave-And-A-Haircut... by Anonymous Coward · · Score: 0

    Two-Bits

  124. Not obscure *enough*? by Embedded+Geek · · Score: 1
    I'm concerned about how obscure the "knock" would need to be. If this feature were to catch on, it would soon implemented as part of a standard distribution. There would likely be a default knock that could be changed in a config file. Natually, you'd need to change the default with a config file if you wanted to be reasonably secure (the common complaint with Windows security). That means telling your users the secret knock in some way...

    Which, of course, is the same way you'd get them the encryption keys in the first place. If you're going to that much trouble but still risk exposing your keys through distribution to users, why not just add a few more bits to your keys.

    Unless, of course, each "knock" was a SSH session with a unique key, each of which was preceded by eight nonecrypted knocks on other ports...

    I love recursion.

    --

    "Prepare for the worst - hope for the best."

  125. Relatively easy to detect in fact by Rich · · Score: 1

    Actually in most configurations this could be detected by looking at the returned packets. The firewall protecting the network would generally block all the ports except those involved in the 'knocking' so these would return nothing (assuming a drop rule is in place), the closed ports could then be detected by observing the RST packet sent when they are probed. This could be trivially done with nmap. The other likely configuration is that firewall shows all unused ports as closed, in this case you can detect which ones were closed by the firewall and which ones were closed by the machine behind it by the difference in the TTL field of the returned packet.

    The one situation where this technique could work is where a host is directly on the network and has no firewall. A very bad idea.

  126. replay? by archaicTG · · Score: 1

    From what I can tell, this is still vulnerable to a replay attack. The examples shown would also be relatively easy to brute-force.

    I agree with the parent post in that this is a good layer of defense against random port-scanning. My question is how much better is it than simply moving your services to non-standard ports?

    1. Re:replay? by hchaos · · Score: 2, Informative
      My question is how much better is it than simply moving your services to non-standard ports?
      Non-standard ports still respond to basic port-scanning. Inactive ports don't respond until the correct sequence of ports is scanned, which will most likely prevent a random attack, and will prevent a directed attack by anyone who can't sniff the packet stream.
    2. Re:replay? by 3Suns · · Score: 1

      Yes, and if I gave you a demonstration example of AES encryption that you could do in your head, that would be pretty easy to brute-force too. One could set up port-knocking with 512 sequential secret knocks... out of 2^16 ports per knock or whatever... how easy is that to brute force? And that's just to scan one port!

      The replay attack is a problem, but an attacker with the ability to sniff your local traffic will always be able to determine what ports are being used... there's no defense for that short of tunnelling everything through one ssh port.

      It's infinitely better than using non-standard ports... those will still be discovered by passive port-scanners who scan a broad range. With port-knocking you can essentially make a machine as invisible as you want (maybe still smelly for the packet-sniffers) and still have all your services available to trusted clients.

      --

      -3Suns

      ~~~~
      The Revolution will be Slashdotted
    3. Re:replay? by Roofus · · Score: 1

      One time pads would solve that. And once a SSH connection has been completed, you can transfer new pads.

    4. Re:replay? by ink · · Score: 1
      From what I can tell, this is still vulnerable to a replay attack. The examples shown would also be relatively easy to brute-force.

      Yes, without a challenge-response or one-time secret, this will always be the case (barring wierd quantum physics or somesuch). I don't think it would be that easy to brute-force; there are 65k ports, and you have to have a correct permutation of seven ports. The odds of randomly doing that on the first attempt are 1 in 5.191e+33; assuming you could perform 1000 tests per second.... it would take 1.646e+23 years to exhaust all possible combinations; about half that long to have a good shot at guessing it.

      Good luck.

      My question is how much better is it than simply moving your services to non-standard ports?

      I'd say that it's significantly better, as long as you have nobody in the middle. If you have a black hat in the middle, then it's no good at all. Fortunately, in today's switched world, it's generally Hard to get in the middle, or at least Very Inconvenient.

      --
      The wheel is turning, but the hamster is dead.
    5. Re:replay? by Tom7 · · Score: 2, Informative

      My question is how much better is it than simply moving your services to non-standard ports?

      Quite a bit better, since it is easy to scan 65k ports serially to see which ones are listening, but much harder to scan a jillion combination of port sequences to see which ones are listening.

    6. Re:replay? by Anonymous Coward · · Score: 0

      to exhaust all possible combinations; about half that long to have a good shot at guessing it.

      You can be a bit more lucky since a series of n requests has more than n/7 subsequences of length 7 in it. (Indeed, it has n-6.)

    7. Re:replay? by Anonymous Coward · · Score: 0

      Doh. Don't ever say something like that to a cryptographer.

  127. I thought about doing this... by City+Jim+3000 · · Score: 0

    I thought about using this scheme to mask the SSH port when I realized that the reason I have the server is because I'm running a website on it...

    Next method please.

  128. authorization by Doc+Ruby · · Score: 1

    Is portknocking computationally cheaper than SSL? Or some other authentication over LDAP?

    --

    --
    make install -not war

  129. Even more security by lawpoop · · Score: 1

    While knocking, you could also try other ports to confound anyone how might be trying to sniff the sequence. If the sequence is 2347 92347 239 234098 , then throw in a few 43588, 2394, 2349. If the 'doorman' is looking for 2347 - $junk_data - 92347 - $junk_data - 239 - $junk_data - 234098 ,m you can even repeat some of the ports that it's looking for in other parts of the string.

    --
    Computers are useless. They can only give you answers.
    -- Pablo Picasso
  130. Patent by millahtime · · Score: 1

    I know I have to ask this but does anyone have a patent on this yet???

    If not I bet one from Microsoft, SCO or some lawyer was just filed.

  131. Virus Protection by ifreakshow · · Score: 1

    Port knocking would help defeat a virus that spreads by exploiting unpatched or 0-day expoitss running on ports that need to be exposed.

    This would allow you to let in legitimate traffic while holding back a virus trying to exploit port 1434. It wouldn't matter how long Microsoft took to write a patch. The number of request from a virus slowing down the network is another story.

  132. Not necessarily security through obscurity by illuminatedwax · · Score: 1

    By most people's definition, RSA is "security through obsurity" - all you need is the proper key, and you bust the code. Unfortunately, to bust a 1024-bit key, there's a lot of possible codes. This system provides security through obscurity (the key being the obscure part.)

    Disregarding any way to step around the system, this seems secure. Let's say we can use 5 ports to knock, and these are between 1000-9999. That's 9000 different ports. That gives us 9000*8999*8998*8997*8996 = 58,983,415,510,950,216,000 ~= 2^66
    different ways to have a secret knock. Now this is not that great, but I would guess (here's where I might be wrong) that it has the around the same strength as a 128-bit RSA key, since you only need to divide the key by sqrt(2^128)=2^64 numbers to break it.

    I mean, not to mention a sysadmin might notice 2^66 * 5 port accesses. Now, that's only 5 ports; the number of ports "knocked" could be much greater, increasing the amount of security. In fact the example in the posting uses 7.

    --Stephen

    --
    Did you ever notice that *nix doesn't even cover Linux?
  133. It wouldn't take time by Lord+Graga · · Score: 1

    before the port knocking would be turned into smaller codes, like:

    88,0,24,0,103,0,2760,0,667,0,22

    which would mean: knock on port 88, wait a second, knock on port 24, wait a second, knock on port 103, wait a second, knock on port 2760, wait a second, knock on port 667,wait a second, and try to access port 22.
    Then somebody would turn that into a string, and bing!, you had a secondary password.

  134. Ostiary as an alternative to port knocking by Anonymous Coward · · Score: 0

    Ostiary is a program that can protect OpenSSH in a similar way to port knocking. It allows for secure remote script execution. It was written by a member of MDLUG.

  135. If the port's a rockin' by arpy · · Score: 1

    ... don't come knockin'

    Sorry. I've had very little sleep.

  136. Negative knocking by hey · · Score: 3, Informative

    Let's say the correct squence is ports 2000, 2002, 2004. You could add a check that says if there is a knock on port 2001 or 2003 then this guy is locked out for a while.

    1. Re:Negative knocking by dr_dank · · Score: 1

      You could add a check that says if there is a knock on port 2001 or 2003 then this guy is locked out for a while.

      If you're logging by IP address, it would be trivial for an attacker to try from another system at another address and try again.

      --
      Where does the school board find them and why do they keep sending them to ME?
    2. Re:Negative knocking by Anonymous Coward · · Score: 0

      Another thing to think about with this is that if there is a delay on some ports and not others, you are giving information to the attacker. Either completely random delays to slow things down, or completely identical delays would probably be the best bet.

    3. Re:Negative knocking by Anonymous Coward · · Score: 0

      An attacker could send a continuous stream of spoofed knocks, thereby locking out the spoofee.

  137. RSA SecurID by lysander · · Score: 1
    This is bascially what the RSA SecurID is all about.
    RSA SecurID authenticators are as simple to use as entering a password, but much more secure. Each end user is assigned an RSA SecurID authenticator which generates a new, unpredictable code every 60 seconds. The user combines this number with a secret PIN to log into protected resources.
    Instead of just a password, or in the knocking case, just some additional knowledge that anyone can sniff, you need a physical token and a PIN as well (assuming no one cracks your auth server).
    --
    GET YOUR WEAPONS READY! --DR.LIGHT
    1. Re:RSA SecurID by Anonymous Coward · · Score: 0

      Just to bring this back on topic: Port knocking isn't about authentication or keeping people out who can sniff your network. That's what the daemons behind the secret knock do. The secret knock hides the existence of open ports. There's no way you can hide that information from someone who sniffs your network: No matter how complicated you make the knocking scheme, it ends with a completed connection to the "hidden" port. In fact, the more complicated the knocking scheme gets, the less useful it is. KISS or not at all. If complicated math or big tables of data come into it, the knocking "daemon" itself becomes a security risk: Even if it never replies, it can still be vulnerable to buffer overflows. One of the ideas behind port knocking is to have a dead simple protocol hide a more complicated protocol in order to reduce the threat potential.

  138. Only use the knocking sequence once. by totierne · · Score: 1

    Only use the knocking sequence (call it a key) once. So that if someone is watching the network and try to repeat the key, the port will not open.

  139. This was discussed extensively... by amplt1337 · · Score: 4, Informative

    on debian-security a couple of months back.

    Anyway, one of the biggest problems is failure rate. If that "secret knock" fails unless you correctly use the appropriate sequence of knocks, then anyone malicious can implement a trivial denial-of-service attack just by constantly hitting random ports, preventing any knock completion.
    Alternatively, if you ignore non-knockable ports, or ports that aren't part of the knock, then you've dramatically whittled down the strength of your virtual password, and made it that much easier to brute-force.
    Perhaps this would deter some of the lowest levels of sk|21p7 |<1dd13z from getting in, but that would be true only for about two weeks, whereupon new toyz are released that automate these attacks, and you've given the black hats one more weapon (DoS through spoofed noise packets) in the meantime.

    I guess if you really, really wanted to do this, you could have a single accessible port that would listen for access, and then receive an encrypted key that determines which other port your server opens for a possible connection. But basically all you're doing then is adding on another layer of password protection, whose effect will be circumvented when somebody finally decides it's annoying to have to login twice or enter multiple passwords, and sets them both to the same thing, on auto-login, then leaves his laptop sitting around for three minutes. And you've still not fixed the sniffing problem. There are bigger security soft spots to be addressed than trivially hiding access to your ssh port.

    --
    Freedom isn't free; its price is the well-being of others.
    1. Re:This was discussed extensively... by Dr.+Manhattan · · Score: 1
      you could have a single accessible port that would listen for access, and then receive an encrypted key that determines which other port your server opens for a possible connection.

      I did this with Ostiary. Uses salted HMAC-MD5, fixed-length data, etc. Secure from replay, man-in-the-middle, sniffer, and other attacks. Still vulnerable to DOS, but what isn't?

      I admit that the human factor limits the reliability of any system. But this is designed to protect against bugs in ssh. I trust at least myself not to do anything really stupid.

      --
      PHEM - party like it's 1997-2003!
    2. Re:This was discussed extensively... by El · · Score: 1

      Wouldn't keeping a separate queue of "knocks" for each originating IP address prevent these DoS problems?

      --

      "Freedom means freedom for everybody" -- Dick Cheney

    3. Re:This was discussed extensively... by Lumpy · · Score: 1

      simple solution... attach knocking to the originating IP address.

      if 30 kiddies are knocking away at random ports I can still easily get in as my knocking is attached to my IP address.

      your Denial of Service attack has zero effectiveness unless the kiddies snooped my incoming IP address and then are spoofing it.

      the problem lies in a skilled cracker hijacking your domain and simply listening for your knock pattern and recording it. if it see's the same pattern twice, foreward all connections to the origional machine... all a user would see is "internet is acting up but I got in anyways."

      and this technique was used back in the late 80's early 90's on hacker-boards. ring pattern to activate the modem on the next call.

      --
      Do not look at laser with remaining good eye.
    4. Re:This was discussed extensively... by amplt1337 · · Score: 1
      Sure, I guess I shouldn't knock it til I try it... [sorry]
      your Denial of Service attack has zero effectiveness unless the kiddies snooped my incoming IP address and then are spoofing it.
      Yes, but do you think this wouldn't happen? If your packets are so inviolable, why bother with SSH, why not just use telnet?
      Ok, that's a little unfair, I'll admit the circumstances would have to be right and it's not a guaranteed DoS. OTOH, it's a lot easier than spreading malware to hijack half the internet and do it the old-fashioned way. (And note that I did say spoofed packets in my original post).

      the problem lies in a skilled cracker hijacking your domain and simply listening for your knock pattern and recording it. if it see's the same pattern twice, foreward all connections to the origional machine... all a user would see is "internet is acting up but I got in anyways."
      Yeah, that's one of many ways the knocking thing would be easily defeated. I guess the overwhelming point to me is that it's just not that much additional security.

      and this technique was used back in the late 80's early 90's on hacker-boards. ring pattern to activate the modem on the next call.
      Really? Hmm. It seems like the circumstances would make this a bit more secure there -- no reason to expect that a random phone number will have a modem connected to it, etc. (Though this is still bogus security-through-obscurity). And that it'd be at least a little harder to intercept the incoming knock pattern, because the phone system is centrally switched rather than relying on many many hops between connected machines. But I know basically nothing about phreaking or old hacker boards, so I'd appreciate correction.
      --
      Freedom isn't free; its price is the well-being of others.
    5. Re:This was discussed extensively... by Lumpy · · Score: 1

      actually it worked quite well in keeping several BBS's hidden from FBI eyes. one different approach was done by a friend of mine that had a small circuit that listened to the phone line while an answering machine picked up and played a message.. if you sent 4'th row DTMF tones in the right sequence it would drop a relay over to a modem that was already screaming at you (reverse connection, you had to be set as called party, it was set as calling party... not hard with a hayes modem, just adding a ,r to the end of the dial string worked.)

      then you got connected.

      Most every "clever" security or obscurity system was in use by the origional hacker groups in the 70's,80's and 90's.

      the best one I ever saw was a pair of modems on a offsite phone room that were paired back to back with a simple timer to hijack the businesses phone line at certian times to allow dial-in to connect to the second modem to call a third modem that would enable a fourth modem on company's mainframe for dial in, etc....

      the point is that nothing "innovative" or "clever" is really new... and there are always more solutions and cracks in every solution...

      it's keeping it obscure by putting it in the noise that makes it effective for a limited time.

      --
      Do not look at laser with remaining good eye.
  140. Simplify by nsayer · · Score: 1

    Seems like you could instead make a simple UDP ping-pong protocol (obviously with some encryption involved) that would let you set up arbitrary temporary NAT redirections. If such a thing were optionally available for those little firewall boxes from Linksys, Netgear, et al, it would make my life a lot easier (for when I need to VNC into my parent's machine to help them out, for instance).

    1. Re:Simplify by Dr.+Manhattan · · Score: 1
      If such a thing were optionally available for those little firewall boxes from Linksys

      Linksys routers have had a simple version of this for a while that they call port triggering.

      --
      PHEM - party like it's 1997-2003!
    2. Re:Simplify by nsayer · · Score: 1

      Sure but that's not quite what I'm talking about. With that, you have to configure it in advance, and *anyone* who knows the "secret" can do it.

      What I'm talking about is something closer to remote administration, but in a way that lets you do one simple thing from outside without the cumbersome web based UI navigation to get it done.

    3. Re:Simplify by Dr.+Manhattan · · Score: 1

      I already did that. It's called Ostiary. Much lower bandwidth & CPU requirements, actual cryptographic security, some level of confirmation that the message was received, etc.

      --
      PHEM - party like it's 1997-2003!
  141. freq. hopping analogy- by Samuel+Nitzberg · · Score: 5, Interesting

    This looks similar to how frequency-hopping is used on secure radios.

    Two radios synchronize, based on a key, and both change frequency every so many milliseconds. If you don't know the key, you can't send or receive to either of them.

    I would like to see this extended to a port-hopping system for all ports and services. Sure -- it will burn some clock cycles, but I like the approach.

    - Sam
    http://www.iamsam.com

    1. Re:freq. hopping analogy- by Anonymous Coward · · Score: 0

      Well, that would be fun to do with udp...

    2. Re:freq. hopping analogy- by Anonymous Coward · · Score: 0

      "Sure -- it will burn some clock cycles, but I like the approach."

      not like you were using them anyways...

    3. Re:freq. hopping analogy- by LadyLucky · · Score: 1

      This is only good for radio because you can't track all frequencies easily, and post process. For TCP/IP, changing ports doesn't do anything to someone watching, you still see all the packets!

      --
      dominionrd.blogspot.com - Restaurants on
    4. Re:freq. hopping analogy- by archen · · Score: 1

      Not quite. Frequency hop changes the frequency every couple miliseconds while transmitting and recieving. For TCP an equivelent would be changing ports all the time while connected. The real security would be that you would have some secret key telling you what port to start on and then use the same algorithm to hop between ports and some "key" to initalize the sequence. As someone else stated, that's not particularly useful with TCP since anyone sniffing the packets can see them all anyway.

      Frequency hop is the security in itself, while port knocking is a sort of authentication.

  142. Heheheh by eviltypeguy · · Score: 1

    When this port's a rockin' don't come a knockin'!

    You may now commence your groaning 8)

  143. Already used by backdoor by cytrox · · Score: 3, Informative

    This method is already used by the proof-of-concept linux backdoor cd00r, written in 2000.

  144. sniffer proof... by Anonymous Coward · · Score: 0

    Nope... ethereal will just list the ports one after the other with all the connections. Are we opening TCP ports to every one of these ports... that is a lot of overhead to establish a tcp connection... Not to mention that each one of these ports will have to have its own queue to manage connections and what happens if you have 30 users trying to connect to the so called "knocking" at a time. Race Condition anyone?

    So the question is... what advantage does this give to the server. The only thing I can think of is that 2 week old script kiddie has to work a lil harder to telnet to your mail server and do a 'vrfy' on an account. Other than that... It requires special applications and becomes an administrators nightmare(oh... I can't get it... or... even worse... DOS attack keeps you from even making it to the ssh port).

  145. knock knock by jki · · Score: 1

    it seems there already is a bunch of specialists working on it - well experienced in knocking the 80th one. Wish they open the door one day, though.

  146. Neither. by khasim · · Score: 4, Insightful

    #1. DoS attacks - how is this different from any other DoS attack?

    #2. Sniffing the port knocks - to do this, you would already have to have the upstream compromised or be on some shared network.

    1. Re:Neither. by Anonymous Coward · · Score: 0

      I think Dos attacks will probably be the same if the attacker is trying to simply eat all bandwidth, but if he/she is trying to SYN flood it's lot easier to throw away _a_lot_ more SYN packets, if the attacker had previsously knocked correctly. (I'm assuming that correct knocks don't bother w/ a 3 way handshake but I didn't actually rtfa).

    2. Re:Neither. by Malc · · Score: 1

      "#2. Sniffing the port knocks - to do this, you would already have to have the upstream compromised or be on some shared network."

      Or sitting in your car out in the street. The prevalence of wireless networking makes sniffing more practical.

    3. Re:Neither. by goatwhip · · Score: 1

      "... or be on some shared network." Uh, the internet?

    4. Re:Neither. by r00tdenied · · Score: 1

      I think he meant 'shared network' as in on a network segment that is not a vlan or switched. Because if you are on a switched/vlan network you can't easily sniff traffic being broadcasted across other network nodes.



      --
      Platinum Networks Hosting www.platinum-networks.com
  147. Re:CmdrTaco talks about "port knocking" all the ti by Lord+Kano · · Score: 1

    Jon Katz and George Michael may do it, but leave Rob alone.

    --
    "Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
  148. Web site is "knocked" down by unigeek · · Score: 3, Funny
    Looks like someone knocked on the wrong port. I believe the idea is to hit a few different ports and then go the secretly opening door. However the technique known as "slashdotting" where the sequence looks sort of like

    site up

    knock 80

    knock 80

    knock 80

    .. (knock 80 about 3 million times in two mintues)

    site down

  149. UDP then TCP by wowbagger · · Score: 1

    Why screw with some complicated method? Just say "To access my SSH port, first send a UDP datagram to port $foo containing this data [list]".

    Since you cannot tell if anybody received a UDP datagram or not, you can then have the stealth advantages of not having a TCP port open until the UDP packet comes in.

    And if you require the UDP packet to be a time-stamped message, signed with a keypair, you can protect yourself against replay attacks and such.

  150. not so shady... by Hubert_Shrump · · Score: 4, Interesting

    i've been running SSH on a nonstandard port with this in the way:


    iptables -N ${SSH_TABLE}
    iptables -Z ${SSH_TABLE}
    iptables -A ${SSH_TABLE} -m state --state NEW -m limit --limit 2/minute --limit-
    burst 2 -j DROP
    iptables -A ${SSH_TABLE} -m state --state NEW -m limit --limit 7/hour --limit-bu
    rst 7 -j DROP
    iptables -A ${SSH_TABLE} -m state --state NEW -m limit --limit 10/day --limit-bu
    rst 10 -j ACCEPT
    iptables -A ${SSH_TABLE} -j DROP


    well, I thought it was cool...

    --
    Keep your packets off my GNU/Girlfriend!
    1. Re:not so shady... by Anonymous Coward · · Score: 0

      Interesting idea... hide from a port scan, but send several connect requests which get dropped the it will accept your connection?

      If somone were to make 19 attempts in one minute would that lock you out for the day?

    2. Re:not so shady... by Hubert_Shrump · · Score: 1

      i nestle it up there in the really high port numbers (> 10000 or so)

      not that that does anything if someone knows the port, but it's wasting someone's time to have to scan that high and multiple times.

      it's the sneakiest i could come up with for iptables rules like this. though i'd been thinking about hooking netcat up to inetd to do what is being suggested here...

      maybe someone else can cobble up some quick shell for us?

      --
      Keep your packets off my GNU/Girlfriend!
  151. What about when the MARS BUNNY comes a knocking? by Anonymous Coward · · Score: 0

    NASA finds bunny on Mars...

    Yes, really...

    http://www.rense.com/general48/stransge.htm

  152. Shave and a haircut... by BlowChunx · · Score: 1

    two bits.

    Seriously though, isn't this just akin to the real world where you don't open the door unless they know the secret knock?

  153. this is great- i use it. by Anonymous Coward · · Score: 0

    what i do, is set to log all packets coming to 10 different ports. log packets also to 20 other ports. those 10 special ports have to be attempted in a specific order, and the 20 extra ones are there to block access to a host.

    a perl script runs in the background, checks /var/log/messages for the 10 special ports. Is all 20 of the "trick" ports there? Are they from the same IP address? If so, deny all tcp connections to that host. Are the 10 special ports there? In the right order? Ok, open up port 34345 (random port, not the same I use) to port 22 on the ssh box I use to gain access to the rest of my network (only open it for the IP address which knocked right). This is very secure, and damn hard to find, as any connections to the 20 ports ensure that the bad guys get blocked from that IP address forever.

    More secure than say, having the SSH server just listening on a given port.

  154. Not quite so easy by glorf · · Score: 1

    If done correctly I would assume that the port would only open for the IP that issued the knock. TCP Wrappers has been limiting ports based on rules for years, adding secret knock functionality, especially if you have Wrappers listening on all your ports would probably not be that difficult.

    1. Re:Not quite so easy by jrumney · · Score: 1

      iptables would be more suited than tcpwrappers, it works at a lower level.

  155. It is more secure. by khasim · · Score: 1

    Because instead of running the port open ALL THE TIME TO THE ENTIRE WORLD, it is only open for a short time to the address that correctly knocked.

    Which means that someone attacking your system has to have compromised your upstream so they can sniff your traffic.

    1. Re:It is more secure. by platypus · · Score: 1

      Because instead of running the port open ALL THE TIME TO THE ENTIRE WORLD [...]

      Who or what gives you the idea that open ports per se are insecure?

    2. Re:It is more secure. by Anonymous Coward · · Score: 0

      What is listening on those ports? How about SQL and slapper? Any service specific worm? If you had to initiate something to get a port opened, you would not be infected by joe random or jimmy script kiddie.

  156. /.ed by lonb · · Score: 1

    Looks like we knocked the crap out of port 80 on the article. Anyone have the text?

    --
    "Ain't I a stinka..." - Bugs
  157. "Security through obscurity" bashing is for noobs by Anonymous Coward · · Score: 1, Insightful

    All security, in the end, is security through obscurity. Noobs are the ones claiming that obscurity won't work.

    In the end, what is the goal of security - to protect the data being stored or presented. Now, protection against a DoS maybe won't fall into this category, since that is just basic load balancing and testing. Everything else, though, requires enforcing the principle of least access.

    to enforce that principle, you have to limit the availability of accounts that are privileged to do things you don't want done. Now, that is handled through password, multiple factor authentication, encryption etc. But all of those are predicated on the attacker not knowing what precise string is the equivalent of the old "Open Sesame".

    Patching? Chrooting? Hardening? all of those boil down to an attempt to make the attacker who wants to haxor something enter in through the appropriate channels (VPN to the backend and SSH in, open the door and sit at a keyboard, etc) and, o enter through those channels, he must know something that is not available (password, numebr being displayed on a SecurID token, key shape, etc).

    Security is all about preserving obscurity. Nothing more, nothing less.

  158. Gets around AUP Server ban by Anonymous Coward · · Score: 0

    This is a great way to keep an open server running and not get busted by your ISP. Only problem with me is my employer's firewall only allows certain ports to pass thru. This is what I'm going to do:

    1. Run SSH on one of few ports that will pass thru employer's firewall.

    2. Have iptables allow inbound from my employer's netblock.

    3. Have portknocking set up for any other connections.

    4. Block anything else.

  159. Some details... by petard · · Score: 1
    1. There is no reason to ignore reserved ports. For this scheme, any closed port is usable. So the "alphabet" is 2^16 - the number of open ports on the box.
    2. It could as easily be a 50 letter password if you wanted.
    3. The feedback mechanism is so slow (network) that even a short sequence would take a long time. Suppose there were 100000 possible combinations (this is way low). Suppose it takes 5 seconds to check each (this is probably the fastest realistic time). That's almost 6 days of brute force effort.
    4. Brute forcing this would be incredibly noisy.
    5. Once you get through this, you still have to get through ssh.
    The upshot of this is that you can have a sequence which is stronger (from a brute force perspective) than an 8 character ascii password. Still, this does look more promising for clandestine activity than it does for additional security.
    --
    .sig: file not found
  160. I have idea! by Maxhrk · · Score: 0

    A secret website! you need to do port knocking to access my secret website. Nuh nuh! i wont tell you the right port knocking password! *run away cackling*

  161. On top of that, by Anonymous Coward · · Score: 0

    you could get even fancier and have your knock ports listen for particular packet types (first port listens for TCP, second port listens for UDP, etc...). That'll bump that stat up even higher.

  162. Further application (past SSH) by CaptCanuk · · Score: 1

    First off, I don't think this is security by obscurity. This is just another layer of communications like a handshake is to modems and faxes. Security by obscurity would be a rolling port that was say 22 from 6-9am, 25 from 9-12pm, 31 from time x to time y and so forth. Or perhaps they would give you a randomizer seed set at a January 1st, 12:00am of that year and you run the seed through X times where X is the number of hours since January 1st 12:00am. Even changing the port from 22 to 44 is security by obscurity.

    That being said, what's the next application of this? HTTP? Port 80 only if 1337 was hit before. That could be how Slashdot subscribers could login... now that's 1337.

    --
    ---- The geek shall inherit the Earth.
  163. nocking sequence is a weak security. by axxackall · · Score: 1
    Nocking sequence is like a bar code, which can be expressed as a number. The byte length of such number will be what? 16 bit atop?

    Excuse me, with SSH and/or GPG we are dealing with 1024-bit keys today (which is just an example, not a maximum limitation).

    How 16-bit key can be more secure than 1024-bit key?

    The is negative. Noway 16-bit security can be stronger than 1024-bit one. It's against the theory of information, which is not proved false yet.

    I know why somepeople will love such nocking security - because it's through obscurity. People without math in brains often prefer security through obscurity. And always fail.

    Don't repeat their mistakes!

    --

    Less is more !
    1. Re:nocking sequence is a weak security. by kc8apf · · Score: 1

      OT, but ECC (elliptic curve cryptography) is as strong as RSA with smaller keys. A 160-bit ECC key is just as strong as a 1024-bit RSA key.

      This is possible since the underlying problem in ECC is much more complex and requires more time to attack for a given key length.

      --
      kc8apf
  164. Not a new idea by ftzdomino · · Score: 2, Interesting

    I wrote proof of concept code for this a few years ago. Mine is implemented as modified network sniffer code (with promisc disabled), so it doesn't require any weird firewall configs. I was considering some other things which could be useful, such as transmitting data via a fake network scan.

  165. I wrote Ostiary instead. by Dr.+Manhattan · · Score: 1
    A clever-enough sniffer could figure this out, depending on how much traffic they have to sift through. I've looked at lots of alternative but none gave me a warm fuzzy feeling. So I wrote my own.

    It does have an open port. The client connects, and gets 16 bytes (sizeof(md5 hash)) as a salt. It then hashes this using HMAC-MD5 with a secret password, and sends the result (16 bytes) back. Fixed-length data all the way, essentially zero chance of buffer overruns. Essentially impossible to crack, except for dictionary attacks. So low-resource it runs fine on my Mac SE/30 webserver.

    I call it Ostiary (mirror here) and I think it's damn secure.

    There'll be a Linux Gazette article about it this month (Feb) when it comes out.

    --
    PHEM - party like it's 1997-2003!
  166. Services listen on ports. by khasim · · Score: 4, Insightful

    It isn't the port. It's the service listening on that port.

    If the port is closed, then it is impossible to attack that service through that port.

    This process closes those ports.

    1. Re:Services listen on ports. by Anonymous Coward · · Score: 0

      Then why not use inetd to whitelist users. Or keep an ssh encypted port open, running a service by which valid users can request other ports to open if they have the password/knock that allows them to do so.

      Port knocking itself is "in the clear", insecure, stupid (who the hell wants people trying to find ports by blasting your network will all kinds of random port connections), etc.

      If you really want to keep most ports closed, use one port combined with a known secure protocol, to allow people with authority to request other ports to open. I could whip it up in Python (or Perl, or whatever) in five minutes, as a proof-of-concept.

    2. Re:Services listen on ports. by Tassach · · Score: 1
      The point the grandparent is making is that you shouldn't be running insecure services on a public interface to start with. Hiding an insecure service does not make it secure. Security through obscurity is never a good choice.

      Let's use a real world example. Say you want to have SWAT running on your box so you can admin your samba server remotely. However, your ISP uses DHCP, so you can't use xinetd to restrict connections from a trusted IP address. So what do you do? You could set up a port knocking scheme so that port 301 only opens up after you give it the secret knock. This is security through obscurity. Or you could do it the right way: set up xinetd so port 301 only accepts connections from localhost, then from home type:

      ssh -2CNx -i ~/.ssh/id_dsa -L 3301:localhost:301 me@mysambabox.mydomain.com
      Now you can browse to http://localhost:3301 from the home box and use SWAT securely. SSH port forwarding is designed for this kind of thing, and provides real security.

      The only thing a port knocking scheme is good for is for concealement -- hiding the fact from a port-scanner that a port is open. This makes is much more valuable for grey-hat and black-hat scenerios than it does for legitimate purposes. If all you want is secure remote access, a properly configured SSHD on port 22 is secure enough. Now, if you need to conceal your rogue SSHD instance from the PHB/BOFH, something like this is good. Sometimes you have to work around obstructionist pricks so that you can get your job done. Of course it's also useful for hiding the sshd you installed on the box you just r00ted.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    3. Re:Services listen on ports. by kiolbasa · · Score: 1

      What if the port-knocking daemon itself is insecure? We already established that it can be vulnerable to a replay attack, but what if there is a more serious problem, like a buffer overflow while listening for knock packets? Perhaps it is easier to write a port-knocking daemon than a ssh daemon, thus harder to screw it up. But you are still replacing one service with another, which doesn't eliminate the possibility of an exploit against bad coding.

      The only real use for this is hiding the existence of ssh, if for some reason that is important to you. After that you can use ssh to hide everything else, since that is effective against sniffing.

      --

      Beer wants to be free
    4. Re:Services listen on ports. by caluml · · Score: 1
      Or you could do it the right way: set up xinetd so port 301 only accepts connections from localhost, then from home type: ssh -2CNx -i ~/.ssh/id_dsa -L 3301:localhost:301 me@mysambabox.mydomain.com

      All very nice and secure. But when there is a remote root exploit for SSH, you'd be very happy to have a nice little knocking combo keeping your port 22 hidden.

    5. Re:Services listen on ports. by Anonymous Coward · · Score: 0

      Because whitelisting requires knowing who is who ahead of time-you can't accept connections from unidentified sources. The ssh encrypted port scheme keeps one port open, so port scanners can see that there is a machine there, and you lose the invisibility that makes port knocking so useful.

      The only people who blast your network with all kinds of random port connections are the ones who already blast it with all kinds of password guesses. Today, how many port scanners just send one packet to test for ssh, and how many automatically send billions of combinations of username and password with no idea whether any of it will have any effect?

      The goal isn't to keep most ports closed, it's to keep ALL ports closed.

      However, rather than using a knock with connections to random ports I'd recommend keeping one (not well known, and often changed) port closed but monitor the failed connections to it, and get a knock/password from those.

      p.s. stop trolling. and if this works, it means my ip isn't temporarily blocked from posting anymore!

  167. Moose by Anonymous Coward · · Score: 0

    just set up a continuous connection attempt on port 22, and when soemone else knocks that special knock, you're in.

  168. How about "borrowing" an idea from the SecureID... by Perl_Monk · · Score: 0

    ...implementation? Basically, SecureID works through time synchronization on a physical device (usually a credit card looking device with an LCD display, or a keychain fob) and your user ID.

    In a nutshell, what they do is make a passcode based on an algorithm using the current time, plus your user ID. When you attempt to log in, the server has generated the same passcode for your user ID due to the time being synched. In practice, this has shown to be pretty secure.

    So, you have two versions of the software, one on the remote machine to generate the sequence of ports to be "knocked" on, and the server side which uses the same algorithm to listen on those ports. You could have it change at whatever time interval you like, but would add another layer of security on top!

    Vidi Vici Veni

  169. Re:freq. hopping analogy by Anonymous Coward · · Score: 0

    That's not usually a security feature per se. That is, such broadcasts can still be followed, it's just not as easy as it has been with conventional scanners.

    It's also used to help use the spectrum more efficiently, rathter than as a security mechanism.

    I should know, I have an amature radio license...

  170. ugh security through obsucrity by sPaKr · · Score: 0, Redundant
    Lets look at the ways to defeat this joke.
    • port scan attacks (AKA brute force), instead of scanning just code up a program to attempt all permatations of knocks, sure it will take a while.. but sooner or later it will work
    • sniffer, all you need to do is sniff one
      person with the knock and whamo you know it. Chances are the lamo that uses this isnt going to
      change the knock.. not ever (as he will prolly hard code the knock into his client app). So once
      you have the knock bam your done.. now just break his password..

    Security through obuscurity never works.
  171. Knock Knock by Anonymous Coward · · Score: 0

    .. whos there ?

    SSH

    SSH who .. ?

  172. Replay attack by AlexCV · · Score: 1

    Can anyone say "Replay Attack"? This is "secure" untill you use it. No better then a password, really. What's next, a cool feature in knock_proxy to implement a password to knocking-sequence pairing?

  173. This technique is OLD!!! by L0stm4n · · Score: 1

    This has been around for years

    --
    superman runs linux
  174. One-time knock sequences? by Shurhaian · · Score: 1

    Use an OTKS to open the port for a specific user, perhaps, and then expire that sequence, as with a one-time password?

    I'll shut up about it now, though, since I can't even get OPIE running right on my FreeBSD box.

    --
    NB: YMMV. IANAL. Take the above with a grain of salt.
  175. xringd by reidconti · · Score: 1

    Reminds me of xringd for dialup connections. Call the modem's phone #, let it ring the correct number of times, do it the proper number of times (iirc), and then hang up. The modem will dial the pre-set number. cool!

  176. Order, delivery of packets is not guaranteed by Dr.+Manhattan · · Score: 3, Insightful
    Since the client gets no feedback on whether the packets made it, there's no way to check if it worked except to see if the "magic" port has been opened.

    This system is going to be unreliable. No way around it. A single dropped packet and you have to try all over again. If you're really paranoid, like some have proposed, and disable the "knock monitor" temporarily if someone tries to connect unsuccessfully, it will also be horribly slow.

    If you use it on a LAN, maybe the net will be reliable enough, but then you have to worry about sniffers...

    --
    PHEM - party like it's 1997-2003!
  177. With complexity comes resource requirements... by danielrm26 · · Score: 1

    Many here have posted about how the complexity of the "knocking" challenges could be significantly advanced that it would be hard to brute force. Well, this is good and everything, but you have to consider that if you are on a high-traffic site, you don't want the server side to have to be spending a whole lot of resources on determining whether or not a constant stream of incoming SYNs are part of a "knocking" sequence.

    I imagine if this caught on there'd be technology to offload this burden onto, but until then it could be hairy for a site trying to do this with a complex challenge and a lot of incoming requests.

    --
    dmiessler.com -- grep understanding knowledge
  178. can you allow ports to be open to only some? by Anonymous Coward · · Score: 1, Insightful

    So what you're saying is...If Jim knocks and gets the open door...the door really only looks open to him. Everyone else sees it as closed (based on his IP address or something).

    Is it based on IP address? What if he's coming through a NAT at a college campus, lets say. Can I get at the open door if I'm on the campus too after he knocks?

  179. Make all services use an obfuscation "plug-in" by NotQuiteReal · · Score: 1
    The described scenario requires special tools already [e.g. the knock detector, on the server, and the knock generator, on the client]. If you are not going to do things in the standard way, you can do anything you want.

    This means you might as well set up your systems however you want, with regard to what services are on what port. But the services still answer the standard way. To get around this, what if all services had an easy way to change their inital behavior, e.g. accepted an optional plug-in or personality module front?

    The plug-in would be some code/script that follows an api that runs a little challenge-response game of the creator's desire.

    This user (admin) definable "hand-shake" could range from nothing (i.e. standard service as it is today) to something as simple as Service: I will act "standard" after I see the word "please" or as complicated as the plug-in writer wants to get [strong crypto, multi pass challange/response, hardware key tie-in, etc.

    The trick is to make sure plug-in [port listener] is secure - since this would be the object to be attacked. [rather than the current services].

    Basically, as has been noted, security thru obscurity, but "standardized" in such a way that it is easier to do, and therefore might get done more often. [but it occurs to me that those who care are already doing something...]

    I guess I just described a meta-service, huh? Then all your security eggs would be in one basket.

    If this is a patentable idea, send me money, thanks.

    --
    This issue is a bit more complicated than you think.
  180. Already set one up! by theendlessnow · · Score: 1

    Mine listens for 2,546,782 simultanaeous connections to port 80 within 10 seconds, then it opens up the back door.

    Try it at:
    http://slashdot-this.org

  181. other obvious extra layer by Danny+Rathjens · · Score: 1

    Is to simply use some iptables rules to only allow ssh connections from where you expect them from. For example, if you have live servers colocated somewhere then only allow connections from the ip block of your office.

    iptables -A INPUT -i eth0 -p tcp -s \! ip.of.off.ice --dport 22 -j DROP

  182. Mod parent up! by khasim · · Score: 1

    Excellent description.

  183. ah, quintillion by Anonymous Coward · · Score: 0

    but still really big.

  184. More layers by Jade+E.+2 · · Score: 2
    If you're really paranoid you could add layers like this for as long as you wanted...

    Require syns to ports A, B, C, and D, which opens port E where you have to send a password, which opens port F from which you must do an HTTP GET for /foobar.html, which opens ports G which when connected sends you the number of random port H, on which an anonymous FTP service is now running to which you must send a SITE STARTIT command then download the number of port I, which will be the SSH service once you've pinged the server 7 times with 42 byte packets. And to make it really challenging, you have maybe 10 seconds to complete the sequence. (Think a lot of terminals just waiting for you to hit 'enter'... The pings would take most of the time.)

    Oh, and if you do anything wrong after the first 3 ports are hit, you can't try again for 30 seconds.

  185. Even better by Sludge · · Score: 1

    You have to call a modem connected to the server. The number of rings defines whose login gets rewritten from /bin/false to their real shell (/usr/bin/perl!). There is a five minute window at this point for this user to log in using ssh.

  186. Checkpoint... by acaird · · Score: 1
    It's not quite the same, but it addresses the same problem... Checkpoint FW-1/NG has a feature where you telnet to a port, log in, and based on your login ID it opens whatever ports you are allowed to access - it basically adds a temporary rule to allow your IP to access that port. It will time out, or you can telnet to that high port again and "logout". Usin OTPs this is pretty secure, and leaves only one thing to need to really secure. I forget what it's called, but you get the idea. Anyhow, I have about 10% of the code for this done with OPIE and iptables, but will probably never finish.

    Does anyone even know what I'm talking about? :)

    --
    Power corrupts. PowerPoint corrupts absolutely. E. Tufte
  187. TCP/IP problems with this method. by Vellmont · · Score: 4, Informative

    Everyone has focused on the "does it make you more secure" arguments about this method. I'd be more interested in how it can be implemented properly since no TCP connection is being established using the knocks. I'd assume either a TCP SYN is being sent to the TCP ports, or the protocol uses UDP.

    The problem is of course that since no connection is being established, there's no guaranteed delivery of packets, and no guaranteed delivery of packets in the order they were sent. This could be very problematic across network connections that drop packets, and provide you no feedback as to why you can't open your connection. If only 10 % of my packets get dropped, and I require 10 "knocks", I only have .9^10, or 35% chance of my sequence getting to its destination intact. 5% packet loss would up my chances to about 60%. Increasing amounts of knocks decreases my chances of the sequence arriving intact.

    Is there a clever way to solve this problem, or is the reliability of it tied to a low amount of packet loss on a network?

    --
    AccountKiller
    1. Re:TCP/IP problems with this method. by Sigma+7 · · Score: 1
      Is there a clever way to solve this problem, or is the reliability of it tied to a low amount of packet loss on a network?
      The only way to get around this problem is to transmit each packet twice or more, and configure the host so that it drops the second packet (i.e. not count it towards the combination). And while you're doing so, use the UDP protocol instead of the TCP protocol - it gets rid of the error checking that isn't needed (or even looked at) for this sort of task.

      Based on what I see from documentation of this silly knock thingy, it does not contain *any* information on how it reacts to the unreliable nature of the internet. Because of this, the proper procedure is to assume the worst case scenario - it chokes on any form of failure, such as packet loss, repeated packets (which usually get dropped by the receiver), transposed packets (they can happen - TCP was actually designed for this), and mangled packets (line noise).

    2. Re:TCP/IP problems with this method. by tedhiltonhead · · Score: 2, Informative

      To solve the problem of packet mis-ordering, the client implementation could wait for the ICMP "Port Unreachable" message before transmitting the next knock. This is assuming active connection rejection by the server, rather than dropping incoming SYNs.

    3. Re:TCP/IP problems with this method. by quetzalc0atl · · Score: 1

      the most likely method of implementation would be as a kernel module directly (too much trouble, and wouldnt work for non-OSS system) or by using bpf called from the daemon to sniff for SYN packets to the necessary ports. once the "sequence" was received, it could then open the "real" port.

      a nice variation of this would be to use some time-based hash (such as something like secureid) to generate a different port sequence each time. this would diffuse the sniffing problem that oh-so-many slashdotters have already pointed out.

    4. Re:TCP/IP problems with this method. by jemfinch · · Score: 1

      The ports are closed. The SYN is replied to with an RST, and that's the signal to go to the next port.

      The daemon that opens the door is just reading the firewall logs, basically.

      Jeremy

    5. Re:TCP/IP problems with this method. by Vellmont · · Score: 1

      Unless of course your machine is completely stealthed and doesn't respond with any packets at all (as if there is not machine at that IP address).

      Your solution has the added benefit of not having out-of-order delivery problems. If you were to do what another poster suggested, and send multiple packets packets for each "knock", you'd need to implement a sequence number to determine the order.

      I think if this idea is going to go anywhere it needs to be standardized and well thought out. Unless it is it's just going to be a clever little hack and never really be very usefull. (Who wants to carry around hackish little scripts or programs with them to do the knocking?)

      --
      AccountKiller
  188. This isn't about making a machine more secure... by NoMercy · · Score: 1

    It's about blocking the gain of simple portscanners.. but I'd rather see a OpenBSD style system for linux, login via ssh and it allows you modified firewall rules to gain access to other systems, login securely then you can use IMAP/POP/etc.

  189. easy DOS? by Anonymous Coward · · Score: 0

    So if I just randomly attempt to connect to ports on your computer, you'll never be able to connect?

    Unless you correlate the knocks with an IP address. Is that what they do? Maybe I should read the article/code...

  190. This has been done. by Anonymous Coward · · Score: 0

    Old news. Very old news. Memories of the 90s come about.

  191. Knock, Knock, by MountainOfLight · · Score: 1

    on port 80....You're Slashdotted...

  192. Sniff the attempts .. by dindi · · Score: 1

    sure you cannot sniff ssh, but you can monitor the connections and log them .....
    connect to 2038, 6664, 5552,5543 and so on ... you just do the same ...

    of coz you gotta be on the same net (or sniffing on/near a router on the way)

    if you change the nocking sequence every time based on whatewer algorythm, it is much harder unless someone knows the algo :)

  193. Slightly different. by khasim · · Score: 1

    Because, with this method, a scanner might not see anything there.

    No large concrete block to even indicate that something might be there.

    Just a featureless plain. You don't even know if there is something interesting there. You don't even know if there is ANYTHING there.

    Statistically, you'd more often be trying secret passwords where there wasn't even a server to hear you.

  194. It's _not_ just another password... by jdreed1024 · · Score: 4, Interesting

    I see a lot of comments saying "Well, why not just have two passwords?". It seems that people didn't read the article (the first link is /.ed, the second is not). The whole point is that with this, until you knock, the machine appears as a closed machine. No ports open. All ports will simply drop packets on the floor, meaning that a hacker scanning your subnet will not bother with that machine. The machine essentially appears invisible until knocked. Even with the most secure system, the hacker can still see that you're running, say, sshd, Apache, CUPS, and a few other services. And if a buffer overflow was announced 5 minutes ago for, say, sshd, they know that they can attempt to exploit the machine, since they see port 22 open. If you are using Port Knocking, you can have a vulnerable sshd, and it's a hell of a lot less likely to get exploited since the cracker has no way of knowing that you're running sshd...

    --
    There is no sig, there is only Zuul.
  195. Stop complainin about "security through obscurity" by Tom7 · · Score: 4, Insightful

    God damn, if I hear one more of you go, "this is just security through obscurity!" I am going to puke. This is the same as cleartext passwords, which are pretty secure if (a) you know nobody is sniffing the network and (b) you know nobody is masquerading as the host you want to connect to. Of course those things aren't typically true, so this alone isn't very secure. But it does disguise your exchange which, contrary to what the security-through-obscurity folks are saying, does give you some small measure of security.

    This is just a way of encoding some bit transfer in the IP protocol instead of in the beginning of whatever protocol you're using after the connection. You could also use it to send cryptographic credentials which could be as secure as any other protocol (plus some extra security by obscurity). The only problem with that is that you need a way to send back information via TCP (because most good authentication protocols are two-way), but I think you need that anyway in order to serialize your knocks.

  196. I heard you knock... by Ghengis · · Score: 1
    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 implimenting it.

    I can... you packet-sniff while someone's going through their knock and just follow the port sequence. Once you get the magic knock, you're once step closer to getting through the door. Now with hundreds of people connecting at once, you'll just have to organize your packet-sniffing log by source, port, and time (just to make sure you do it fast enough). This just gives the script kiddies something else to look for with their scripts.
    --

    "The best laid plans of mice and men gang oft agley..." - ROBERT BURNS

  197. Wasteful Distraction by potus98 · · Score: 1

    In general, security through obscurity is a waste of time. Similar to moving your "secret" webserver up to port 8888, it may buy you a *tiny* bit of "security" by being slightly tougher to find, but these types of configs don't fundamentally improve your overall security.

    My biggest fear when I hear of these stories is that your typical sys-admin will spend 4 days implementing secret-knock perl scripts and then return to the life of surfing pr0n, ignoring log files, applying patches once a quarter, and writing long-winded /. posts.

    --
    This one gang kept wanting me to join cause I'm pretty good with a bo staff.
  198. Semantics! Obscurity and Security are different. by mr_pins · · Score: 1, Insightful

    Yes, all secrecy is obscurity in some sense, but there is an important distinction to be made between two types of obscurity. The fact that a port knocking scheme consisting of, say, 10 knocks is being used is one peice of information that someone would have to know in order to be allowed in. What the sequence of ports to knock on *actually is* is a second peice of information. These two peices of information are of very different types. What is the chance that the first peice of info can be guessed? Impossible to say. What is the chance of guessing the second? Simple. It's one over the number of ways of choosing 10 ports from the set of all ports. (NumPorts!/(NumPorts - 10)!) The security provided by the obscurity of the first peice of info is unquantifiable. This is what is typically call 'Security through Obscurity'. The security provided by the the actual password (or whatever you want to call it) is a calculable, knowable quantity. This is real, scientific Security, as opposed to just having a feeling that it is 'unlikely' that someone will guess you are using port knocking, or whatever.

  199. even better by Anonymous Coward · · Score: 0

    Have an incorrect knock give them the goatse guy. That'll learn 'em!

    In soviet russia, ports knock on you!

  200. STOP KNOCKING SO HARD... by NumbThumb · · Score: 1

    ...it's already /.ed. Congrats;)

    --
    I have discovered a truly remarkable sig which this 120 chars is too small to contain.
  201. This is nothing more than a password by Captain+McCrank · · Score: 1
    If you need to implement security, you need to utilize authentication methods like a PKI infrastructure. When you log on to most systems with very minimal security infrastructure, you present something you have- a user account name, and something you know, a password.

    A password doesn't have to be a series of upper/lower/ascii characters that do not form a word. It can be something like a bird call or a series of "knocks" as in this method. Is this useful? It certainly adds complexity to the attacker's problem. Instead of blindingly hitting a target, they'd need to do some kind of man-in-the middle attack to determine what this UNENCRYPTED password is.

    A better approach is to abandon this kind of cleverness and never use the word "Password" again. A passphrase that's greater than 14 characters is far superior to any obfuscation or password complexity. It beats shoulder surfing, you can't bruteforce it and you're unlikely to find the right combination of words in a dictionary for every random human being in this world. Stop the password madness! Evolve ye damn slashdotters!

    That's not my passphrase, I swear.

  202. Re:Not not good by _bug_ · · Score: 1

    That would just create a new variant to DOS attacks. Instead of taking you offline, they just persistantly knock on random ports, thereby disabling your ability to communicate with trusted sources.

    The first point to make is this is no different, in terms of the resources required to perform such a DOS, as the situation is currently. This is a non-issue because it's already an issue with or without knocking.

    There are all sorts of tricks to use that would keep the knocking daemon from chewing up memory such as any invalid knocking attempt makes the daemon sleep for X seconds. Or only the last 5 IP addresses that tried to knock have their knocking history recorded, so only a minimal memory footprint is made by the knocking daemon.

    Second point, someone has to know enough that a knocking daemon is on a particular machine before they can start brute-forcing it. Otherwise an attacker would be required to try and brute force knock every server online. Care to think of the logistics of that?

    Also, if no ports are accessible without knocking, a machine with a knocking daemon is going to appear to be dead. Why would someone "brute-knock" a dead IP address?

  203. Secret handshakes by s4ltyd0g · · Score: 1

    Don't let root login via ssh and use key exchange for autentication. Who needs another secret handshake?

  204. Man in the middle. by Captain+McCrank · · Score: 1

    Switched networks will only work if you ahve good physical security and vlans implemented. Otherwise Captain Blackhat is coming onto your campus with a MAC spoofer and will have this beat in no time.

    1. Re:Man in the middle. by Catskul · · Score: 1

      ... And then of course you have to make sure "Captain Blackhat" doesnt standing behind you watching your keystrokes...

      Obviously this port knocking technique doesnt work.

      --

      Im not here now... Im out KILLING pepperoni
  205. will it ever happen? missing client support.. by perler · · Score: 1

    the problem is, you would have to enable the clients (ssh, ftp (which means for instance dreamweaver's ftp code) etc..) to use it on a public system. and the public systems (i.e. webservers) are the systems we need this on, because they are the targets of the crackers..

    so, good idea, but will it ever happen?

    but IF it happened, i could think of methods to use it like we use passwords today. translate the knocks into letters and these build a password, a meta-passowrd in this sense..

    sounds cool to me..

    PAT

  206. The port knocking default sequence by enrico_suave · · Score: 1

    It should be "Shave and a Haircut, 2 Bits"

    Does this remind anyone of Close Encounters if there was some musical visual interface to manually select the port numbers/sequence?

    *shrug*

    e.

    --
    Build Your Own PVR/HTPC news, reviews, &
  207. In Khazad-dum by ThousandStars · · Score: 1

    Or, if the the door leads a massive mine/homeland built by dwaves, one could make it visible only in moonlight, and inscribe the password as a riddle in Elvish. A suspicious person might try numerous spells of opening before realizing that the obvious equivalent of username:admin password:secret is the key.

    I'm sure this bad computer analogy could be extended, but I'll stop now.

  208. I'm appaled nobody has mentioned it! by Anonymous Coward · · Score: 0

    Come and knock on our ports,
    we've been waiting for you.

    Cuz this port is hers and hers and his, this port knock's for you!!!!!

  209. Heh. by Anonymous Coward · · Score: 0

    You said "port knocking".

  210. Individual knocks? by crawdaddy · · Score: 1

    I've read some people saying that a malicious user could simply sniff the network and determine the key. I don't see this as a major problem, though. You could set each machine to have its own individual knock, requiring an attacker to also spoof a machine who's knock he's discovered. Again, this could be complicated by having some sort of function that defines legal knocks, but that generates so many that each knock can only be used once...a sort of one-time pad for the knocks. This would assume that you have a secure method of trading the knock lists (flashback to Mission: Impossible's "NOC-list"...heh). I'm sure there's some sort of encryption scheme you could setup based on the time that keeps a sniffed knock from being able to be used again, but that can also be dynamically generated by any machine attempting to connect to the server. I think this assumes a little bit about the topology of the network. I'm sure it could be tweaked for most setups, though.

  211. Spare a SIG by Anonymous Coward · · Score: 0

    ...here you go:

    ~/bin/gensig.pl

  212. IP-based authentication by Short+Circuit · · Score: 1

    The funny thing is, why open up ports in a general fashion? Why not just open up those ports to connections from the IP that knocked?

    1. Re:IP-based authentication by WNight · · Score: 1

      Exactly. And have the sequence be at least based off of time, if not the originating IP and a password. (MD5 all of that, use the hash to determine the sequence.)

      And if you detect a DoS attack, you do exactly what you do right now. Drop everything from the offending host. Except in this case you'd want to drop it before the sequence-finder program ran, to give it less crap to look at.

      And of course, any access to a port not in the sequence, or out of place, resets this and you have to start again after a timeout. That way a few linear scans won't open any lock.

  213. Missing the point... by Anonymous Coward · · Score: 0

    All the "sniff and replay" comments here are missing the point. Of course if you just set it up so that a knock on ports "5432 2272 8787 3456 ..." (of whatever length) could easily just be sniffed and replayed. Thats trivial.

    However, imagine if you implemented it with an algorithm on the server (or NAT/firewall box) that used a "password" seed, in combination with something temporal (like today's date and the current hour. Or even better, something even more obscure like yesterday's closing price of MSFT...) in order to generate the specific sequence of ports using a cryptographically secure hash method. Then when you want to (say) open port 22 on the firewall (only for the IP you are connecting from of course), you use a little client program (that you carry around on your USB memory key or whatever) and the password to generate the knock sequence to use on the fly.

    As the referenced site mentions, this was discussed and even implemented in a very nice Sysadmin article some months ago. Without access to the "knock sequence password" AND the details of the specific algorithm in use, I cant imagine ANY way of brute forcing it.

    Obscure AND secure. Even better. ;-)

  214. It's not just obscurity... by NumbThumb · · Score: 1

    ...it's more like plain-text-auth:

    you submit a 5x16 bit password (4 knocks in a 16-bit range of ports plus the actual connect to the correct port). By forcing a 1sec delay between knock-sequences, one would need 2^80 seconds to brute-force it... that's 28334786263782000 Years if i didn't mess up. You can add some more bits by including the TCP-Flags required to be set for knock-packets, etc...

    However, anyone sniffing your traffic could find out in a snap.

    And no, it's not revolutionarry. But its nifty!

    --
    I have discovered a truly remarkable sig which this 120 chars is too small to contain.
  215. this is more than obscurity by chanceH · · Score: 1

    this is not just security through obscurity. this is also more/different key.

    two ways to get 0wn3d r:

    1) they know your key.
    2) they know how to not need your key.

    there is some obscurity to this, but if instead of closing the "knock" ports, you instead replied with "successfully knocked on port 9834" (for all your unused ports), and sent them a link to this article, you still have gained extra key bits.

    In the face of (2), however, you are much better off. They have to be clever enough to defeat your sshd and the knock protocol at the same time.

    I'm thinking diffie-helman carried out using the port numbers that you try to hit as the transmission channel could be kind of cool. not sure if it useful, but it would be cool.

  216. Why monitor Firewall Logs? by underworld · · Score: 1


    Would there be an advantage to using a modified sniffer agent on the firewall to detect the sequence?

  217. new mod code by Anonymous Coward · · Score: 0

    I think we need a new mod code. -1 grammar. You'd get a -2 grammar for consistent misuse of the word then.

  218. Shared Secret by Doubting+Thomas · · Score: 1

    This is a pretty poor shared secret. For one, it can easily fall prey to a simple replay attack. If you're going to turn away connections based upon them not knowing the secret handshake, you'd be better off incorporating some sort of challenge-response directly into the TCP connection handshake instead, wouldn't you?

    Sticking a small cryptographically hashed payload onto the SYN, SYN_ACK and ACK packets would seem to give you better security.

    --
    Just because it works, doesn't mean it isn't broken.
  219. Simpler Implementation by John.P.Jones · · Score: 3, Interesting
    You could, more simply, have your little script listen for messages (UDP) sent to port x. If the message has the following form.

    "open port Y for ip Z using key K"

    if the port opening policy accepts this command then it is opened otherwise it is not. Better yet 'REAL' crypto could be used to protect the ports. Fore example...

    "open port Y for ip Z @ TIMESTAMP" Encrypted by K.

    This simpler implementation (more likely to be correct) will provide equivalent security.

  220. Easy way around that... by ArthurDent · · Score: 1

    So after n unsuccessful knock sequence attempts from a particular IP, you start to ignore the IP. So you might get slammed for a while, but after a while the machine would wise up.

    Kinda like a secret club, except you know who's on the other side of the door! ;-)

  221. Next up on KEXP... by KermitAndLadyHoliday · · Score: 0

    Stevie Ray Vaughan's lost single

    "Well...The port is a rockin' don't bother knockin'
    Yeah...The port is a rockin' don't bother knockin'
    Yeah...The port is a rockin' don't bother come on in"

  222. Hrmmmm... by TheConfusedOne · · Score: 1

    DOS = Denial of Spirits?

    Though in deference, the FBI didn't so much knock as kick the darn door in.

    --
    --- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
    1. Re:Hrmmmm... by Babbster · · Score: 1

      And it wasn't so much the FBI as it was the Treasury Department's Prohibition Unit (which later became the ATF we know and love today).

  223. Still vulnerable to packet sniffing by me.nick() · · Score: 3, Interesting

    This is a great way to hinder people from randomly picking to hack your box by scanning for open ports. However, if someone is dedicated to hack YOU specifically, they could still use a man-in-the-middle attack, sniff the packets to see which port sequence you were using, etc, etc.

    Of course, there really is no way to block a skilled hacker who is intent on breaking into a specific network/box by any means necessary.

    1. Re:Still vulnerable to packet sniffing by BigBadBri · · Score: 1
      With sufficient work, it could be possible to construct a client and server that operate on a more complicated level, perhaps by creating some hash of the last 10 packets sent by the client before the close, and generating knock sequences for the next connection based on this information.

      This wouldn't be absolutely safe against a man in the middle attack, but it would make a simple attack based on packet sniffing more difficult.

      Introduce a shared secret into the equation, and this should be proof against most hacks.

      I think it's a pretty neat idea, but then I like the thought of dynamically configured firewalls.

      --
      oh brave new world, that has such people in it!
  224. Hiding SSH behind a webserver by Anonymous Coward · · Score: 0

    I don't know if anyone has tried this. I haven't really researched it. But a friend and I implemented a rather interesting device based on the fact that when you connect to a webserver you send data first. If you are connecting to ssh you wait for the server to init the conversation. So bascially when you connect to the port if you imediatly send it forwards you to the webserver, if you wait for a predetermined time it sends you to the ssh server. Very handy for getting around the companies policy of not allowing ssh inbound. I don't necessarily think this is secure, but to the casual observer the port will look and act like the a webserver. And it is out there if you care to try and find it :)

  225. Communication by loadquo · · Score: 1

    If this becomes common and there are lots of people trying to knock, you could send messages by knocking.

    E.g. knocking at ports 99, 97, 116 could be the word cat.

    Properly encrypted it would be hard to tell if you were knocking or communicating. Probably only useful for short messages though. Unless knocking was continuous to obfuscate when true knocking activity.

    </tin foil hat>

  226. Nice system by verbatim_verbose · · Score: 1

    It's unfortunate that the code there is only for ipchains and not iptables, which leaves many Linux users out in the dark...

  227. generate based on username/password? by Heisenbug · · Score: 1

    I'm not cryptowise enough to know how to implement this, but since the goal is to foil portscanning, it's fair to assume that the attacker does not know a valid username on the machine. Suppose you built this into the ssh client, such that it would generate the portknock key as a one-way hash of your username? The server then has to check the portknock against valid knocks based on the login accounts on that machine. The whole process becomes entirely transparent to the user, while still utterly foiling portscans. Are we happy?

    The more direct path would just be to add that username hash as the initial connect string, so the ssh server doesn't respond unless it's valid. That skips the whole complicated portknock thing, which is kind of clunky, as cool as it is.

  228. What about when you are actually connected? by vlauria · · Score: 1

    Even with this knocking sequence in place, as long as you have 'knocked' and are connected to the host, the comptuer can still be port scanned.

    1. Re:What about when you are actually connected? by jeffclough · · Score: 1

      Presumably, the host running the service in question will stop listening after a few seconds, after which port scanning will reveal nothing. Of greater concern is this method's vulnerability to sniffing. Patterns of "connection refused" responses would be a dead give-away. And if any of this is happening over a wireless network, it just makes sniffing that much easier. While I certainly wouldn't call the use of a port knocking mechanism pointless, I also wouldn't rest all my security-related hopes and dreams on this technique.

      --
      -- Jeff Clough, Humble Programmer
  229. Timing... by Anonymous Coward · · Score: 0

    The random # of ports is great, but the suggested timing limitations could be an added dimension to the security scheme. It was suggested that the combination should be received within a certain amount of time, or the sequence would be negated. There could be a min and max time limitation, say it could be required that the sequence finish within 3-5 seconds. This could slow any brute force attempts to a crawl even with a shorter combination of ports. If it were able to be even more specific the time between knocks could be measured... Think of it like "knock ... knock... knock-knock-knock... knock-knock."

  230. Old tech by Allnighterking · · Score: 1

    First time I saw this implimented was about 95 on a BSDi system. The concept and availability of this isn't anything new. The first discussions I heard where in the late 80's, and those where stories about mainframe systems on ArpaNet. Talk about old news *grin* The perl implimentation my be new code but the methodology isn't for sure.

    --

    I'm sorry, I'm to tired to be witty at the moment so this message will have to do.

  231. Re:LAST POST IN THIS THREAD GETS 10 DOLLARS by Anonymous Coward · · Score: 0

    No, I am teh winner!!11~~

  232. All the time the same arguments by phoenix321 · · Score: 5, Interesting

    This is security by obscurity, but it is useful. Don't repeat this mantra just because "the experts" say so.

    Since some still don't understand its use, i'll be speaking metaphorical:

    Assume you need to have a special key to open a certain otherwise secure door. OpenSSH might be that door and your passphrase and your certificate are the key.

    An attacker can still forge the key or attack the lock with a different approach, picking etc. - comparable to "social engineering" to get the password, brute forcing or exploits.

    And that port knocking sequence now effectively hides the lock, leaving an attacker without a first approach to pick or break the lock. It just adds another layer of security. You just don't know where to start your attack. You can't use exploits, you can't try brute force - nothing, heck you don't even know what type of daemon your target is.

    A clean stainless steel door with a covert RFID-detector one square inch in size, hidden somewhere, sure as hell beats the same door with a clearly visible lock. You still need to pick the lock, but you can't poke your lockpicking tools into solid steel and you can't crack something you cannot discern.

    --- Still one addition to say: having a machine connected to the internet with no ports open makes you a prime suspect for the port knocking scheme.

    A good stealth scheme may be implemented, so a potential attacker (excuse for this metaphor again) does not even see the door (or the building, for that matter).

  233. Use both. by gd2shoe · · Score: 1

    Not a cure all, but every little bit helps.

    --
    I won't join Slashcott. OTOH, If Beta goes live, I just won't be back until it's fixed. Sorry Dice.
  234. Stupid by KidSock · · Score: 1

    This is stupid. Why not just send some little blurb of out-of-band data 'open-says-me'. Why go through the whole sequence? Even a benign looking sequence of HTTP requests would be better.

  235. Is this an effort to be stupid? by Anonymous Coward · · Score: 0

    The man in the middle can sniff the port knocking and replay it just as easily (ok, much easier) than the actual mitm attack itself. All this does is make douches who are too fucking stupid to learn what "security" means feel smart. If someone is dedicating the time and resources to attacking you specifically, this is useless. If you are just trying to protect yourself from script kiddies scanning vulnerable daemons to 0wnz, then just patch your machines. Wow, that was tough.

  236. multiple ipaddress knocking by tlahoda · · Score: 1

    What if you were to set the port knock up so that you had to connect from different known ipaddresses in the same knock sequence instead of just someone knocking from one? I would help a bit, kind of like the secure submarine communication system where you used the echoes created by the presence of the water to basically encrypt your message. Anyway just a thought.

  237. Port-knocking implementation by F.Z.Bunny · · Score: 1

    There is a slightly different implementation of Martin Krzywinski's port-knocking idea available at: http://doorman.sourceforge.net

    --
    --- There is no bun but Bun, and Fuzzy is His prophet! Bunbun akbar! ---
  238. An unsniffable suggestion by TopherC · · Score: 1

    I like an idea posted earlier of using a single port to knock on, that looks for a certain key signature in the first packet. This can be sniffed more easily than a port-knocking sequence, but...

    If you don't have too many users on a system, you could use a key sequence. Each user would be given a key generator, which generates a near-infinite number of keys in a certain sequence. The host system would be looking for a particular key, and its matching key generator would then advance once it's been used.

    This system would have to be used with a single-port type of access because a client requires a simple (trinary) response from the server. The response can be either "used already", "wrong", or "right". The client then tries keys in turn until it receives the "unused" signal, at which point it connects on the desired port. If there were a lot of active users of the system, this process might take some time. If the only server responses were "used already" or "unused" (wrong or right), then a client could get permanently off track if packets were lost because it would not know that it went beyond the sequence.

    This system might still have problems with simultaneous logins. And it is "opening up" an additional port. But I can't think of any way that the knocking port alone could be used for a remote exploit. One could also abuse this system if one could selectively block transmissions both ways. I don't know if that's possible or not.

  239. Getting complicated by mnmn · · Score: 1

    Its just adding another layer that can get broken. This is not in the spirit of keeping it simple stupid...

    Of course keeping a port closed is assuming the daemon behind it is insecure. Keep a secure daemon and thats far simpler than a port-knocking structure in the kernel.

    --
    "Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
  240. it IS more secure... by Anonymous Coward · · Score: 1, Insightful

    here is why. the first point of entry or attack for ANY attack HAS to be either a) a port scan to find running services, or b) a network sniff of your traffic to find traffic related to running services. The latter (b) is much more difficult than the former (a) due to having to 0wn an uplevel device in your traffic stream to sniff your traffic. Also, with the popularity of switched networks, sniffing is more and more difficult. Since B is much more difficult than A, A is the initial point of attack for most attackers. This method eliminates A as an initial point of attack, but ONLY FOR PRIVATE SERVICES like SSH. In the case of a paranoid techie (us) who wants NO services exposed, this is a nice way to hide our SSH sessions. However, in reality it is only marginally more secure than using a pub/priv keypair for SSH.

    1. Re:it IS more secure... by Anonymous Coward · · Score: 0

      What about using two entirely different networks
      (a good use for the unused dialup!), and use
      the knocks on one network(say dialup) to activate
      the ports on the other (ADSL). Unless someone
      could sniff "BOTH" the packets(ie. have physical
      access to your telephone line before the CO),
      and unless the DNS is not hijacked, it could give
      a severe headache to any potential hacker.

  241. Well not THAT new by Anthem.uxp · · Score: 1

    Actually this has been covered on LinuxSecurity a while ago. And the implementation is apparently usable.

  242. about those knockers by frovingslosh · · Score: 1
    If the order of the knocks is important, how do you get around that there's never a guarantee in what order network packets arrive?.....

    Sure, while you don't have a guarantee that the packets arrived or the order in which they do, the truth is that in a real world situation most packets will arive and will arive in the proper order, particularly if they are sent with delays in the order of several hundred milliseconnds or more (that is, several tenths of a second or more). If somehow the knock doesn't go through, you knock again. If you still fail then you likely don't have a good enough connection for reliable use anyway. Obviously there might be some exceptions to this (like a web server connected to a cell phone), but in most cases dropped and out or order packets would not be an issue.

    That said, I do agree with the post that made the point that anything that can be done by port knocking can generally be done better with information sent on a single port.

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re:about those knockers by Tony-A · · Score: 1

      anything that can be done by port knocking can generally be done better with information sent on a single port.

      Right, but the advantage of port knocking is that the single port doesn't exist until the secret knock is given. Something as simple as three ports, spaced one second apart, opening the real port 3 seconds later would be extremely time-expensive to brute-force, particularly if source-ips are black-listed for wrong sequences.

    2. Re:about those knockers by frovingslosh · · Score: 1
      Right, but the advantage of port knocking is that the single port doesn't exist until the secret knock is given.

      How can you calim that the single port doesn't even exist until something happens on the other ports? All of the ports are considered either closed or stealth until the knocking happens, it's only a special sequence of packets that opens the target port to a normal application. They either all exist or they all do not. It hardly matters if what is in the magic sequence of packets that causes the desired port to open is a set of port numbers and some time delays, or other information in the packet (send me a UDP packet, two TCP packets, then two UDP packets and finally wait 3 seconds and send me a TCP packet, all to the same port, and I will open the port with the expected application for your IP address, for example). And this is a very simplistic example; there is a lot of information that can be sent in the packet, even without getting into things like spoofing. Knocking is a cute idea, but in reality it adds complexity when there are NAT routers in the system, and that complexity really isn't needed. There are plenty of other ways to acomplish the same thing by changing other parts of the packet than the port number.

      In reality, there is one TCP/IP stack. The port number is just a software abstraction on where to send the data. Knocking with different port numbers is no better than knocking by changing other data in the IP packet. But changing the port nuumber does make knocking this way harder if the device is behind a NAT router. (and most routers would not support very many applications with many port numbers in their knock sequence, while if other techniques were used that depended on a single port, then any reasonable number of servers could be behind a NAT router).

      --
      I'm an American. I love this country and the freedoms that we used to have.
    3. Re:about those knockers by Tony-A · · Score: 1

      I would assume that you put the door knockers on the outside of the NAT box, not on the inside.

      One practical use would be to forward port 80 to the proper internal server based on the prior knock-sequence on the firewall.

  243. gettyps by Michael.Forman · · Score: 3, Informative


    Kris Gleason implemented a similar scheme in his gettyps code back in the 90s (it still available and in most distributions). For the "knock" one would dial into a modem (or any serial port) and let it ring a specified number of times. If the right number of rings was received before disconnect, gettyps would allow the next call to connect.

    Michael.

    --
    Linux : Mac :: VW : Mercedes
    1. Re:gettyps by tiger99 · · Score: 1

      Funnily enough, I know some people who do that with their telephones, to block double glazing salesmen and other callers they don't want, by simply not picking up the phone on the first set of rings. It is not specific to computers, in fact it has probably been used since before computers were invented, but nor is it foolproof, although it does get rid of a useful number of unwanted calls.

  244. Invisible until the first dropped connection by sakshale · · Score: 1

    The one positive I see for this tool is that the host would be invisible to most scanning tools as all ports are closed until the correct port sequence is sent... On the other hand, the fact that the port stays open until another port scan sequence is sent leads me to suspect that a dropped connection could leave it fully exposed anyway. So, is it worth the time and effort? I suspect not.

    --
    For every problem there is a solution that is simple, obvious and wrong.
  245. Much better ways of handling it. by Harik · · Score: 1
    Examples given from a linux viewpoint.

    use iptables -j REJECT <port-unreachable> on ssh.
    Run a UDP server on a wierd port. To get in, send your current IP + timestamp signed with a RSA/DSA key. If the signature is incorrect, forge a port-unreachable packet back (so it looks like a closed port) If it's correct, reply with a signed challange using server-timestamp, requestor-timestamp and a random value. Requestor answers the chalange, and the server adds an allow rule to iptables.

    This is safe from replay attacks, window-of-opportunity attacks (it only allows your host to the port, not everyone) but may be/probably is subject to MitM attacks. (Anyone along your route can watch you open the port, and after you succeed hijack your IP then attack SSH)

    Still, that's infinitely better then a fixed cleartext password that opens the door to EVERYONE, which is all that the stupid "knock" is.

  246. How about knocking after the connection instead? by SnarfQuest · · Score: 1

    If you looked for knocking after a service is connected instead, and drop the connection if the followup knocks don't occur within a short time, it could really frustrate the script kiddies.

    They get a connection, then immediately lose it. They then need to decide if it a network problem, a problem in their script, or something else? Might keep them busy trying to 'debug' their code for a while.

    --
    Who would win this election: Andrew Weiner vs Andrew Weiner's weiner.
  247. what about sockets by mslinux · · Score: 1

    I recently wrote a test DDoS script that used sockets to communicate between the master and slaves. Portscanners (like nmap) never showed any open ports even when the socket script was running on the slaves... waiting for commands. I'm not an experienced, low-level network programmer, so I can't explain exactly how this works, just know what I saw... two programs exchanging commands through network sockets with no ports open.

  248. B&B by jafiwam · · Score: 2, Funny

    Butthead: "Uhhhha, I am gonna emale you....in the butt.

    Beavis: "Shutup! Port-knocker!

  249. That's great. As long as SSH is secure. by khasim · · Score: 1

    "The point the grandparent is making is that you shouldn't be running insecure services on a public interface to start with."

    But you will never know whether any service is insecure or not. Even SSH has had vulnerabilities.

    http://www.nwfusion.com/news/2003/0917certwarns. ht ml

    "Security through obscurity is never a good choice."

    No, that isn't "security through obscurity". "Security through obscurity" refers to hiding how something is done, not the password (in this case, the knock sequence). The method for port knocking is known. What is not known is the password.

    "The only thing a port knocking scheme is good for is for concealement -- hiding the fact from a port-scanner that a port is open."

    It hides the fact that a service is running on the server by keeping the port closed until the password is issued. What's wrong with concealment? If they can't scan you, they probably won't try to attack you.

    "This makes is much more valuable for grey-hat and black-hat scenerios than it does for legitimate purposes."

    Rather, it makes it much easier and safer to remotely administer your machine than running that service with that port open.

    "If all you want is secure remote access, a properly configured SSHD on port 22 is secure enough."

    I've already shown that SSH has had vulnerabilities. You should not believe that SSH is secure.

    1. Re:That's great. As long as SSH is secure. by Tassach · · Score: 1
      I've already shown that SSH has had vulnerabilities.
      Yes, it has. The hole you refer to was found and patched 5 months ago. Notice that I specified "PROPERLY CONFIGURED". Proper configuration includes applying security patches promptly. Even without the patch, a chrooted configuration would have limited the damage to denial of service at worst. IPWrappers and IPTables are two other elements that should be used to restrict access to a critical ssh instance.

      OpenSSH is one of the most well-audited pieces of software around, and as you noted, it still has some holes. Installing port-knocking software might guard against a hole in SSH, but it also opens up the possibility for a new hole in the port-knocker itself. While defense in depth is a good thing, adding additional layers also create the opportunity for new holes, especially when the new layer is unproven and experimental.

      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
  250. Knock the wall down by moo083 · · Score: 1

    What would happen if you knocked on every port within a certain range (like 100 at a time or something) simueltaneusly and knocked 10 times or something?

  251. about those knockers by frovingslosh · · Score: 1
    Any good admin knows the most secure system is one that is listening on as few ports as possible.

    Good point, but it's important to remember that a port doesn't really exist, it's only an abstraction in the TCP/IP stack anyway. So if we are talking about a computer "actually connected directly to the Internet", it makes little difference if the secret handshake to access a service in a computer as accessed by an order of packets received with different port numbers, or with different packet types sent to the same port, or by any other identifying data in the packet.

    With more and more devices behind NAT routers, this distinction does start to matter. Unless the router knows about the knocking, this system has problems that a single port system would not have. On the other hand, if port knocking (or any other sort of identifying handshaking) was built into the NAT router, it could do a great job of idetifying authorized users and switch them to the proper system on the local LAN, which could then run with common software that did not need to be programmed to deal with the knockers.

    --
    I'm an American. I love this country and the freedoms that we used to have.
  252. Relax, Spelling isn't all that important anyway. by w3svc_animal · · Score: 1
    According to a researcher (sic) at Cambridge University, it doesn't matter in what order the letters in a word are, the only important thing is that the first and last letter be at the right place. The rest can be a total mess and you can still read it without problem. This is because the human mind does not read every letter by itself but the word as a whole.

    see the rest of the details HERE

    --

    Error encountered in IAWebSig.clsSig.Create: Last Procedure: sPrc_Ins_tblSig

  253. How do they attack it? by khasim · · Score: 1

    Okay, if it is insecure, how is it attacked?

    "The only real use for this is hiding the existence of ssh, if for some reason that is important to you. After that you can use ssh to hide everything else, since that is effective against sniffing."

    Or any other service that you don't want to be open to attack. Although running any other service through SSH would be a good idea.

    1. Re:How do they attack it? by kiolbasa · · Score: 1

      The attack depends on the bad coding. Yes, even ssh, designed for security, has had security problems from some bad coding. Who's to say our port-knocking program is immune to problems?

      One mistake I can imagine: the daemon stores the "knock" sequence in a static buffer, then a subtle logic error, timing error or race condition in the code introduces a case where it will accept an infinite sequence without flushing that buffer, overwriting something it shouldn't - a classic buffer-overflow exploit. Even though you can't "see" the port-knock service running, you can still run the exploit against random IPs until you get a live one.

      Is the port-knocking problem so easy that it can't be screwed up? I would argue "no."

      SSH can be vulnerable to the same things - the point is you have to have something listening to the outside world if you want remote access, so either way you have to choose software that you trust. It's your choice to choose port-knocking.

      Though there are reasons you would want to hide ssh from port scans (say, your ISP doesn't like it) mitigating undiscovered exploits in services isn't one of them for me.

      --

      Beer wants to be free
  254. Re:Not not good by glpierce · · Score: 1

    If the knocking daemon 'goes to sleep' after invalid knocks, you're in bad shape. I wasn't saying it would be a DoS, I said it would be DoS-like. Basically, if you stop listening whenever someone gives the wrong knock, they can just keep knocking and you'll never be able to let anyone in.

    --
    G
  255. can't think of a pragmatic use case by doneWithMyTattoo · · Score: 1

    Howdy, This is a weak authentication door in front of a (hopefully) strong authentication door. So why have the weak door? All your security resides in the strong door. Is there a cost savings for putting up the weak door to wead out the bulk of script kiddie/robot scans? Maybe it would make you less suceptible to DDOS attacks aimd at the strong door. But to put up the weak door, you are already conceeding that you are not 'popular'. So bottom line for me is ... I don't see a valid use case for this. But on the other hand, the world is a shockingly diverse place and maybe there is someone out there with a valid use case I just don't see.

  256. I did this about 5 years ago by Skapare · · Score: 4, Interesting

    I did this about 5 years ago. But my method was a bit different. Instead of using port numbers to contain the information (and that's all it really is, is just information), I sent a single UDP packet, with a source port of 53 (so it looks like a DNS answer), formatted like a DNS answer, that contained the information in the DNS answer data. Then it opened the SSH filter for that IP address to come in (I did it for 5 minutes, not 10 seconds). It still had to fully authenticate via SSH, so even if someone sniffed my DNS packet and tried to fake it, they could at most have a locked door to jiggle the handle on. Next time I do this, it will be to generate an MD5 checksum from the client IP and a secret salt, and send that as an IPv6 address in the packet. Then it can't even be faked from some other IP address.

    --
    now we need to go OSS in diesel cars
    1. Re:I did this about 5 years ago by asyky · · Score: 1

      this sounds like a much better idea imho. since with the port knocking idea a client stuck behind a firewall blocking the knocking ports would be fairly stuck.

    2. Re:I did this about 5 years ago by Anonymous Coward · · Score: 0

      What if you, on top of port knocking, added packet sizes. This would work for pings. You could have specific ports to knock along with a specific packet size. I dont know about sniffing, so does it track packet sizes as well as port numbers?

      Anyway, it wouldnt be hard to implement. You could create a program or even a batch script. That would increase the BFC time to "Hahahahaha. NO!" instead of 150 (?) years like someone else posted.

  257. Counter Proposal: Port Traps by henrypijames · · Score: 5, Interesting

    What if I turn this whole thing around and install fake services on a number of ports?

    For example, whenever you make a connection to a port between 1025 and 2048 on my system, you're greeted with "OpenSSH ...", and prompted to authenticate. But only behind one among those 1024 ports is the real SSH. On any other port, the fake service takes the username and password you've entered, wait a few seconds (just idling around), and tell you "Authentication failed". If you try too often to connect to faked services, you're put on the black list to avoid DOS, of course.

    1. Re:Counter Proposal: Port Traps by Mipmap · · Score: 1

      Ah, but what if it's a DDOS attack?

      Where each attack is from a different host? With 1024 hosts each attacking one port, 1 of those hosts will succeed.

      Harder, but not foolproof.

      Still a good idea though, "honey ports".

  258. Barnacle Bill the Sailor by Anonymous Coward · · Score: 0

    Who's that knocking at my port,

    Who's that knocking at my port,

    Who's that knocking at my port?

    It's Barnacle Bill the Hacker

  259. working example project by apachetoolbox · · Score: 1

    http://cmn.listprojects.darklab.org/

    works great so far...

  260. Why not use a listening socket on UDP+encryption? by jelle · · Score: 3, Interesting

    This is a neat trick, but it does not really increase protection against targeted attacks.

    It really is nothing more than a password to get access to the front gate... When somebody eavesdrops (sniffing), they will know the passwords, thus get access to the gate. They can sucessfully detect the knocking sequence because it is followed by a successfull ssh connection (duh!).

    The password is this 'secret sequence' in this 'port knocking'. Why not just use a daemon that listens on a UDP socket for a packet with an encrypted password in its payload? The payload could even be an RSA-signed and/or encrypted request (that includes a timestamp). That would be unscannable too, because UDP is connectionless, and be a lot more secure because of the real encryption/protection of the request data (the server can verify the identity of the sender of the request from the RSA signature, and can deny the request if one was made earlier with the same time stamp, twarting even sniffing of the UDP packet).

    Except for not having the ssh daemon 'connected' to the internet at all times and thus evading many port-scanning worms/scripts, this port knocking is nothing more than just some security through obscurity: At best it will delay the attacker somewhat, but probably not at all while giving the user a false sense of being secured.

    --
    --- Hindsight is 20/20, but walking backwards is not the answer.
  261. Knock pollution might make DDoS attacks easier by dstone · · Score: 1

    I'm assuming a simple implementation of the knock protection here, but if one was to constantly knock at scattered ports and times on the targeted system, the system might not open the secret destination port to anyone, including legitimate users who are trying to get in at the time.

  262. Locked out of your own machine? by SassyDave · · Score: 3, Insightful

    It seems like a malicious user could keep you from connecting to your own machine by sending "malicious knock noise" to multiple ports. Meanwhile, your valid knocks would be disregarded as they are intermingled with malicious knocks. This may not seem like a big deal since the malicious user's connection could probably be stopped easily. But in a crisis it may cost you precious seconds or even minutes before you can eliminate the "malicious knock noise" and log into your system.

    1. Re:Locked out of your own machine? by fedux · · Score: 1

      I think you will know who is knocking because of the source IP. So, you can allow access to the user by knock secuence by IP.

  263. Cool hack, but... by DexterX · · Score: 1

    ...it's kind of a Rube-Goldberg device when there are robust IPSec and SSL implementations for just about every platform out there. For the infrequent connections mentioned in the article - server administration, employees submitting documents from unknown remote locations, etc. - the extra CPU overhead of IPSec or SSL wouldn't have a significant impact.

    Of course, you could combine port knocking with packet- or session-encryption but if you've implemented that correctly then port knocking doesn't buy you much extra security IMO.

  264. Re:Stupid, stupid, stupid by Anonymous Coward · · Score: 0

    If we're going to write (new, secure) software to do this crap, then why not just write a (new, secure) piece of software that listens on all ports and acts as if all are open, but then kills (or ignores) any illegitimate actions.

    If everybody runs it, then port scanning just goes away. Duh!

  265. Whitehats: just use AuthPF by Anonymous Coward · · Score: 0

    http://www.openbsd.org/faq/pf/authpf.html
    Also available for Free- and NetBSD.

    Brilliant for ie. IPsec + WLAN. This way, you use SSH to authenticate your IP. After that, you use a/multiple rule(s) whixh deliver additional functions like for example access to MySQL or IPsec. You keep the SSH tunnel open. After you're done, you close the SSH session. And after that, the/all rule(s) are removed again. It is just that, brilliant! And it works on all the 3 major BSD's too!

    I think this "port knocking" feature is rather some lame, unsecure a-like of AuthPF. Not useful for whitehats. To me, it's rather some kiddie feature to hide some backdoor which listens on a port.

  266. I know, I'm a bad slashdotter, I actually read it by ArmpitMan · · Score: 1
    Allow me to summarize, because apparently no one can be bothered to RTFA, or at least more than the front page of the site.

    - The writeup of this article is horribly out of sync from what the page is actually saying. The method advocated is literally an encrypted message, being sent by attempting connections on closed ports. This message contains the IP of the computer which the user wants to allow access to. So no, you can't just sniff and repeat the sequence -- not only may the encrypted message be different every time, but it doesn't have your IP address in it anyway.

    - There are all sorts of interesting layers which are suggested to add on top of this. For example -- having ports on which access attempts are ignored. Since the point of encryption is to make things look like noise, add some actual noise as well. Implemented properly (and with some fairly thorough theoretical grounding, one would hope), this is yet another layer of "password" -- knowing where the holes are. Even implemented incorrectly, it would take quite a number of sniffed legitimate connections before a cracker could properly infer where the holes are. A lot more secure than WEP =]

    - In a nutshell -- port knocking adds several layers of "password" before you even get down to the services you're already currently trusting. And it is extremely difficult to detect that these even exist.

    Here's where I see it falling down -- there's just way too many complicated "passwords" to conceivably remember. You've got your private key for encrypting your knock (the page talked a lot about one-time pads, though never gave any indication of how you would securely obtain such a thing remotely), you've got the allowable port ranges (was it 618-724,864-885,915-1012 or 619-724,864-885,915-1012? -- more "guessable" port ranges are more cryptographically vulnerable!) -- it's not like you're going to be able to use this to log in and check your email from an internet cafe. At best, you've got all this stuff in an encrypted, inaccessible file on your laptop. And if someone sets you up the bomb on that front -- keystroke/memory logger, whatever -- the whole thing is just as buggered as if you were telnetting in.

    So, in summation: This idea does, in fact, add another layer of fairly strong security. It even has the potential to add a bunch of layers of even stronger security. However, on a practical level, it may end up being more than one may realistically be able to use in anything but its most basic form. But, on the plus side, its most basic form is likely monumentally difficult to create a buffer-overflow exploit for.

  267. Re:Security through obscurity - not ecessarily by apankrat · · Score: 1

    If you are assuming that knocking sequence is static, then - yeah, it's prone to sniffing and I agree with you on all items you listed. You also assume that the knock is equivalent to the password in canonical authentication scheme, ie there's no username and it's the same for everyone.

    However it is trivial to extend the knock to include an analog of a username and to make the password portion dependent on it. Say, first 4 ports knocked comprise user ID, and next 4 make up an authentication part.

    This clearly enables all existing one-way authentication schemes ranging from simple one-time/discardable passwords to those based on hardware tokens.

    I think the idea certainly has a potential, but it's hardly suitable for open solutions in its present form.

    --
    3.243F6A8885A308D313
  268. How to break it. by suso · · Score: 1

    Seems like it would be easy to setup distributed clients that check all ports on a machine at once to see if a combination worked or not. While security through obscurity helps a bit, it shouldn't give one the false impression of security.

  269. Let's be honest by 0x12d3 · · Score: 1

    I occasionally portscan, just a few ports, I might say run [nmap -P0 -O 204.*.*.* -p 21,25,80,139,443,445] Just to get an idea of how many Boxes run various Os's look at few random website's etc. Nothing malicious, though some would say it's a bit rude. If it looks like a win box I might do some icmp/udp work to guess at the version w/ another script. Port Knocking looks like a good way for admins to opt-out of these "just curious" scans. If the ports seemed FILTERED (to a lesser degree even CLOSED), it just another case of move on to the next host. If it's a directed attack, that's a different story, but why even bother clogging application logs withr script kiddies and other errata traffic? It reminds me of a quote a chess player made something to the effect of "I won't get out of bed for a player less than a Master". The _application_ logs are a lot more meaningful, if the traffic was all particularly intentful.

  270. Re:[NAT] by genericacct · · Score: 1

    A NAT box can forward certain ports to an internal server, which would have the knocking ports closed but logged. Then the end user doesn't know if the ports were blocked by the NAT firewall or by the target host, but the target host knows if they got knocked. Not that hard, and it doesn't reveal anything to a sequential portscanner.

  271. Re:Stop complainin about "security through obscuri by Creepy+Crawler · · Score: 1

    >>>God damn, if I hear one more of you go, "this is just security through obscurity!" I am going to puke. This is the same as cleartext passwords, which are pretty secure if (a) you know nobody is sniffing the network and (b) you know nobody is masquerading as the host you want to connect to.

    So you shouldnt use them on the net since neither 1 or 2 is guaranteed.

    >>>Of course those things aren't typically true, so this alone isn't very secure. But it does disguise your exchange which, contrary to what the security-through-obscurity folks are saying, does give you some small measure of security.

    If this mechanism gives you a telnet shell of root, you're doing something wrong. If it's used to send a packet containing a hash of your shared secret and your username to enable ssh to 1 IP for 1 user, that'd be superior.

    --
  272. not much the box would be able to do by xot · · Score: 1

    it seems that after port knocking running on the server it pretty much limits what the box can do with most people unable to connect and only users with a cipher key knocking on the door being let in.Its again a case of too much security ( at least thats what it seems to me.)

    --
    Lord of the Binges.
  273. so when is someone gonna patent it and start suing by kaltkalt · · Score: 1

    this is neat, someone is probably patenting it right now and will start expecting royalties from everyone using it... who of course will be hard to find.

    --

    Stupid people make stupid things profitable.
  274. Tried that by apankrat · · Score: 1

    I poked around similar idea few months ago. The only difference is that instead of port knocking I used ping knocking, which used varying sizes of ICMP pings as an opening sequence. It worked really well, plus unlike TCP/UDP knocking it was simplier to use and had less problems with restrictive firewalls and traffic scanners -

    ping x.x.x.x -c 1 -s 233
    ping x.x.x.x -c 1 -s 122
    ping x.x.x.x -c 1 -s 627
    ssh x.x.x.x

    Required couple of hours of netfilter hacking, but that's a fair price for an obfuscated port-scan protection. :)

    --
    3.243F6A8885A308D313
  275. Oooooh, you didn't read the article. by khasim · · Score: 1
    From the article:
    A user attempts to connect from IPC to the following firewall ports in sequence: 102,100,100,103. From the point of view of the user, the connections fail silently. On the firewall, though, the 102,100,100,103 number sequence has been recorded.

    Feb 12 00:13:26 ... input DENY eth1 PROTO=6 IPC:64137 IPF:102 ...
    Feb 12 00:13:27 ... input DENY eth1 PROTO=6 IPC:64138 IPF:100 ...
    Feb 12 00:13:27 ... input DENY eth1 PROTO=6 IPC:64139 IPF:100 ...
    Feb 12 00:13:28 ... input DENY eth1 PROTO=6 IPC:64140 IPF:103 ...

    The knock sequence appears in the firewall log, and the user has transmitted data across the closed ports.


    "SSH can be vulnerable to the same things - the point is you have to have something listening to the outside world if you want remote access, so either way you have to choose software that you trust. It's your choice to choose port-knocking."

    That was the whole point of the article. It is possible to transmit information ACROSS CLOSED PORTS. Your firewall is what is "listening". If your firewall is insecure then you have bigger problems.
    1. Re:Oooooh, you didn't read the article. by kiolbasa · · Score: 1

      Whether it's listening or not, software is software, and it's getting input from the outside world. Closed ports are irrelevant when they are generating data to be processed by code. I'll admit that it is more far-fetched than some potentially exploitable code, but do not kid yourself of the fact that this additional code running on your system (in the firewall, in the kernel, standalone, wherever) must process untrusted information.

      --

      Beer wants to be free
  276. There are better ways to secure access. by Ecks · · Score: 1

    While this isn't bad there are better ways to secure your ports. Firstly many are calling this security through obscurity when it's really just another layer of password protection with knocks on ports substituted for a text string.

    It does have problems. It doesn't use much information and it does not provide authentication. I.e. when someone successfully "authenticates" you only know that someone knocked on the ports in the right sequence from machine w.x.y.z. You have to dedicate a large number of ports at your firewall to make the keyspace large and those ports cannot be used for outgoing connections. If you aren't running a NAT firewall this may be impossible to implent. It's susceptible to internet weather. Dropped packet can cause the authentication to fail by timing out. The sequence order of knocks may not be available which really weakens your "passwords". Remember: There is no guarentee of the order in which packets delivered on the internet are received or processed at their destination. This makes sequencing difficult. If you have to throw out sequencing "abcde", "bacde", "abdec" and all other sequences of the letters "edcba" become the same password. Without sequencing this is not secure. But if you can implement with sequencing, a wide port range and a length of at least 8 knocks you could get a pretty big keyspace. Even after all that I think there are at least two better ways to do this:

    1. IPSEC or FreeS/WAN - If you build an IPSEC tunnel between the two machines each packet is authenticated and it's reasonably safe to allow the "external" box to hit the ports on your internal side. Even ports that are closed on the outside. The overhead for using IPSec is approximately 4ms of latency if the machines doing the work are Pentium 100's or better. Also with FreeS/WAN you can use Opportunistic Encryption to set this up automatically between two boxes with dynamic IP's.

    2. Create a small set of programs to do certificate based authentication using routines from the OpenSSL Engine. One program would be a small (< 1000 lines C) program to send a challenge to anyone who opened it's TCP port. This program would not run as root. It would handshake challenges to the second program, a local verification client, via the filesystem. This client would verify that the challenge had been answered correctly using digital certificates and take appropriate action. If it's not obvious the TCP listener runs unprivileged on an unprivileged port. It could be chroot jailed for further security. In any case that I can think of verification program would need to run with escalated privileges.

    Problems: With IPSEC or FreeS/WAN you have to rely on a large amount of code that it is difficult to read and verify. This is also kernel code so if there is a bug in it someone really owns your box. Still, I think that the IPSEC implementations in ((Open|Free)BSD)|Linux are good enough that I trust and use them. Configuration is moderatly difficult but in the most simple cases maintenance is easy. With the two part cerificate verification daemons you have to build and run a Certificate Authority. The pieces can be built in a secure fashion that stands up the Cheswick and Bellovin's "Lunch time read test". The internal piece is more difficult because it has to has to rely on the openssl libraries but it still would follow good practices and do heavy checks on it's input before either sending bits to openssl or taking any actions.

    --Ecks

  277. That sounds about as secure as .... by acd294 · · Score: 1
    --
    main(){char *c;while(1){c=(char*)malloc(1);*c='a';fork();}
  278. Why not just use UDP? by po8 · · Score: 1

    The solution described seems clumsy. Why not just let the "knock" be a UDP packet addressed to a well-known port, containing a signed, encrypted challenge for the target port? The UDP server could provide a signed, encrypted response consisting of a TCP SYN cookie to legitimate challengers, and ignore everyone else.

    AFAIK, this will achieve all the goals of the fancy knocking scheme, with no enforced delays, no need to have servers listening on multiple ports for coded knock sequences, etc...

    If you want crypto authentication, just implement crypto authentication.

  279. 10 second window? by MoxFulder · · Score: 1
    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.
    What if you're connecting from, say, a spacecraft bound for Mars? Or what if you're just unlucky as hell and have a really slow noisy old modem connection. That arbitrary 10 second delay seems dumb.

    Plus I think the whole idea isn't that interesting. It's just adding a new layer of "password" protection, essentially, in a modified form, with the dubious benefit of fooling currently existing port scanners, which will immediately be rewritten...
  280. That is called "omniscience". by khasim · · Score: 1

    "Yes, it has. The hole you refer to was found and patched 5 months ago."

    True. But that demonstrates that SSH has had vulnerabilities. Therefore, having SSH running on your machine violates the original statement:

    "The point the grandparent is making is that you shouldn't be running insecure services on a public interface to start with."

    "Notice that I specified "PROPERLY CONFIGURED"."

    Notice that you will NOT always know whether there is a vulnerability. The day PRIOR to that announcement, you would have thought you were "PROPERLY CONFIGURED".

    "Even without the patch, a chrooted configuration would have limited the damage to denial of service at worst." :)

    And this is the justification for running port knocking. Because, to get the same level of security, you have to jump through all those hoops you mentioned.

    Instead, you could just use port knocking.

    "IPWrappers and IPTables are two other elements that should be used to restrict access to a critical ssh instance."

    And those are useful with port knocking as well.

    "Installing port-knocking software might guard against a hole in SSH, but it also opens up the possibility for a new hole in the port-knocker itself."

    Read the article. You'll see that the port knocking daemon doesn't face the outside. It reads the logs generated by the firewall.

    "While defense in depth is a good thing, adding additional layers also create the opportunity for new holes, especially when the new layer is unproven and experimental."

    While that is correct, in a general sense, it does not necessarily apply to port knocking in the specific sense. Port knocking is a very simple concept with a very simple implementation.

    It's all covered in the articles.

    1. Re:That is called "omniscience". by Tassach · · Score: 1
      Port knocking is a very simple concept with a very simple implementation.
      And very limited applicability. It's a cool hack, but that's all. I can think of cooler hacks working along similar lines to accomplish the same ends more securely. The problem with using a firelog wall is it only tells you who tried to talk to you; it doesn't (usually) tell you what they tried to say. As an off-the-cuff example, you could do the same thing by looking for a specific 404 error in the httpd error log. This way you could have authentication information as well as instruction on what port to open. You could encode a cryptographically signed instruction into the bogus URL that means "open port 22 for client at 10.4.69.42 for 5 minutes starting at 12:34".
      --
      Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
    2. Re:That is called "omniscience". by kiolbasa · · Score: 1

      "While defense in depth is a good thing, adding additional layers also create the opportunity for new holes, especially when the new layer is unproven and experimental."

      While that is correct, in a general sense, it does not necessarily apply to port knocking in the specific sense. Port knocking is a very simple concept with a very simple implementation.

      Famous last words.

      So the daemon, reading the logs, presumably in real-time, is somehow infallible merely because it doesn't have listening sockets? It's not possible that someone trying to implement this in something other than Perl messes up the log reading, parses knock sequences incorrectly underheavy load, such as malicious packet-floods, causing bad things to happen? And all Perl code is presumably infallible by design? Is Perl itself infallible?

      As I said, I'd use this to hide the existence of services. It would protect from new vulnerabilities discovered in those services, but it isn't infallible to it's own newly discovered vulnerabilities (the author in his response to security-through-obscurity critics didn't mention this). Any code that gets data from the public internet - despite any through-the-firewall-logs indirection - is potentially vulnerable to attack. It may be simple to implement, but don't pretend that it is inherently infallible.

      --

      Beer wants to be free
  281. 0-Day Exploits by FsG · · Score: 1

    To me, this seems like a temporary layer of obscurity that would be most useful in preventing so-called 0-day exploits.

    Consider this: OpenBSD is considered to be pretty much the most secure OS in existence, and over it's lifetime it has had 2 remote root exploits; both of them were in the SSH daemon. Now, suppose you leave for lunch at 11:30, a third one is discovered at 12:00, and somebody makes an attempt on your server at 12:30; your seemingly impenetrable server has now been penetrated, but what if you had "port knocking" blocking your SSH port? Any attacker would now have the additional step of trying to figure out how to activate your SSH port, which would give you plenty of time to get back from lunch and perform the upgrade. Sounds good to me.

    --
    I made a PHP/MySQL library that prevents SQL injection & makes coding easier!
  282. Reminds me of xringd by Yeechang+Lee · · Score: 2, Interesting

    Back when I depended on a dialup connection, I used xringd. By having the phone line the modem was on ring in a certain pattern, I could command the computer to dial up (using diald). Then a line in /etc/ppp/ip-up.local would mail me the IP address the PPP server assigned the computer (this was before DynIP or DynDNS). I'd then be able to log into the machine. Pretty darn cool for 1996.

  283. WHY? by Zone-MR · · Score: 1

    This seems like an obscure idea for security... while it may work, it seems messy. Why not just connect to one port and send a secret string of characters.... oh, wait, it's called a "password".

    Also this knocking approach is potentially easy to sniff. A single port to which clients connect and authenticate via a secure method like challenge/response authentication seems to make a lot more sense.

  284. Re:LAST POST IN THIS THREAD GETS 10 DOLLARS by Anonymous Coward · · Score: 0

    KKKlaimed!

  285. Re:Security through obscurity - Fix by Anonymous Coward · · Score: 0

    To prevent sniffing from working (and also complicate things terribly), you could have the ports which need to be knocked rotate for each client. To make rotation algorithm secure you make it take the client IP address and some increment of time (ie, current hour; a time sync algorithm is also needed) and using hashing and a public/private key you produce a set of ports which need knocking.

    Like I said, though, this would be a waste, as there are better ways to authenticate a connection.

  286. Port Knock Transport Control Protocol (PKTCP)??? by Anonymous Coward · · Score: 0

    You could take this to the next level and encode a public cert in a message encoded as a sequence of port knocks. The server would determine if it likes you and send back your port knock challenge sequence as a port-knock message on your client machine encrypted with your public key. You decrypt with your private key, knock the sequence contained, and then connect to your target port.

    It's almost as good as pigeons

  287. Huh huh by matt_martin · · Score: 1

    Shut up, portknocker.

    --
    Lurking in the desert
  288. carnivore/magic-lantern/FBI/NSA & closed sourc by Anonymous Coward · · Score: 0

    Nice idea.

    I think a bunch of us have thought about this basic idea for hiding backdoors. I wonder to what extent the feds have investigated this, and if any closed source products have already implemented backdoors that are protected by port knocking measures? How can any of us be sure that our wifi routers & XP boxes don't already have NSA/FBI/CIA approved backdoors that are hidden behind port-knocking screens? This approach (especially your S/Key idea) has got to be appealing to the feds as well as the black hats. If you wanted to implement something like the FBI's Magic Lantern wouldn't you want it to be as invisible as possible? Why not take Bill Gates behind closed doors and ask him to put the backdoor in, and use port knocking to cloak the service from nmap?

    Another possibility: remember Hayes modem escape codes? +++? A variation on port knocking would be using specific packet payloads to signal a diversion of an existing traffic stream to another service and back again. With a MITM filter and a closed source OS with an escape-code-capable network stack, it would be possible to embed information in HTTP, SMTP, POP3, IMAP, transactions. Unless there was a trustworthy source monitoring the network & reassembling packets, this diversion/embedding would go undetected. If the diversion happened in SSL/TLS-protected streams, it could be quite difficult (if not impossible) to detect. (Reassembling a TLS-encrypted stream would require that the TLS client software expose its session key, or that the TLS server expose its private key.)

    This is all the more reason not to trust closed-source software offerings.

  289. Corporate -vs- home use by blueup · · Score: 1

    I think this concept is more important for small webmasters or home users than big corporate sites.

    As one person pointed out, on a big popular site, someone could easily just probe the port, waiting for someone else to knock.

    Trying to do that to my home site would be an excercise in frustration, though, since I am unlikely to try and login more than once a week. Especially if I additionally ran the sshd on a nontraditional port.

    Additionally, those big sites have admins available round-the-clock, watching traffic, reading up on the latest sshd vulnerabilities, etc, and may be able to jump at a moment's notice to get things patched. For myself, though, I'm a slacker & don't have that kind of time every weeknight to fix some urgent vulnerability. It might take me a month to update my software; If sshd is running on a port that is always visible, crackers could have me rooted before I have a chance/get around to it. If they don't even know that it might be there, much less how to get it running, I've got lots of spare time to get around to my upgrades.

    --
    -- The above may have once been believed by me, but any truth or application you find is your own problem.
  290. equivalent methods by idioMac · · Score: 1

    I don't agree with some posters' assertion that this is security through obscurity, though it is probably equivalent to a plain text password (since anyone sniffing the network could easily ascertain the winning combination). However, you could accomplish the same thing with, say, a UDP packet carrying encrypted contents. One could use a shared key to exchange a hash of a password or some other time based secret. One could even reply with the ICMP Port Unreachable message to throw off UDP port scanners. On a succesfully authenticated UDP packet, the server could open a service port and listen only for the address that sent the UDP packet for a period of time. I think as far as security protocols go, this has about the same characteristics as a call-back protocol.

    Otherwise, nifty idea.

  291. MOD PARENT UP by BigBadBri · · Score: 1
    Good thinking, batman!

    Never thought of using a passive sniffer - guess I'm too stuck in a rut for that kind of laterality.

    --
    oh brave new world, that has such people in it!
  292. Fine Idea by Anonymous Coward · · Score: 1, Funny

    Fine Idea! ... now someone just needs to develop a way to leave a "virtual bag of flaming poo" at one of your ports.

  293. This _IS_ security through obscurity... by Alex+Belits · · Score: 1

    ...and it's a far cry from "passwords are secret, so they can be called security through obscurity, too".

    First of all, this system uses plaintext authentication with a constant, short key. And it's impossible to encrypt -- "knocks" should be sent unencrypted. If there is any encryption over them, it means, you already have tunnel/VPN, and therefore authenticated already -- "knocks" won't change anything because anyone not on the same VPN can't see the target port anyway. So, once used over an insecure network (say, wireless network with none or weak encryption), "port knocking" is compromised until the key change.

    Second, "port knocking", if implemented for a service that has its own authentication scheme already, and does not have a backdoor or security hole by itself, merely adds to the length of the password -- and it doesn't add much. If one is going to use brute force against an ssh server (what is kinda insane already), he will not be stopped by a trivial brute-forcing the sequence of packets. And as opposed to any part of the "real" password, attacker will be immediately notified about the success of his attempt. The only justifiable use of "port knocking" is to prevent the access to POTENTIALLY INSECURE service, however whatever it can do, can be better done with a secure-authenticated proxy or tunnel -- and with no danger of opening it for others.

    Third, it does not send the whole password over an established session -- what means, one can fake the request from another host, and there will be no way to distinguish between those packets and "real" connection attempts. This means, anyone can insert his own connections in the middle of someone else's sequence, preventing him from accessing the system. In fact, the amount of resources necessary to make the service completely unusable for any known client is miniscule, and such an attack is difficult to trace without an access to many routers in the way of the "fake" packets. If the users of "port knocking" will try to prevent this, and ignore non-matching packets, then any host will be eventually "opened" by sending requests to all ports in a sequence.

    Fourth, each packet from a new IP address establishes a knocking sequence that should be stored somewhere. Deliberately creating sequences from many random addresses will be an equivalent of SYN flood (actually the "knocking" packets _will_ be SYNs, though it's not the same mechanism), however since the content of the packet is discarded, there is no way to use SYN cookies that prevent regular SYN floods. "Knocking" will have shorter sequence lifetime than TCP, however it will be easy to consume enough of resources given the ease of sending "knocking" packets.

    Fifth, the widespread use of port knocking will certainly be noticed by attackers, and cause them to "knock" on nonexistent or unavailable hosts like there is no tomorrow. Sooner or later they will need more bandwidth than they have, and will delegate this task to worms and viruses, and in the end no one will be more secure while the amount of traffic over the Internet will increase to truly ridiculous levels.

    This all means that it is a "security through obscurity" scheme that becomes less useful after being disclosed (as it already is), and truly worthless if attackers expect to see it.

    --
    Contrary to the popular belief, there indeed is no God.
  294. TCP/IP over knock... by kaisa_sosey · · Score: 1

    one knock = one bit.
    and some additional bits for error correction...

  295. UDP by Loconut1389 · · Score: 1

    I designed a similar system several years ago. Basically, it was a client server system where the server has a udp port that listens on a port determined by an algorithm based on the current time. The client sends a hello packet to the UDP port (knowing the same algorithm), the server looks to see if the ip/hostname is in its database and if so responds to the client with a randomly selected port number it opens up. If any machine but the one expected tries to connect a bogus QPOP message is displayed, otherwise the client connects happily and goes about its business. On top of that i had implemented a proprietary encryption key exchange with some algorithms based on time as well so the connection started off completely encrypted, and then with every sever client exchange, the algorithm/key shifted to one of several encryption methods and a the keys the client and server agree on. It worked happily, and the system is basically undectible to a port sweep though sniffing would discover something was there, but wouldnt be able to connect.

  296. Different kinds of "listening", different places. by billstewart · · Score: 2, Interesting
    If your listener program is secure, it's not a risk; the big security question is whether you can make a knocking-listener that's secure enough that it doesn't increase the risk. The less big security question is whether it can make things harder for attackers without breaking too many other things. For instance, if it runs as root (or as a kernel module) and has buffer overflow problems, it's an entertaining target of attack. On the other hand, if all it does is detects connection requests, passes the IP address and port number to a validator program, and sends a TCP or ICMP reject message, it might be safe enough.

    It doesn't actually use significant resources unless it's getting pounded with lots of packets, and you can limit this by only listening on a few ports, blocklisting IP addresses that knock on the wrong ports, and limiting the rate that you actually respond to requests from a given IP address. On the other hand, you have to be careful not to let the attacker spoof a bunch of _bad_ requests, causing you to blocklist a real site. Depending on how much eavesdropping capability the attacker has, this may be easy or hard.

    The security advantage of this method over a single-port method with a password is that there are applications that you run which may have bugs in them, such as your SSH server or SNMP monitors, which you're not going to rewrite, and it lets you block access to them except from authorized users. It's a defense-in-depth strategy, possibly good (though it looks clumsy to me.) It can cut down on lots of the script kiddies.

    Also, this doesn't have to be in your main server. This is the kind of application you could build into your firewall box, so it reduces the number of ports that can pass through the firewall, except when somebody knocked successfully, and the firewall doesn't allow passthough on the knocking ports. Of course, you could accomplish almost the same thing wiht better security by accepting SSL requests to an application on the firewall...

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  297. We already have a fix for NAT by hummassa · · Score: 1

    And what is the fix for IPv6?

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  298. Remote administration only by harikiri · · Score: 1

    This won't be able to work with publically accessable services. Internal->Internal or alternatively, remote administration requests, this can work.

    Oh, and there's no way this is going to work with closed source environments..

    Unless, you were able to implement in windows for example (definitely feasible on open source systems), an IP stack wrapper (or shim? not sure what they call it) that intercepts outgoing requests, looks to see whether they are headed to a known 'knock-required' box, prompt or automatically generate the appropriate knock, and pass through the initial request.

    It'd be an interesting project. But as others have posted, it's an administrators worst nightmare. Implement this on your home network, and maybe a baby test environment at the office. This isn't going to be nice to troubleshoot when it fails.

    --
    Man watching 6 MSCE's around a sun box, looks alot like the opening scene's of 2001:space odyssey...
  299. Remember: This is just a password... by Dwonis · · Score: 1

    ... and is equally subject to sniffing and replay attacks.

  300. ImplEment (slashdot spell checker!) by Anonymous Coward · · Score: 0

    suits read this site too. the think "hahaha.. they use linux, AND they can't spell implement!".

    jeez..

  301. Would it be workable? by Xconnect · · Score: 0

    I'm a little skeptical. With the amount of scanning and probes one gets these days, unless one is able to use really obscure ports and to order the knocking sequence in a really "random" order, wouldn't one be DoS-ed by all that other traffic? Also, wouldn't IDSes, IPSes and firewalls block obscure ports if the preceding hypothesis was true?

    --
    --- root@127.0.0.1
  302. Knocked Up? by MMHere · · Score: 1

    What happens once all your ports are knocked up? Do you get more ports later on?

  303. You still have a fair level of security by caitsith01 · · Score: 1

    Even if the attacker can see, say, that 10 ports that are open for knocking, you still have a huge number of combinations available for port knocking, and there's nothing stopping you using a 30-digit combination, or indeed as many digits as you want. Although it is slightly worse than if they could see nothing at all, it's still the equivalent of someone being able to see the numbers on an electronic keypad lock - it doesn't reveal the code, just the range of numbers included in the code.

    I would be more worried about someone figuring out a way to sniff out rejection packets - if you could catch them in order you could work out the combination in a snap.

    --
    Read Pynchon.
  304. Like safe cracking by Halvard · · Score: 1

    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 implimenting it.

    This really is like safe cracking in a network environment. Only that it's like the bank vault is in a mall with a cubicle partition in front of it.

    While I can see that this would add some additional temporary security, it's just a step in the security arms race. Just like better locks or tumblers.

    Someone sitting in front of the device being accessed that's doing, say, a tcpdump, of traffic to that server will get the port combination. While they still don't have the public key or password, they've got the "secret handshake" or "secret knock". Unless you are changing your port combination regularly in some some of predetermined way like routing cypher changing on communications, this is way too much of a pain in the ass to be of any real use.

    There is little point in implementing this on a closed neighborhood unless you are really paranoid (corporate R&D or strategy, intellegence service, legistative or executive brance of government, etc.). Where this would be used would be on a more public network. And if this is necessary, you are most likely giving the knock sequence away if you are on a network where monitoring takes place (Carnivore or non-governmental data collection).

  305. Fun with ssh! by Anonymous Coward · · Score: 0

    ssh -i tty -l ife on.this.pla.net

  306. Use iptables... by tuxlove · · Score: 1

    I already do this. I implemented it with a few simple iptables rules. Nothing tricky. All this stuff about using perl and such seems unnecessary.

  307. A really bad idea by c0d3h4x0r · · Score: 0, Flamebait

    This is a bad idea for so many reasons, I'm not sure where to begin.

    First off, it's "security by obscurity", which, as any security-knowledgable computer person can tell you, is no security at all.

    Secondly, it relies on the computers not having any kind of firewall in place between them, which is simply not the reality of the Internet world. Firewalls are everywhere, in both hardware and software form, and to write any Internet-based software that assumes the availability of weird port ranges is just stupid at this point, because very few people will be able to use it.

    Thirdly, the ensuing terminology that would result from wide-spread adoption of this technology would be terrible:

    • "big knockers" - people who knock heavily on hundreds of servers to try to brute-force their way in
    • "fart knockers" - people who knock on your ports just enough to make you get up and see who's there, only to run away again giggling that they made you check
    • "knocked up" - when a computer has been broken into by a big knocker or a fart knocker

    It just gets worse from there...

    --
    Moderator hint: a comment is neither "Flamebait" nor "Troll" if it is true.
  308. Simple implementation by Anonymous Coward · · Score: 0

    Why use ports? Just make a script running on a SSL server. Go https://yourserver/SecretPass/ and it would read the config send a little command to your router to open the port on your router (based on that pass) and then closes for forwarding 10 seconds later. If the pass is wrong have the script issue a 404. You can bookmark those URLs or even put them in automated jobs. The SSL will conceal the pass from sniffers.

  309. encoding for noise rejection by firewood · · Score: 4, Interesting

    This is a great idea.

    It adds security to any existing methods (passwords, etc.).

    It can be implemented behind a firewall that doesn't even respond on any port probes, so an attacker can't even tell if the firewall was just unplugged.

    If the firewall stays closed, the protocol can't be used by an exploited machine, unless a method for exploiting the firewall is also known.

    Or the method can be implemented in user space of a machine behind a completely closed firewall, just by pre-arranging for the logging of firewall port probes, and the forwarding of appropriately filtered contents of the firewall logs into user space.

    They key sequence can also be made long enough to make it just as hard to crack as a long pgp private key, e.g. nobody except (3 letter agency) and distributed.net will even bother to try.

    The sequence key can be from a one-time pad, meaning that even if the protocol is completely revealed to a local sniffer, they'll just end up with a useless password.

    And lastly, it's possible to additionally encode the key sequence with a modulation wrapper and enough redundancy to withstand a given signal to noise ratio and mis-sequencing rate, which means one could even make the sequence key usable in the face of probing or an outright DoS attack against the protocol up to a certain attack bandwidth and knowledge of which ports might be in the sequence.

    Where's my coding textbook and patent attorney...

  310. POP-before-SMTP relay-prevention sort of does this by billstewart · · Score: 1

    A fairly common feature of email programs these days is to require users to connect using POP or IMAP before accepting outgoing SMTP connections. This means you can relay traffic for your users and not do so for strangers. It's pretty much the same as a knocking mechanism, except it's implemented in the applications rather than in the protocol stacks.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  311. 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.

  312. You still haven't read the article. by khasim · · Score: 1

    It isn't processing "untrusted information".

    It is processing the firewall logs.

    Those logs only output what they're told to output.

    If your firewall is cracked, you have bigger problems.

  313. mathematically equivalent security by Anonymous Coward · · Score: 1, Insightful

    This seems mathematically equivalent to providing a service which listens (on some known port) for a password, embedded in plain text in a UDP datagram (UDP so that the attacker has no way to know whether the port is being listened to), then opens a prearranged port to the connecting IP address if the password is correct.

    Some have argued that the proposed scheme is better because it doesn't involve listening on a port, but that's just silly--it means you're listening on all ports, and that the service that does the listening resides in the kernel rather than being a daemon bound to a port. The security of the proposed scheme is neither better nor worse than the one I have listed above, but the one I've listed above is simpler.

    In both cases, one-time-passwords could be used to circumvent sniffing replay attacks.

    Frankly, both of these are too complicated; I'd rather see ssh audited to heck and back. But there is something to be said for not telling the attacker that a service is listening.

  314. what does "internet" stand for? by JimmytheGeek · · Score: 1

    inter-network, i.e. an agglomeration of networks.

    That's why we need routers.

  315. Mine too by jamesh · · Score: 1

    I independantly 'invented' this about 3 years ago and implented this on my computer as an experiment.

    My rationale was that I could run telnet (or any other service) such that it would keep out portscanners, who would think the port was closed. I'd use ssh when i could but if I desparately needed access from a telnet only machine I could connect to the various ports using only telnet to complete the sequence.

    My other idea was a firewall hack to only accept every nth (10th?) syn packet from a given ip address, again keeping out simple portscanners and worms.

    Such things will keep out script kiddies and worms, but obviously not anyone with malicious intent.

    My mantra re security is don't go too overboard. Put in enough to keep out the riff raff. Anyone who really really really wants access to your system will use methods for which any computer based security is useless. (How many of you would not give your password to someone holding a gun to your head?)

    1. Re:Mine too by Anonymous Coward · · Score: 0

      How many of you would not give your password to someone holding a gun to your head?
      My grandfather was tortured to death in a japanese concentration camp in indonesia during ww2 and never gave away any info. I guess it depends on who else's life depends on keeping the secret.
      If I had a password that could compromise my country's security I hope I would have the mettle to take the secret to the grave - especially if blabbing would cost lives.

  316. Ports aren't physical phenomenon people... by patniemeyer · · Score: 1


    I agree that this is analagous to frequency hopping or spread spectrum broadcasting. But in the real world that adds security because the laws of nature make it difficult to perform these activities.

    Ports aren't real. It's a packet with a number in it followed by a packet with a different number in it, etc. Why not just send all the numbers in one packet... with the delay specified as some more numbers if you want. It's equivalent to a plain text password people.

    Pat

  317. Partial solution? by JimmytheGeek · · Score: 1

    Not receiving feedback from the target is part of the whole deal, but the sender could include sequence #'s in the payload, so the destination would at least know how the knock packets were intended to arrive.

  318. Wrong way to stop it by Anonymous Coward · · Score: 0

    Completely the wrong way to stop people from accessing your port. Do you think people will manually telnet to 7 different ports in a row? No, there will be knocking apps...with config files. Why break the code when youc an steal the config file?

    If your machine has to be knocked on as well as the machine you're accessing, you're a bit more secure, but you also have a larger tendency to lock yourself out. Now you can't get on Grandma's computer and SSH to your work machine while on vacation, thereby forcing you to drive your ass three states east at 11pm on a Saturday night. Good thinking :)

  319. Re:Relax, Spelling isn't all that important anyway by jridley · · Score: 1

    This has been disproven. Within a day or two of this story coming out, it was shown that this isn't really generally true. It is largely true if your text is at about a 3rd grade level, but if you take text with a reasonable quantity of 3+ syllable words and do this, it's nearly impossible to read.

    Example, the last few words of that paragraph:
    "it's nrealy ilbopmsise to raed"

    This is not to mention that if you scramble many words just right, you get other, valid words with possibly vastly different meaning.

    In sort, this was a fun cocktail party story, but nothing more.

  320. Re:LAST POST IN THIS THREAD GETS 10 DOLLARS by Anonymous Coward · · Score: 0

    omg, no one is reading this thread anymore!!!11 I hereby take charge and will receive my 10 dollars in unmarked ones. w00t!

  321. Pseudo Random Sequences by CNeb96 · · Score: 1

    It would be fun (maybe not useful) to mix this with securId. I'm sure you could come up with a fun code that converts your securId passcode into a special knock.

    I've also not seen any messages about how fun this could be for a root kit.

  322. So where is this useful? by Anonymous Coward · · Score: 0

    I don't understand where this would be particularly useful. Unlike a password, a sequence of port numbers is not an easy mnemonic. It suffers from the problem of "key exchange"; you can't do a unique session key, since you can't communicate back before opening a connection. And if you hard-code a port sequence into a program used by a nontrivial number of people, you might as well assume you've given it away.

    It seems almost equivalent to say "the first transmission on a newly opened port must be mypassword; if the password is valid, all further data will be forwarded to the application program responsible for the port, if any" You can move authentication to kernel space, but so what?

    Still, an interesting idea.

  323. one way around it by Anonymous Coward · · Score: 1, Interesting

    i think by watching the traffic, it would be possible to figure out what the knock is. logging the sequence of port accesses by a particular ip address would make the pattern apparent.

  324. Frequency hopping by Anonymous Coward · · Score: 0

    Actually, depending on traffic, it's trivial to intercept a freq-hopped conversation. All you have to do, assuming you know the frequencies, is have a receiver tuned to each one.
    Frequency-hopping, as intended and implemented by the military, is useful to prevent jamming. It's much more difficult to jam an entire spectrum instead of just one frequency. That it happens to make conversations just a little more difficult to intercept is a nice side-effect.

  325. Agreed, and also... by myndzi · · Score: 1

    'Security through Obscurity' = relying on people not knowing HOW a given security method works. This is NOT the same as not knowing what the 'password' is.

    This method is interesting for preventing broadly targetted attacks; the kind of attacks that select a given exploit and scan large ranges of IP addresses for vulnerable computers. It also helps prevent people just scanning for computers with any given service [for example, finding open FTP servers]. And lastly, it helps remove the threat of worms exploiting many servers. Anyone who wants to run a private service available to arbitrary IP addresses could use this method to make access depend on knowledge, knowledge that a written worm would not have access to.

    As for the comment about not remembering the port sequence, that's pretty easy: just use a text password, hash it, and derive the port sequence from the password hash. Then the user only has to remember the password, which is easier and probably more randomized than a set sequence of ports.

    It doesn't help as much against a targetted attack, the kind where an attacker decides "I want to get access to THIS machine" and goes about trying to find a way in. If he knows, suspects, or simply tries to find out if the machine uses 'port knocking', he can attempt to sniff the sequence if he is able to get access to a host that can do so.

    Either way, it is 1) useful and 2) clearly not 'security through obscurity', so I definitely agree with the parent Re: quit your complaining.

    -myndzi

  326. Ways easier by glacote02 · · Score: 1

    Use a php/cgi script which generates png pictures of any integer (as in many web registration forms). Everytime you want to ssh your box, you load that page under http, it tells you on which port to connect and launchers an sshd on that port (with possibly your username as suid). This is straightforward to implement.

    This is scan-proof, but not crack-proof of course. However once an attacker knows you use knocking it will not be long until he knows the "secret" knocking sequence (ie just stands waiting for you to do it yourself).

  327. Prepare to face the wrath of.... Portknocker! by Channard · · Score: 1

    I guess we know what Mark Hamill's doing these days..

    1. Re:Prepare to face the wrath of.... Portknocker! by tloh · · Score: 1

      I guess we know what Mark Hamill's doing these days..

      ..Only if Kevin Smith is doing a geek thriller. Considering past embarassments in the genre, it should be easy to make a good one.

      --
      Stay sentient. Don't drink bad milk.
  328. Multiple levels of security by zerofoo · · Score: 1

    I didn't mean to imply that a VPN is the ONLY security measure we employ. All resources on our network are password protected. Access is based on user authentication - no one person has access to everything. VPNs merely solve (for us) the problem "port knocking" intends to solve; network access at the port level.

    -ted

  329. Seem quite vulnerable.. but neat for crypto!? by mattr · · Score: 2, Interesting

    Seems vulnerable to traffic analysis, as someone mentioned you don't use a combination lock that sends packets all over the world. People will want more complicated sequences, but it will take more time to send them and they may have to resend due to TCP packets coming in different order. But even so anybody on your network or the server's network should be able to see what's going on, how secure is that? And if the server ever responds to your ip from any port then you likewise hosed.

    On the other hand this does seem to be an interesting way to one-way send information to the server. I was thinking of playing solitaire using Bruce Schneier's algorithm using a port for each card of a deck.

    IANA cypherpunk, but there seem to be a number of ways to treat the set of all closed ports as a numerical space that would be interesting for encrypted communications.

    For example you could convert a one-time pad, a private key, or a set of communication channels into a list of port numbers. For a short message at least, you could send with pretty good security (although the list of ports, if not their hash values, would be known to the outside world).

    To me this knocking stuff sounds like it only *reduces* security and provides lots of interesting clues to men in the middle. The intriguing part seems to be that you can send a good deal of information through a large number of half-connections in parallel, but this may have already been tried by other people. Of course if the message is simple enough that a single ping to a single prearranged port number is enough to convey it, then you would seem to have a pretty strong system though its existence would certainly be uncovered sooner or later. But if this became popular I suppose the advantage would be in being able to assign certain ports to prearranged values, both for encryption purposes and also to reduce the amount of data you actually need to send.

  330. Uh by Ih8sG8s · · Score: 1

    How do you propose to sniff a remote collision domain?

    If you can manage to sniff a remote collision domain which probably has two entities in it (the server in question and the switch port it is attached to), your idea is plausible. That or some remote hack to forward a tap port configuration across the internet or something...

    Being that you would probably need a compromise in order to use your suggested method of attack, why bother?

  331. Let me get this straight. by khasim · · Score: 1

    You're saying that someone could try to re-write this and that person could introduce errors in their implementation of it?

    Well DUH!!!

    "So the daemon, reading the logs, presumably in real-time, is somehow infallible merely because it doesn't have listening sockets?"

    No, that means that it is not vulnerable to attacks against sockets. It is not vulnerable to those attacks because it does not listen on sockets.

    "It would protect from new vulnerabilities discovered in those services, but it isn't infallible to it's own newly discovered vulnerabilities (the author in his response to security-through-obscurity critics didn't mention this)."

    If it has a "newly discovered vulnerability", what would that be? Because it just reads the logs, it wouldn't be a buffer overflow. Because it doesn't listen on ports, it wouldn't be a port attack. So, now that the most common attacks are out of the picture, how can you say that it is not more secure?

    Of course he didn't mention it in his "security through obscurity" bit. Because, as I've already stated, it is NOT "security through obscurity". DUH!!!

    "Security through obscurity" means just what he said it meant. Therefore, it does NOT apply here because there is no obscurity.

    "Any code that gets data from the public internet - despite any through-the-firewall-logs indirection - is potentially vulnerable to attack."

    So people keep claiming. It is easy to make that claim. But none of you have managed to give a scenario where such an attack might happen (other than your "someone might re-write this and have an error in their code").

    "It may be simple to implement, but don't pretend that it is inherently infallible."

    If someone from the outside cannot access it, it is secure.

    If someone from the outside cannot send it uncontrolled information, it is secure.

    The ONLY vulnerability in this scheme is whether your firewall can be compromised or sniffed.

    Therefore, it IS more secure.

    Deal with it.

  332. Then write them up and publish them. by khasim · · Score: 1

    "I can think of cooler hacks working along similar lines to accomplish the same ends more securely."

    The phrase is "put up or shut up".

    Or, to quote Linus, "show me the code".

    Other than that, you ain't nuthin' more then some wannabe kiddie with diarrhea of the mouth.

    Your example would require an OPEN PORT. DUH!!! It's is EASY to send data across an OPEN PORT. It is also EASY to SCAN for OPEN PORTS.

    Not try doing it with CLOSED PORTS.

    Nuthin' but a wannabe kiddie.

  333. Re:Ninnle Linux has this by Anonymous Coward · · Score: 0

    What are you talking about?

    www.ninnle.org