Cryptographically Hiding TCP Ports 206
JohnGrahamCumming writes "The shimmer project implements a cryptographically-based system for hiding important (e.g. SSH) open ports in plain sight. By automatically forwarding from a range of ports all but one of which are honeypots and by changing the ports every minute only a user knowing a shared secret can determine the location of the real SSH server."
Neat in theorey, imho. (Score:4, Interesting)
I manage quite a bunch of remote systems, each one equipped with OpenSSH for adminning and OpenNTP for syncing system clocks, yet their local clocks still drift a little over time; sometimes easily up to quarter a minute or more. So if the interval of changing ports is too narrow, one would eventually lock himself out of the remote system because of unsynced clocks and a wrongly computed destination port. Sucks big time.
At the end of the day, choosing some non-standard port in the 30000+-range for sshd (mostly to save logrotate some work by keeping futile scriptkiddie-login-attempts out, but anyway) and turning off password-authentification in favour of pubkeys still provides enough security for just about anybody. Services that don't allow for such measures may be tunnelled over SSH (or e. g. OpenVPN, for more demanding protocols/apps) with ease, again rendering the project's idea somewhat moot to me.
Re:Neat in theorey, imho. (Score:4, Informative)
Re:Neat in theorey, imho. (Score:4, Informative)
Re:Neat in theorey, imho. (Score:4, Interesting)
It should theoretically be impossible to snoop the port not (by virtue of it not being used), but it will be there if and when it is needed.
You could even have it as a seperate 24 hour updating set, long enough that no one should fail it, but still makes snooping it fairly useless.
Of course with up to 3 minutes to used snooped port pattern it is not completely invisible.
If security was super high, and there were a limited number of people needing to access, you could have the login give you an 8 digit code and you would enter that into the client next connection, and it would use that to pick the ports to knock. This would make it impossible to access SSH even after snooping an exchange.
It could also wait 3 minutes before allowing another connection, in the interim running a daemon that accepted and login and spit out "please wait 3 minutes" instead of a real prompt.
Re:Neat in theorey, imho. (Score:4, Interesting)
SSH implementations have defects (Score:3, Insightful)
Re: (Score:2)
Re: (Score:2)
The new authentication is much simpler and incredibly secure from my perspective: use a personal password concatenated to a 6-digit number displayed on a separate keyfob-style authentication token. This number changes every 30 s
Re: (Score:2)
Re: (Score:2)
I don't know, I don't like this at all. It's obviously abuse of TCP/IP, ...
No reason it has to be implemented in TCP; coudl easily be implemented as UDP "knocks". Alternatively, if one wanted a more robust solution, you could implement a service that opens a range of ports, and you "knock" the ports in a certain order and send a certain set of data during each known via regular TCP. Incidently, the point behind port knocking is to NOT have your service (SSH in this case) actually listening on whatever port until you "knock" correctly.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
If security was super high, and there were a limited number of people needing to access, you could have the login give you an 8 digit code and you would enter that into the client next connection, and it would use that to pick the ports to knock. This would make it impossible to access SSH even after snooping an exchange.
It could also wait 3 minutes before allowing another connection, in the interim running a daemon that accepted and login and spit out "please wait 3 minutes" instead of a real prompt.
Or you could use public key authentication for your SSH security rather than just passwords. I have a 1 in 10^8 chance of guessing your 8 digit code. You have a 1 in 2^1024 (often less) chance of guessing the correct private key. Combine that with blocking brute force attacks [bgnett.no] and that's all the security you practically need.
Re: (Score:2)
Re:Neat in theorey, imho. (Score:5, Insightful)
Once someone logged into that server using their own key or pass phrase, the only command they could run was ssh. All the other servers in the network only allowed ssh in from that ssh box, and by policy their keys and pass phrases had to be different on the ssh server than on the internal boxes. Each failed attempt at logging in caused a 5-second wait, and after three a 12-hour wait.
Is it as secure as having the real port hop around and synchronizing that with the clients via a shared secret? Well, I guess that depends on just how secret the shared secret is. We never had any problems, though, and the only thing our people had to take with them were the name of the server, their private key or passphrase, and the proper port to use. They usually didn't have much problem remembering three of those, and the you have the same issue with private keys no matter what (that being that they're only as secure as the system on which they are stored).
There's probably some security advantage to the solution presented in TFA, but I'm just not sure it's worth the extra coordination hassle compared to people's home-grown solutions. It seems like every fifth post in the comments is about alternative ways to safeguard ssh ports. Surely not knowing which someone is using provides a bigger hurdle than getting past any single one of them. When you're practicing security by obscurity, which is what this really boils down to, then being more obscure is probably a good thing.
The best fix for brute force is the old idea you mention of an enforced wait between attempts. It's a pain when you're locked out of a server you're legitimately allowed to use, but it's very useful to keep brute-force attacks down. Giving a couple of chances with a short wait and then imposing a much longer once after 2 to 5 tries seems to be a pretty good balance.
Use a different network to delete blocks (Score:2, Interesting)
Add to this a nokia phone and a data cable, gnokii, and a script that when it receives a SMS from a specific phone number with an IP address
Re: (Score:2)
Which would be so easy to implement in openssh. Seems silly not to have it there as a standard feature.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Really? How often do you run NTP? I've run it once a day for 20+ years and I've *never* had my server out of sync for more than a second or two between synchs. Maybe you're running crappy hardware?
Re: (Score:2)
But if you have ever used one of those RSA generators you will find that it will sometimes take three or four attempts before connecting to your VPN. This is even with the valid pass-key.
Sometimes being too smart is the wrong answer.
Clock drift not an issue (Score:2)
Re:Neat in theorey, imho. (Score:5, Interesting)
1. An ntpd not only syncs time, but adjusts the running speed of the kernel clock. Otherwise it would be nothing more than a ntpdate cronjob.
2. Under GNU/Linux, the local clock may be used to initialize the kernel clock, but those two run independently of each other until shutdown (or manual set). Only then the local clock is set to the kernel time, regardless of what the local clock was doing all the time.
Re: (Score:2)
Something else that many people don't get where OpenNTPD is involved is that it is not the same as ntpd. I haven't kept up with openntpd development recently, but the last time I checked it only implemented the SNTP protocol and was noticeably broken in how it implemented many parts of NTP.
It's still fine for what it does, but don't confuse it with a real NTP server.
Re: (Score:2)
You can set Linux to sync your hardware clock to kernel clock.
And usually it's a hardware issue; hardware clocks are quite often rather crappy.
Re:Neat in theorey, imho. (Score:5, Funny)
Re: (Score:2)
Re: (Score:3, Informative)
If your ntp-enabled systems are drifting 15 seconds out of whack with each other, you have bigger problems than additional SSH security.
Yes, it's called Linux on VMWare. There are workarounds, but they involve recompiling the kernel, setting boot options, and VMWare tools settings. Without the workarounds, even with ntp enabled, clocks can skew on the order of seconds every minute. I've seen systems get a minute out of whack in under ten minutes. With some settings, ntp actually makes it worse, as ntp and VMware perform dueling clock-skews.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Insightful)
Honestly, people spend way too much time worrying about hiding their SSH ports. Use public key authenticat
Re: (Score:2)
Any server you have that's no
Re: (Score:2)
"Obscurity" tag is misleading (Score:5, Insightful)
Still, requires a shared secret plus synchronized clocks, and any mistake automatically blacklists you. Sounds ridiculously impractical IMHO.
Re: (Score:2, Informative)
It's all fun and games till you've locked yourself out from an only remotely accessible server...
Re: (Score:2)
Re: (Score:3, Insightful)
Frequency hopping has a much broader domain to "hop" across.
Frequency hopping requires the communication to keep hopping even after it's established. Not only can't you connect without the key, you can't even keep a conversation going without the key. You can't hear or be heard at all, in fact.
To someone without the key, frequency hopping "looks like" random noise. This works becuse there is random
Re: (Score:3, Informative)
No, it doesn't. It looks pretty much like you'd expect -- spikes in power more-or-less uniformly (but discretely, not continuously) distributed over some part of the spectrum.
Check this link for pictures:
http://www.metageek.net/docs/sample-recordings/video-baby-monitor [metageek.net]
Re: (Score:2)
the fact that a baby monitor implements FH very poorly does not so much reflect on FH technology as much as it does on this particular product.
Re: (Score:2)
Of course it does. There's no free lunch; introducing noise into the 802.11 signal will reduce the 802.11 throughput.
A device which uses FHSS for privacy will look basically the same on an analyzer. The difference would be that the frequency sequence woul
Re:"Obscurity" tag is misleading (Score:5, Interesting)
Actually, it gets better than that... (Score:3, Insightful)
If you are a competitor of these guys, simply forward people silently to one of their ports in a hidden iframe.
Bingo, permanent ban.
Re:"Obscurity" tag is misleading (Score:5, Interesting)
So to keep this in the same context of the article, what if the hacker picks the correct port right off the bat? No black listing, no honey pot, no security other then what was already there without the system. but better yet, what if there was 1000 ports operated in this manor, Could I effectively find the right port by using 1000 zombie machines to connect and then see the response on a second connect attempt to see when the blacklisting comes about? I'm willing to bet that the first connection that survived the longest without black listing is the correct port. So now I can attempt to exploit the server on that port to gain access.
I would think it adds a level of security and might stop the average script kiddie but I'm not sure that it is a level of security beyond the equivilent of security through obscurity.
More or less obscure than password encryption? (Score:2)
Re: (Score:2)
Re: (Score:2)
Non-obscurity based security systems often have open algorithms--the user
Re: (Score:3, Insightful)
Well, this is still security through obscurity.
In that case, isn't cryptography just "security through obscurity" since the real key is buried in known iteration of numbers?
Re:"Obscurity" tag is misleading (Score:4, Insightful)
Now if I am not understanding something correctly and you need the key to even get access to a/the port then I am wrong. I mean if the ports are all blocked and the key opens them for you to attempt authentification? But as I understand it, the port it already there and exposed along with numerous fake ports, you just don't know which one it is without the key and that is obscurity.
If this is how I am thinking, then combining it with something like port knocking where the ports aren't even available until another challenge succeeds might make it better.
Re: (Score:2)
That is why security through obscurity is a bad idea, it gives you the false sense of added security.
Re: (Score:2)
Isn't this port knocking (Score:5, Insightful)
So while this is a little different, it's inferior.
Re: (Score:2)
Re: (Score:2, Informative)
Re: (Score:3, Interesting)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Excuse me, but I have had enough. (Score:2)
Whatever happened to just plain good passwords (including a little helper for good measure [fail2ban.org]), TCPWrappers, sensible firewalling and ssh private/public keys?
I could understand this type of security with more brittle services, things that can be hacked, but this is IMHO going way oervboard.
What are these passwords, kemo-sabi? (Score:5, Interesting)
Re: (Score:2)
Re: (Score:2)
Not so smart, though. (Score:3, Insightful)
In both cases you need to keep a crypto key secret otherwise you'll end with secuity hole. A shuffled one, but still a hole.
Complete Waste of Time (Score:3, Insightful)
1) Another piece of information needed
2) If your SSH server has a buffer overflow or similar in it.
And both seem useless.
1) You are surely going to keep your SSH key in the same place as the code to access this thing. If you wanted a similar level of security, why not hide your SSH key in two pieces?
2) Now we have to completely test two programs instead of one.
Seriously, what security problem is this supposed to fix?
No, that *is* the reason for this approach (Score:2)
But your Reason 2, SSHd bugs that might be security holes, is the problem this is trying to address. Various deployed-in-the-real-world SSH implementations have had security holes, and crackers and skript kiddies do go hunting for them, and even if your implementation has been patched around the existing holes, you can still get your logfiles cluttered up with scanning events, plus crackers are always
Port knocking? (Score:2)
Interesting... (Score:2)
not as good as port knocking (Score:3, Informative)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
As I said in my top post, I like the article's idea, just not the implementation. For instance, use 1,000 ports and change the three-knock c
stealth (Score:2)
I have an alternative proposal. Have a udp or icmp service where, before connecting to a tcp server port, a client must send
Re: (Score:2)
Distributing Cracking (Score:4, Interesting)
I wonder if the DDoS would bring the server to its knees first, though.
Hm (Score:2)
Re: (Score:2)
Potential DoS scenario? (Score:2)
Mind you, an IDS will probably see this activity and if there's an IPS it may be able to block the fake packets. Mind you, most places don't have that.
Re: (Score:2)
I'll bet a LOT of routers are built the same way.
DenyHosts SSH script (Score:2, Interesting)
I use the software script Denyhosts which runs whenever an SSH connection comes into the system
http://denyhosts.sourceforge.net/
You simply set the Account / IP address lockout threshold and so after X number of failed login attempts the system will put the connections source IP address into the hosts.deny file. The IP address stays there until eventually released, or it can stay there foreve
Time to break out infinities (Score:3, Interesting)
Clearly some aspects of computers not as sexy as high speed graphics lag behind, as some examples the number of bots, the number of ports, the number of concurrent connections (10K problem) and the data transfer speeds possible by consumer hardware, especially when divided by storage media size, all seem to be relatively small numbers still. A ton of bots can game this game, etc.
Obviously it is time to break out the heavy math. First imagine if instead of having only measly thousands of ports you could use a floating point number to designate a port. It's not like we have thousands of ports in hardware right? Meaning virtual port addressing. Needs a big botnet to get through that. You could make the system answer on any port, or only answer on those which are being used. Well floating point still may not have a lot of significant bits to hack, so time to break out the math.
I think Rudy Rucker could have some good ideas for computer security. Not that I'm a mathematician or anything, but if you read his latest book minus 1 there are plenty of descriptions of navigating infinities. If you had a transfinite number of ports I think you might even be able to prove that the obscurity is more secure than anything else in the real world. So while it is a bit of a ticklish idea I'd very much like to see a math-minded hacker think about what would be involved in designating such a number or abstract symbol representing it and using that as a destination address. Thank you.
About the whole Time Sync'ing thing... (Score:2)
That way it wouldn't matter if the server, the client, or both are totally out of sync with reality!
Still, i don't see any advantage of this to simply using a fixed port that blacklists any client after a set number of failed login attempts. I mean if the attacker tries to guess he would get blackl
Re: (Score:2, Insightful)
Re: (Score:2, Informative)
It seems too easy to get locked out as one slip blacklists you.
I was shocked to read that even with NTP, some servers' clocks drift so far - I thought it could keep them +/- a fraction of a second worst case (ah, when reality bites)
Re: (Score:2, Informative)
No, no, no! A password is a *key* and has nothing to do with obscurity. The quote you refer to is using obscurity to mean enhancing an algorithm by "keeping its process a secret." That is not the case here.
See Security through obsecurity is no security [blogspot.com] and Security through obscurity [wikipedia.org]
Re: (Score:2)
Re: (Score:2)
At the very least, it's shared. This makes it unsuitable for use on a multi-user system, but if that's ok with you, then fine. It also, ultimately, hashes down to a pretty small set of values (ports). All this to
Re: (Score:2)
You've just reinvented Port knocking [wikipedia.org]. And why bother encoding the reply IP in the payload? The packets themselves have the reply IP on and if the idea is that your payload is encrypted verification for the IP, that'd be a real pain in the arse if you're ISP allocates dynamic addresses - just use public key auth for your SSH endpoint when it uncloaks instead.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Of course, since the port changes every minute, that gives very little time for the attacker to crack it before he has to find a new port. Nonetheless, if you're relying on this for security, it seems like a pretty bad idea.
Re:Newbie Question about SSH Security ... (Score:5, Informative)
Passkeys can be relatively secure, or they can be relatively insecure. It depends on the level of security you're implementing in them. Another really easy way to secure it is to make it more trouble than it's worth to break into it. I have my SSH on the standard port of 22 on my server, and am not worried about security at all. I subscribe to the mailing list and it's kept up to date every time a new release comes out. More importantly, my SSH server is configured to only allow one user ID to log in, and to only allow one password attempt before disconnecting. It also doesn't disconnect until after you've entered the password, and will give the same error message no matter what, so you've got no way of knowing why it is that you're not getting through. Finally, the user name in particular that's allowed to log in through SSH doesn't have an e-mail account or home directory, and isn't published anywhere.
No, that isn't going to secure it entirely. It is, however, going to make breaking into it incredibly time consuming and generally not worth it unless you have a personal vendetta or other reason to go after me specifically. Security through obscurity. In this case, get away from Default Pass, and towards Default Reject security model.
Re: (Score:2)
It's not what they can do with your files. It's what they can do with your computer. :)
And yes, that was in reference to the key itself. The size, but also the algorithm used to implement