rkhunter (Rootkit Hunter) is an open source Unix/Linux based scanner tool for Linux systems released under GPL that scans backdoors, rootkits and local exploits on your systems. It scans hidden files, wrong permissions set on binaries, suspicious strings in kernel etc.
Installing rkhunter (Rootkit Hunter) in RHEL, CentOS and Fedora
Step 1: Download rkhunter
#cd /tmp
#wget http://ncu.dl.sourceforge.net/project/rkhunter/rkhunter/1.4.0/rkhunter-1.4.0.tar.gz
Step 2: Install rkhunter
#tar -xvf rkhunter-1.4.0.tar.gz
#cd rkhunter-1.4.0
#./installer.sh –layout default –install
Step 3: Update rkhunter
#/usr/local/bin/rkhunter –update
#/usr/local/bin/rkhunter –propupd
Step 4: Set Cronjob and Email Alerts
# vi /etc/cron.daily/rkhunter.sh
Add the following codes into the “rkhunter.sh” file and change the Server name and Email Address accordingly.
#!/bin/sh
(
/usr/local/bin/rkhunter –versioncheck
/usr/local/bin/rkhunter –update
/usr/local/bin/rkhunter –cronjob –report-warnings-only
) | /bin/mail -s ‘rkhunter Daily Run (ServerName)’ [email protected]
Step 5: After that set permission on the file.
#chmod 755 /etc/cron.daily/rkhunter.sh
Step 6: Manual Scan and Usage
#rkhunter –check