Active attacks using stolen SSH keys (UPDATED)
Last Updated: 2008-08-28 21:15:41 UTC
by John Bambenek (Version: 1)
The US-CERT is reporting that there is active attacks against Linux environments using stolen SSH keys. There is a new rootkit out, Phalanx2 which is dropped by attackers which, among the usual rootkit tasks, steal any SSH key on a system. The attackers then, presumably, use those stolen keys (the ones without passwords/passphrases at least) to get into other machines.
Sources of compromised keys could include the weak key vulnerability in Debian-based systems a few months ago, so if you haven't updated and replaced those keys, you ought to do so now.
The biggest defense is to have any keys, especially those used to authenticate to remote machines and certainly internet facing ones, require a passphrase to use. Check your logs, especially if you use SSH key-based auth, to identify accesses from remote machines that have no business accessing you. If you have IPs, that would be good.
To detect if you have Phalanx2, look for /etc/khubd.p2/ (access by cd, not ls) or any directory that is called "khubd.p2". /dev/shm/ may contain files from the attack as well. Tripwire, AIDE and friends should also be able to detect filesystem changes.
UPDATE: A couple of quick updates. Fellow Handler Bill Stearns mentioned several tools like this that can sniff out vulnerable keys. Also, here is some more technical details on the phalanx2 rootkit.
bambenek /at/ gmail \dot\ com