LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   A "recipe" to check server security briefly (https://www.linuxquestions.org/questions/linux-security-4/a-recipe-to-check-server-security-briefly-539479/)

x42bn6 03-21-2007 07:40 PM

A "recipe" to check server security briefly
 
Alright, I help run a forum that runs an old version of RedHat and I don't have full access to the server but I do have console access. I intend to check the server every day for weird things happening. If it is possible for anyone to give a list of commands they recommend to run? I can interpret a few things and I notice suspicious stuff easily. Obvious ones are probably lsof and dmesg, any others?

fukawi2 03-21-2007 09:05 PM

Some basic tools to add to that would be last, lastlog, lastb, cat /var/log/secure, top

That is assuming that if your server is compromised, then the intruder hasn't modified those programs to hide their activities (ie, a rootkit)

chkrootkit and rkhunter are some good programs to help detects rootkits, although there are some caveats to look out for in running them. Another good tool is LogWatch which will give you the daily highlights for your log files.

If you're really paranoid and can spend the time setting it up and configuring it, have a look at OSSEC HIDS - I run it on my publicly accessible mail server and it's quite annoying, but I always know when there's something unusual happening...

pileofrogs 03-22-2007 03:51 PM

netstat -an | grep LISTEN
df -h
uptime
free

Are personal favorites of mine. They're not really about detecting if you've been haxored, but more about detecting if things aren't as you hope they should be. And you can put them in a cron job and get the results emailed to you every day, so you can do that daily check every day without having to remember to log into your box.

OlRoy 03-22-2007 08:31 PM

You could also try using "Artifical Ignorance" to find interesting entries in logs.

http://www.ranum.com/security/comput.../ai/index.html

xerophyte 03-23-2007 12:29 AM

you can also install some Host-based Intrusion Detection System and monitor the system, try http://ossec.net which is good one to monitor the server


All times are GMT -5. The time now is 09:20 PM.