Compromised SSH Keys Lead To Linux Rootkit Attack 79
Tech Groupie writes "The US Computer Emergency Readiness Team (CERT) has issued a warning for what it calls 'active attacks' against Linux-based computing infrastructures using compromised SSH keys. The attack appears to initially use stolen SSH keys to gain access to a system, and then uses local kernel exploits to gain root access. Once root access has been obtained, a rootkit known as 'phalanx2' is installed."
As usual... (Score:4, Informative)
Change your keys regularly, and revoke the key as soon as you have the slightest doubt it's been compromised.
Re:As usual... (Score:4, Funny)
Change your keys regularly, and revoke the key as soon as you have the slightest doubt it's been compromised.
/me gives Redhat a dirty look.
How is this news? (Score:5, Insightful)
The attack appears to initially use stolen SSH keys to gain access to a system
Ok...so if you get the key to a machine you can get in and abuse an old vulnerability, assuming the machine in unpatched. The rootkit that they discuss is from 2005, so where's the news here? Be careful about your SSH keys and passwords?
Seriously, if there's more to this I'd like to know. The article hardly has more information than the summary.
Re:How is this news? (Score:5, Insightful)
The news is that this is probably fallout from the Debian OpenSSL fiasco, and that people should take it seriously pretty damn quick and get their keys changed.
Re: (Score:2)
Do you have any evidence for that?
I know that Debian handled that pretty aggressively. Too bad for anyone who somehow missed the memo.
Re: (Score:3, Informative)
No, I just actually read the article.
Details on the attacks â" and targets â" remain scarce but itâ(TM)s a safe bet this is linked to the Debian random number generator flaw that surfaced earlier this year. A working exploit for that vulnerability is publicly available.
Re: (Score:2, Insightful)
So you don't have any evidence. The quote you give is as much speculation as your original post.
Mart
Re: (Score:1, Insightful)
*I* don't have evidence for this, but the weak version wasn't just weak but RIDICULOUSLY weak -- 65536 keys. An exaustive scan can be done against these!
Re: (Score:2, Informative)
It was worse. The only entropy was the process ID.
That means the *likely* seed for longer running system processes was in a subset of the low couple of thousand.
For user processes, well starting low and ending higher would eat up keys like no tommorow. One researcher successfully made an exhaustive scan in around 48 hours on a small cluster :S
Re: (Score:2)
At a guess, some government systems that are not updated as often as they should be, not as well maintained as they could be or even not as securely configured as they should, say, banking and finance Linux, ISP, etc. install, were successfully attacked. As such a warning has to be issued to remind other slack admins to update their systems.
As for where the stolen SSH keys were originally obtained, a certain Olympic event springs to mind, so the effort might be fairly wide spread and a concerted attack t
and (Score:4, Informative)
change your ports other than 22, this won't stop a full port scan but good against lamers scanning for port 22.
And you ip restriction. if you don't have static ip at least block connections outside of your connected isp.
you may also use port knocking protection.
these are not panacea but better than nothing.
Re: (Score:1, Funny)
Re: (Score:3, Funny)
Dude, that's like building an electronic voting machine and putting anti-virus software on it.
No, wait...
Re: (Score:2, Funny)
Condoms are only effective at reducing relative risk vs unprotected connections by about 70 to 85% - source [wikipedia.org]. As always, the only safe way is abstinence! Not that anyone around here will listen to that; I bet most /.'ers are in promiscuous mode...
Re: (Score:2)
What, peeking in on others in the neighbourhood having sex?
Re: (Score:3, Insightful)
However abstinence is 90% less fun - source [youporn.com]
not that this has anything to do with the topic but 70-85% indicates they are doing it wrong, with proper usage, assuing that you get actual sex education not abstinence bullshit, that figure should be up to 90-95%
Re: (Score:2)
I think he was saying that it provides 70% to 85% _more_ protection against (infect|pregnancy)? than using nothing. However, using nothing isn't a 100% guarantee of becoming (infected|pregnant)?, so if unprotected leaves you with, say, a 50% risk, then protected would leave you with between 7.5% and 15% at risk (85% to 92.5% safe) .
If my math is right, which I won't vouch for.
Re: (Score:1)
Re: (Score:2)
As always, the only safe way is abstinence! Not that anyone around here will listen to that
You're joking, right? Our userbase are the poster children for abstinence. "Abstinence through disciplined self-stimulation," that's our motto. Hell, I'm married and I've been abstinent for as long as I can remember. (Which actually isn't that long thanks to a rigorous diet of beer.) What was I saying?
Re: (Score:3, Funny)
Does that make abstinence preconceived murder?
Re: (Score:2)
What do you have against Bobby Ext?
Re: (Score:3, Insightful)
SSH is not available remotely on any of my servers. The only way to access SSH is to VPN in, using OpenVPN.
All SSH traffic is blocked at the firewall.
Re: (Score:2)
That's as good an argument as the one, that a heavier car protects their occupants better in case of an accident, and that we should thus all drive SUVs and other heavy vehicles...
Once everyone (or just noticeable number of people) put their sshd on a different port, nmap-style quick scanners will become part of the toolkits and quickly proliferate among "the lamers". Oh, and you'll be forced to
This just in: (Score:5, Funny)
Stolen login credentials leads to unauthorized access of computer resources!
Re: (Score:1)
Re: (Score:3, Insightful)
The point is "defense in depth".
If you don't accept SSH connections that aren't coming over your trusted, separately-keyed VPN, for instance, this is pretty moot.
If you've disabled loadable modules, remounted your root filesystem read-only and dropped capabilities to remount read-write (and otherwise hardened against rootkits), this can be pretty moot on that account too.
If you aren't doing those things, maybe you should think about it.
Re: (Score:2)
Re: (Score:2)
google linux capabilities
Not without a reboot.
OpenVPN supports sharing a port with a more conventional SSL server in TCP mode.
Re: (Score:1, Funny)
I only eyeball the packets that have the evil bit set.
Oh noes!!1! (Score:2)
You mean if someone steals my SSH key, they can then use it to log into my account??? And if that SSH key is in the authorized_keys file for root, or if I have sudo set not to prompt for a password, they could install a rootkit?!?!? Why didn't someone tell me this earlier?!?!?!
Re:Oh noes!!1! (Score:5, Informative)
If you generated that key with Debian within the last two years, anybody can figure it out in minutes, remotely.
Re: (Score:1)
Sounds a little exaggerated. Unless you mean "minutes" in the loosest sense, as in anywhere from 0 to 10^3000 minutes.
Re: (Score:2)
Sadly, it is not. Read up on the Debian OpenSSL fiasco to see why.
Re: (Score:2)
The good thing is that besides generating better keys after the patch, patched debian systems will refuse to authenticate on a broken key!
Thus, your broken keys become useless, and you're forced to generate new ones. Moreover, if there are "old" users on a system that no longer actively login on a system, they wouldn't notice the key no longer working. However, the patched system will refuse to authenticate the broken key.
Hmm. come to think of it, there remains a risk of people copying bad debian keys onto
Re:Oh noes!!1! (Score:5, Informative)
What it means is that there are apparently some administrators not running Debian that have naively thought that the issue didn't affect them. However, if they haven't blacklisted those keys, they will undoubtedly have some users that generated their keys on Debian, which are vulnerable.
The worm will exploit this to obtain local non-root user access, and through local privilege escalation exploits will obtain root. Then, they will steal the keys stored on the host that might be used to connect out to other hosts. The last part of this is the deadly part, because those keys are not blacklisted, and will thus connect to and infect the hosts that don't have vulnerable-old-debian keys.
What this means for me, as the administrator of a web hosting company that has patched their servers, is that we will undoubtedly see illicit login attempts. With some really bad luck, one of those login attempts might work, despite our patching. Then, we are at the whim of how well we're secure against local privilege escalation.
Re: (Score:3, Insightful)
How does the worm know what username to try to break into prior to escalating to 'root'?
Re:Oh noes!!1! (Score:5, Informative)
With the exploit, breaking the key is a matter of minutes. The worm could try to crack them all hoping to find one generated on a debian box and not updated.
Re: (Score:2)
I know know what this worm is doing exactly, but it could try random usernames, or simply usernames identical to that the key was stolen from (if stolen from local user eric, try remote user eric). A really smart worm would even check the known_hosts file, to direct its attack to the most likely hosts to contain a matching public key.
Re: (Score:2)
Sorry, I meant to write, "I don't know what this worm is doing exactly".
Re: (Score:2)
It is a worm so the trick is spreading. It can get very far by trying the same username for all the hosts in the known_hosts file even if it cannot get root. It can also look at /etc/passwd for other users and try to spread that way to other hosts. If it can get root with a local exploit, it can look at everyone's known_hosts for more places to try and spread to. Also with root it can look in the comments of the keys and log files for more targets and usernames. Basically if it can get to 1% of the hosts th
Re:Oh noes!!1! (Score:4, Interesting)
so in an ironic twist people using debian are in the safest position.
Re: (Score:2)
No if you have a user that logs in via ssh keys and that user generated the keys on an affected Debian box, an attacker can get in. Then they use a barrage of local root exploits to gain root, not a passwordless sudoer.
New attack vector! (Score:3, Funny)
This may rival the DNS vulnerability.
Debian compromise: probably related... (Score:5, Interesting)
Even the openssh guys don't seem interested in including blacklist support for probably-compromised keys: see https://bugzilla.mindrot.org/show_bug.cgi?id=1469 [mindrot.org]
This means that, since the compromise arose, Debian and Ubuntu distros are safe once patched with the blacklist code. However, for keys generated on Debian/Ubuntu but uploaded to non-Debian/Ubuntu servers, those non-Debian/Ubuntu servers will still be vulnerable unless manually checked. This means: OpenBSD servers, Fedora servers etc.
Have any distros apart from Debian/Ubuntu provided blacklist-like tools for this issue? Any of the *BSDs?
Re: (Score:3, Interesting)
"OpenSSH now has a blacklist feature for weak Debian-generated ssh keys." From: http://www.dragonflybsd.org/community/release2_0.shtml [dragonflybsd.org] Please do just a LITTLE bit of research before posting.
Please do some research before telling someone else to do research before posting.
DragonflyBSD is a fork of FreeBSD and not exactly mainstream so you can hardly accuse me of not being aware of what it said. Further, apart from that remark on the page you linked-to claiming that "OpenSSH contains a blacklist feature",
Re: (Score:2)
Not really it looks like the DragonflyBSD folks added the Debian patches and these are not to be found in the OpenSSH sources. But that is sort of a joke actually. The tool is called ssh-vulnkey, and you can find a patch for it here:
http://people.debian.org/~cjwatson/openssh-blacklist.diff [debian.org]
There is a man page for it, here is an online version:
http://www.tin.org/bin/man.cgi?section=1&topic=ssh-vulnkey [tin.org]
What it does is a binary search of key files against /etc/ssh/blacklist.TYPE-LENGTH files. It can be used
Re: (Score:2)
I just realized that what was done is that all plausible Debian DSA 1024 bit and RSA 2048 bit weak keys were hashed and some bytes stripped away into a more than 7 MB of files. Ouch!
I don't think that is comical anymore just not practical. What if someone had a key of a different size for example? Also what about someone with a valid key but when you strip away the 12 bytes of the hash now it matches? What about servers with time/space constraints?
Re: (Score:2)
Remind me again, why in the world would I be running my OpenBSD server with the keys to it's SSH sever generated on a Debinin/Ubuntu machine?
That's not the problem. The problem is user keys (not server keys) generated on a Debian/Ubuntu machine which are then uploaded to a server. Any server. Running any distro/OS which is capable of running sshd.
I am invulnerable to this attack! (Score:2, Funny)
I have sucessfully computed a easy and 100% affective plan to stop this attack I have cleared the cookies, defragmented the memory drive, emptyed the recycle bin and set the Internet security zone to 'high'. Last off all I downloaded the latest Linux Kernal and extracted it to C drive.
Now it will not affect me i advice everyone else just follow these simple steps and you will be safe to.
And the news is? (Score:2)
This is a standard attack. The only thing SSH specific is that many users set up their accounts to be able to do password-less ssh login. Incidentially I do this to, since I am running mostly identical installations at both ends anyways. The only additonal risk (if any) is that an attacker does not need to wait until you do a login (ans sniff your password), but can go ahead immediately.
Side note: I do not think this has anything to do with the recent debin vulnerability. For that one you do not need to ste
Re: (Score:1)
If an attacker can sniff your login password during an SSH connection, you're already fucked anyway.
How can I figure out if a key is affected? (Score:1)
Re: (Score:2)
Debian put together a patch:
http://people.debian.org/~cjwatson/openssh-blacklist.diff [debian.org]
There is a tool in there called ssh-vulnkey and you can get the blacklists from debian here:
http://ftp.de.debian.org/debian/pool/main/o/openssh-blacklist/openssh-blacklist_0.1.1.tar.gz [debian.org]
You need to run the install script as some bytes get stripped from the provided blacklist files.
Re: (Score:1)
Deny-hosts (Score:3, Informative)
Re: (Score:2)
1) Move the external SSH port to some other port number. Easy change. A minor road-block, but one that works well at cutting out about 99% of the attack attempts. Plus, if they have to port scan the server to find the SSH port, it gives you an opportunity to detect the scans and shut them down.
2) Don't allow root to login over SSH. You'll still see a lot of people who haven't disabled that...
3) Force users to use SSH keys to authenticate (no password-based authentication).
Use DenyHosts (Score:2, Informative)
New Huge Linux Security Hole! Linux Under Attack! (Score:1)
U.S. Computer Emergency Readiness Team (CERT) has identified a potentially disastrous new security flaw in the 2.6 branch of the Linux operating system. This flaw, if exploited, can allow a machine to be compromised completely and a new rootkit called "Ubuntu LiveCD" can be used to make whatever changes the attacker wishes to the Linux operating system.
We've found that if an attacker can gain physical access to the computer they wish to compromise, they can insert this rootkit CD into the drive and press t
SSH should be locked down in any case (Score:1)
Any SSH daemon listening on the public network should already be locked down to a basic level (denyhosts, changed port, IP-based access controls) in any case. I guess some installations will not be able to implement all of these but they are in the minority.
I'd take an educated guess at the vast majority of SSH daemons being used for remote administration; at the very least the controls mentioned above should be in place! Sure, this won't make you invulnerable, but the default denyhosts configuration alone