On Tue, 20 Dec 2011 14:33:23 +0200, Marko Rauhamaa wrote:
>
> Complete rpm -Va findings attached.
>
> I have no idea how the intrusion took place. The only possibilities that
> come to mind are the SSH server, which is open to the world,
That would be my guess
> or something hidden in a Fedora rpm.
I'll still go with a password attack at the server.
My recommendation, get backup procedure hard copy,
backup any needed user stuff and what not,
verify data is on backup media and is accessible.
Get restore procedure hard copy.
format the drive, disconnect cable from the Internet, clean install with
different passwords.
change/set PermitRootLogin without-password or PermitRootLogin no
in /etc/ssh/sshd_config
restart sshd. Connect Internet cable, setup your repositories, get
updates.
Install/run something like aide, osiris, ossec-hids, samhain,
tripwire, snare, integrit, .....
Reboot, restore from backup, tell users to change passwords, tell them why,
Why the above? you ask.
---------------- standard hacked/cracked text follows: ----------------------
Think about what happens when the cracker installs a rootkit.
The kit intalls programs which will not report the files/activities/ip
address which the cracker requires to run a stealth operation from
your computer.
An example, cat, grep and ls are modified to skip any line containing
the string crack_kit and/or an ip address(s).
Now doing a cat /etc/passwd or cat /var/log/messages would not show the
account crack_kit in /etc/passwd or logins by the account crack_kit in
/var/log/messages.
grep -v good_ips_here /var/log/secure would not show the cracker's ip address.
Or a script example to find a new .crack_kit directory:
cd /home
ls -a1 > /tmp/today
diff /tmp/today /tmp/yesterday > /tmp/results
if [ $? ] ; then
mail -s "ALERT: check /home " root@localhost < /tmp/results
fi
mv /tmp/today /tmp/yesterday
See your machine looks ok, nothing strange.
Remember, the better cracker has installed ALL the programs you use to
find the cracker's tracks, but the programs are hiding the tracks you
are trying to find.
For a good crack to go unnoticed, the cracker stops all monitoring
programs tripwire, swatch,...., logging programs sysloger,...
installs the rootkit, removes tracks from current logs, removes any
mail in root's mailbox, enable all the previous disabled
monitors/loggers.
Now if you had the logs being updated or mirrored on a different
machine with programs monitoring those, then you have a chance.
To check your machine you could load the binaries used to look for
cracks on a cd, and use those to audit the system.
Now /cdrom/bin/cat /etc/passwd would show the crack_kit account.
To check your installed rpms
/cdrom/bin/rpm -Va | grep '..5' > /tmp/verify.log
diff /tmp/verify.log /floppy/verify.log
You could do /cdrom/bin/md5sums on all the */bin/* files and store the
results on cd and compare results to find new/modified bins.
Of course, all the baseline results have to be agains the box before
is is ever connected to the network. :)