[svlug] Need help with diagnosing compromised Linux system
David Masten
dmasten at piratelabs.org
Thu Apr 21 13:36:14 PDT 2005
On Thu, 2005-04-21 at 09:19 -0700, M. A. Sridhar wrote:
> I want to understand how it happened and how to prevent it from happening
> again.
Not having the harddrive, and not knowing what you have or have not done
with the machine prior to the break in, I'll just comment on a what may
have happened. IOW, how these things usually go.
Certain versions of sshd have an exploitable hole in them, IIRC RH 7.x
came with exploitable versions. So if you haven't updated the ssh
packages in a while, that was probably how he got in.
The attacker had a script that takes advantage of the hole remotely, if
he used the vulnerability that I am thinking of he had root access at
that point. From there he installed one or two rootkits.
If he attacked some other hole, he probably did not get root access
immediately, but rather used the user access he had to then exploit
another hole locally, such as exploiting a kernel vulnerability.
Rootkits usually come with a whole slew of programs, including
replacement 'ps', 'ls', 'find', and other utilities. The replacements do
not display the processes or files from the rest of the root kit. This
is why I suspect the attacker may have installed two rootkits - the
second kit is not aware of the first so displays the first's files
normally. Of course he may not be using a very good rootkit and just
attacked the vulnerabilty a second time.
In order to figure out what all happened, you need to boot from a Live-
CD and then mount your harddrive. The live CD will give you clean
utilities that won't hide files. There are also methods to do md5sum
checks between the hardrive and the various RPMs on the install CD's or
from the redhat mirrors.
Going forward, do not reinstall RH 7.2 it is rather old. Install a
distro that has automatic updating features. Most folk around here like
Debian (apt is truly awesome!), if you prefer Red Hat's style then get
Fedora Core 3 (yum is good, and it is what I'm using for many things),
or you can go with Red Hat Enterprise Linux workstation 4 (costs money
though, and I am not impressed with up2date).
Hope this helps,
Dave
--
David Masten <dmasten at piratelabs.org>
More information about the svlug
mailing list