by tptacek · 10y ago · 0 comments
I do not believe that port knocking and single-packet authentication are good examples of this; both are sort of textbook examples of cosmetic security mechanisms that are made irrelevant by SSH public key authentication.
If there's a remote-root buffer overflow for sshd that does not involve login at all, doesn't hiding the sshd add quite a bit of value ?
That is, there are attack vectors that we know exist, and that we have seen in the past many times for server daemons, that occur before, and override, any authentication mechanism.
By hiding the service, you take yourself out of that population of low hanging fruit ...
You don't find that valuable ? I personally find it extremely valuable and consider port knocking to be one of the very few security optimizations that has such low cost/complexity for such a pronounced and well defined gain. I would not think of deploying an Internet facing system without port knocking on the daemons that don't need public access.[1]
But it's something.
Then the attacker can just compromise every single sshd on the internet and have enough bandwidth to bruteforce most port knocking setups.
How does public key authentication protect you from a 0day in sshd or something like the Debian OpenSSL Predictable PRNG key issue?
In a perfect world where there will never be a 0day in sshd or any further weak key issues, but we don't live in a perfect world.
The one time I've ever had one of my linux machines compromised was from CVE-2001-0144.
When the Debian key issue first came out all of my keys were vulnerable. None of my hosts were compromised because I used port knocking.
Look: it is legit to be paranoid about ssh zero-days (I am not, partly because that vulnerability is so valuable that I am very far down on the food chain for it). But if you're paranoid about those, be serious about them. Put an encrypted tunnel in front of sshd, not some goofy authentication scheme.
Remember: if there's a preauth sshd zero day, the SSH connections themselves are attack vectors. TCP is easily hijackable.
Sure.. but now you have to worry about vulnerabilities in whatever software you are using for that. Other than maybe something like a locked down spiped I wouldn't trust anything more than ssh in the first place.
From my perspective the nice thing about something like the 'simple non cryptographic knockd' was that other than decoding ip packet headers it did not read any data from the network.
> if there's a preauth sshd zero day, the SSH connections themselves are attack vectors. TCP is easily hijackable.
Hah, I am not that paranoid :-)
My main concern was always this sort of scenario:
I am on vacation with no internet access, an ssh (or openssl or openvpn) 0day is released, patches are not available. Do I come back from vacation to a compromised host? If I had not been using port knocking when the debian ssh key issue happened, I would have had multiple hosts compromised. So, you can call it goofy, but it made a very real difference in my experience.
The threat model here simply does not make sense.
In fact, it can give you a false sense of security from such 0-day exploits.
Really? How are they going to do this?
http://www.cipherdyne.org/fwknop/docs/fwknop-tutorial.html#w...
There are benefits beyond security: for example, less strange login attempts mean less clutter in your logs. If you're actually trying to investigate login attempts (don't!), it means less time wasted.
The "security by obscurity" screaming people are usually thinking too narrowly, in my opinion.
Running sshd on port 22, seeing repeated authentication failures in the logs. conclusion: business as usual for sitting on the internet. signal to noise ratio: almost 0.
Running sshd on port $RANDOM, seeing ANY authentication failures in the logs. conclusion: someone is specifically targeting me or my network, I might want to pay some attention to this. signal to noise ratio: 1.
With regards to the former, I emphatically agree with you. If you've been singled out by a competent attacker, you're subject to his statistical probing of your system, which is bound to reveal most (if not all) of the configuration/parametrization info you're trying to hide.
In the case of dragnet attacks, however, I emphatically disagree. There is asymmetric cost imposed upon the attacker: time.
Your door doesn't have to be impenetrable; it just has to be stronger than your neighbor's.
Thoughts?
Your home-made CMS isn't going to attract attackers because the spoils are limited to one site, and the code isn't readily available.
That doesn't mean your CMS is more secure; it probably isn't. But it's going to take a focused effort to attack, and an exploit becomes less likely.
Also such measures do not help any kind of a system that has to be really exposed. Want to hide your http and mail server behind a port knocking mechanism? A rarely supported or proprietary TLS method only?
What are those ways?
You can? how? I just logged into a server using port knocking. what was my knocking sequence? What do you have access to?
> I can deny you service by messing up your knocks by sending packets with a fake IP
Ok, I'm ready when you are.
> insanely inefficient in the amount of data and time spent vs the amount of information exchanged
I don't even know what this means. How is a few extra packets at the start of a tcp connection "insanely inefficient" ?
Replay attacks don't work against proper port knocking.
Take for example, knockknock-daemon. It sends just one SYN packet where packets IP and TCP headers are encrypted request to open a specified port. Port is closed after connection.
https://github.com/moxie0/knockknock/blob/master/knockknock-...