Note: Comments are owned by the poster. We are not responsible for their content.
I like the fact that the port knocking implementation is not written in C...
Are you under the impression that the code you found is the implementation, rather than an example? I can see where that would lead to some of your conclusions.
Don't want replay attacks? Encoding the source address in the knock sequence would help. Opening a nonstandard port for connection after a successful knock would be another way to go.
Worried about an exhaustive searching attack (and ignoring the time constraints)? Lock out addresses that complete a knock sequence and fail to immediately connect to the correct port.
Your 10% break-in figure if 10% of servers are using port knocking assumes that all port knocking implementations will be insecure. It also assumes that the cracker is going to be willing to waste the time necessary to attack every address, whether there appears to be a machine located at it or not.
I agree that you don't need to reinvent cryptography. Cryptography is not what port knocking is about. It's about not being the "low hanging fruit", and security in depth.
Reminder: There is nothing wrong with "security through obscurity", it's "security only through obscurity that's a bad idea.
Why? The attacker would need to see your network traffic to be able to make any kind of guess as to the port-knocking sequence, even if you use a fixed one with only handful of knocks. If even a thousand people have seen you knock on your computer, it's a reduction by a factor of a million or so, and the port knocking will have done its job well enough.
I agree with you that one has to be careful with security through obscurity, but it certainly can be used to reduce the number of possible attackers. We buy locks for our doors not because they're impossible to pick (or circumvent), but because they reduce the number of people who could do so, and the chance that they could do so undisturbed.
That said, I can't see myself playing with this 'port knocking'; it's all too likely to get stuck in firewalls or just be too hard to activate from someone else's computer.
Firstly, the unnecessary only-some-ports-valid "protection layer" complicates things. Suppose you decide on a list of 32 valid ports (the current implementation allows up to 256). How long does the port knock sequence need to be? You might think that since each port is a 16-bit integer, you need 8 knocks, so that you get 8*16 bits or 128 bits of security (virtually unbreakable). But since each port has only 32 possible values (5 bits), what you actually get is only 8*5=40 bits of security (trivially breakable)!
That gives a vastly different picture than the seemingly unending results from google. I have suspicion that googling also counts pages that include "OpenSSH: Not Vulnerable" in the body.
Using CERT's database, I count a grand total of 13 entries that deal directly with an OpenSSH vulnerability. Here they are, sorted by
date:
<TT>VU# 40327 06/09/2000 OpenSSH UseLogin option allows remote execution
of commands as root
VU#363181 12/07/2000 OpenSSH disregards client configuration and
allows server access to ssh-agent and/or X11 after session negotiation
VU#797027 06/19/2001 OpenSSH does not initialize PAM session thereby
allowing PAM restrictions to be bypassed
VU#905795 09/27/2001 OpenSSH fails to properly apply source IP based
access control restrictions
VU#655259 06/12/2001 OpenSSH allows arbitrary file deletion via
symlink redirection of temporary file
VU#945216 02/08/2001 SSH CRC32 attack detection code contains remote
integer overflow
VU#157447 12/04/2001 OpenSSH UseLogin directive permits privilege
escalation
VU#408419 03/07/2002 OpenSSH contains a one-off overflow of an array
in the channel handling code
VU#369347 06/24/2002 OpenSSH vulnerabilities in challenge response
handling
VU#978316 06/04/2003 Vulnerability in OpenSSH daemon (sshd)
VU#333628 09/16/2003 OpenSSH contains buffer management errors
VU#209807 09/23/2003 Portable OpenSSH server PAM conversion stack
corruption
VU#602204 09/23/2003 OpenSSH PAM challenge authentication failure</TT>
Odd, it's almost been an entire year since OpenSSH had a CERT vulnerability warning. And seems to contradict your assertion that OpenSSH is a leaky raft.
I certainly would like to read Theo's reaction to this article...
Of course, the real value of port knocking is in hiding open ports from port scanners.
But the point he is deliberately missing is that port knocking is an added, effective defense against being randomly targeted by worms, hackers and/or automated scripts. It does add a certain level of security, since so many attacks come from that route.
Both points are valid, and both points have their place. I personally think that since port knocking adds "some" value, that it's worth the effort.
* "The bear problem" is when you're hiking in the woods and start getting chased by a bear, you don't have to be able to outrun the bear. You just have to be able to outrun at least one of the guys you're with. The moral is if you make yourself a more difficult target, the attackers will move on to easier pickings.
Riiiiiight....
Posted by: Anonymous Coward on August 10, 2004 06:03 PMWe'll be waiting.<nobr> <wbr></nobr>:)
#