43 points · by thirsteh · 15y ago · 60 comments
So it seems quite possible that those who might mock running ssh on a nonstandard port or omitting a service version might never have seen actual pure examples of the practice. Perhaps in some years "defense in depth" will have become such a saying that people relying solely on not having bugs in their application will get bullied in a similar way.
Running sshd on a nonstandard port is not a security measure, it keeps your logs cleaner and saves you a few cycles.
I routinely do this. Not because I think it will enhance security, but because it will reduce the tsunami of braindead bruteforce attacks on my machines, and the associated resource consumption.
One night I woke up because my bedside MacMini (which I use for watching movies and listening to podcasts) spooled up its fan and was making a vacuum cleaner sound, something that I didn't experience before with this machine. With sleepy squinted eyes, I inspected the output of 'top' and saw SSH consuming 100% CPU or something. I switched off SSH in the System Preferences and the MacMini returned back to normal; and I went back to sleep. Next morning I moved the SSH service to another port (in the router) and haven't experienced this again.
My FreeBSD home server was bashed by a multitude of foreign clients, all trying to break in on port 22. The /var/log/auth.log showed hundreds of thousands of breakin attempts. When I reconfigured sshd to listen on another port, this dramatically dropped to almost zero.
Yes, but we're still working out the theoretical underpinnings of hash algorithms.
http://domino.research.ibm.com/comm/research_projects.nsf/pa...
Also, if one looks at past performance, it seems like it's only a matter of time before a hash algorithm is broken in some way.
http://en.wikipedia.org/wiki/Cryptographic_hash_function#Cry...
There is nothing wrong with obscurity, provided that 1) you don't use it as a replacement for standard security and 2) it doesn't interfere with the operation and auditing of your standard security.
Of course, you don't break password hashes by reversing the hash, you break password hashes by just trying (variations on) dictionary words until one matches the hash. For that purpose, SHA-256 is not a good choice, since it's too fast - use PBKDF2/bcrypt.
The primary reason you don't expose password hashes isn't that someone will break the hashing algorithm. It's that users come up with crappy passwords, and exposing the hashes would let an attacker do a brute-force search on the likely password space.
His other points are pretty good, though.
None of those "obscurity" measures do anything meaningful to improve your security. People just do them to make themselves feel less powerless.
Are you saying the zero-day exploit "todo list" isn't a valid concern? Mathematically, perhaps there is no difference because the focused penetration attempt overwhelms the equation, but if I'm just "some IP" on the Internet, isn't the less knowledge about me better?
It is very similar to the "secret military facility". The security of the facility is determined by what would stop somebody who knows about you, but you reduce the number of times that is tested through the "secret" (obscure) part of the base.
In short, you're right in theory, but in practice obscurity is pretty much never the right answer.
If you don't advertise your ssh (eg change ports) or your version, you aren't on that zero day list. Your system isn't more secure, but your are less likely to be hacked.
So, that's the scenario. The above has reduced your chances of being hacked without actually increasing how secure your systems actually are.
And then the question: how do you account for that in assessing the cost/value benefits associated with security? I really am curious about this, because there is a cost to the above, so any value should be included in the calculation of whether it is worth it. How do you calculate the value of not being on that list?
That's just not true. Consider a practical analogy: the access ID badges that many companies issue to their employees. Most of the time, these badges do not include information identifying the company other than a simple postal address. This isn't a strong security mechanism by a long shot, but does serve to make it more difficult to use a lost card. Often, more difficult is all it takes to make a casual attacker lose interest in the target.
Hiding version information is a lot like that. Which is more useful to an attacker: "ApacheTomcat 6.0.25" or "BigCompanyServer"? Sure, a sophisticated and dedicated attacker could identify the software you are running (often down to a version number), but that takes time. The time that takes is time taken away from the rest of the attack, and possibly enough of a timesink to deter some attackers.
I don't think anybody sensible is claiming that "hide your server version" is as important as "don't run a known-buggy version", but there is no doubt that both of these things have value.
Nowaways, you just run your ruby script and wait for the connectback shell. You might not even care if they're running a server on port 80. Either the exploit works or it doesn't; who cares why it doesn't?
Hiding version numbers does nothing at all to meaningfully improve your security. Exploits don't care about version banners. They don't not try the attack if they see the wrong version.
The problem with being complacent about obscurity is that sooner than later people think that obscurity implies security and fail to ensure that their systems are secure underneath the layer of obscurity. Then the system is only secure so long as what you've obscured is obscure. That is dangerous and must be avoided.
Can you can do it in less time than testing all ports until you find it? (an average of 2^15 connections?).
Also if you run it on port 22 and someone tries 22 then that will not trigger any port-scan-detectors. If you run it on port N and they are scanning all ports, you can block them before they find SSH.
It is obscurity, it's making finding/confirming SSH 1/65535 instead of 1/1.
All your comments here are of the nature "Everyone's an idiot. Ignore the explanations and arguments raised in the article they're just wrong. Trust me."
I hope my comments here are of the nature of "My mind is boggling as to why smart people think these measures are anything but laetrile." Also: do you think I'm just making it up? Don't be passive-aggressive. If you think I'm full of it on this topic, just say so.
For example, running ssh on an alt port = less likely to be picked up in a scan = less likely to appear in one of those lists of attack targets.
It's the old two guys being chased by a bear joke where one stops to put on shoes, so that he can outrun the other. In non-targeted attack situations little "obscurity" enhancements may mean the difference between being attacked and being skipped over.
At the same time, being secure doesn't mean you should be wantonly non-obscure. Even if you are using SHA-512, there's just no good reason to expose crucial hashes.
Of course, if you're using an algorithm that demands that you decide what to do with a salt, you're rearranging deck chairs on the titanic anyways.
Of course, if you're using an algorithm that demands that you
decide what to do with a salt, you're rearranging deck
chairs on the titanic anyways.
I'll bite: how do you store passwords securely?Giving advice and in general debating about a specialized topic like crypto is a touchy business. With specialized topics in general, those without deep domain knowledge typically get things wrong. And in a topic like crypto, wrong advice can have significant negative consequences for those that follow it. The reason why Thomas is taking you to task on this one is that your original post talks about secret salts. That's a big red flag that there is a lack of understanding of underlying, fundamental security principles.
If you expose the hashes to allow other people to authenticate your users, which I think the author suggests, 3rd party sites can simply cache the password the user provides for crunching and have BAM stolen their password.
Great post! I'm sure that you have been inspired by this comment http://news.ycombinator.com/item?id=2564263
No Disqus on your blog. Why not?