rkhunter and chkrootkit have been on cPanel servers for over a decade. The reflex install is: yum install, set up cron, ignore the resulting daily emails. The signal-to-noise is low. But on the day a host is actually compromised at the system level — kernel module, modified /bin/login, hidden processes — these are the only tools that catch it before behavior changes.
What’s happening
rkhunter and chkrootkit scan for known rootkit signatures, modified system binaries, hidden processes, and suspicious network ports. They produce false positives liberally because every cPanel update changes binaries they thought were canonical. Without baselining and configuration, the daily report is unreadable. With baselining, it becomes a tripwire.
How to verify
rkhunter --version
chkrootkit -V
rkhunter --check --skip-keypress --quiet 2>&1 | tail -30
grep "Warning" /var/log/rkhunter.log | head
cat /etc/cron.daily/rkhunter 2>/dev/null
The Warning count in the rkhunter log is what an operator should be watching, not the volume of normal output.
The fix
- Install both if not present:
yum install rkhunter chkrootkit. cPanel does not ship them. - Baseline before running:
rkhunter --propupd. This stores hashes of every system binary in/var/lib/rkhunter/db/rkhunter.dat. Without it, every legitimate binary change reads as a warning. - Schedule via cron:
/etc/cron.daily/rkhunter:
Only mail when warnings exist — silent runs do not generate noise.#!/bin/bash /usr/bin/rkhunter --cronjob --update --quiet > /var/log/rkhunter.log grep "Warning" /var/log/rkhunter.log | mail -s "rkhunter $(hostname) warnings" ops@yourdomain.com - Re-baseline after each cPanel update:
rkhunter --propupdafterupcp. Otherwise every cPanel binary change becomes a warning. - chkrootkit weekly: less frequent because it overlaps with rkhunter heavily.
/etc/cron.weekly/chkrootkitrunningchkrootkit | mailis fine. - When a warning is real: do not panic, but do not ignore. Compare the file in question against a known-good copy from the package (
rpm -V <pkg>or equivalent). If the file is genuinely modified outside the package manager, escalate to a clean-room procedure. - False positives to whitelist: cPanel scripts, CSF binaries, and a few EasyApache files are common false positives. Add them to
/etc/rkhunter.conf.localwithRTKT_FILE_WHITELIST=.
Stack Harbor configures rootkit detection and weekly review under cPanel/WHM management.