Scanning for Rootkits with rkhunter and chkrootkit

Scanning for Rootkits

Rootkits are malware that hide from standard detection tools. Two widely used rootkit scanners are rkhunter and chkrootkit.

Install and Run rkhunter

apt install rkhunter -y

# Update the signature database:
rkhunter --update

# Baseline the system (run once on a clean system):
rkhunter --propupd

# Run a check:
rkhunter --check

Results show OK, Warning, or Found. Investigate any warnings.

Common False Positives

rkhunter may warn about legitimate tools. Review each warning in context before acting. Common false positives include: custom SSH configurations, certain system tools, and Perl/Python binaries.

Schedule Weekly Scans

crontab -e
# Add:
0 3 * * 0 rkhunter --check --skip-keypress --report-warnings-only | mail -s "rkhunter report" you@example.com

Install and Run chkrootkit

apt install chkrootkit -y
chkrootkit

Review any lines starting with INFECTED. Many results are false positives — cross-reference with rkhunter and check the specific file manually.

What to Do If You Find a Rootkit

  • A confirmed rootkit means the server is compromised and cannot be fully trusted
  • Take a snapshot or backup if needed for forensics
  • The safest response is a complete OS reinstall — open a support ticket requesting a reinstall
  • Change all passwords after the reinstall
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Securing SSH Access

Securing SSH Access SSH is the main entry point to your server. Hardening it is one of the most...

Setting Up a Firewall with UFW

Setting Up a Firewall with UFW UFW (Uncomplicated Firewall) makes managing firewall rules...

Installing Fail2Ban to Prevent Brute Force Attacks

Installing Fail2Ban Fail2Ban monitors your log files and automatically bans IP addresses that...

Setting Up Let's Encrypt SSL Certificates

Setting Up Let's Encrypt SSL Certificates Let's Encrypt provides free, trusted SSL certificates....

Setting Up Two-Factor Authentication for SSH

Setting Up Two-Factor Authentication for SSH Adding 2FA to SSH requires both your SSH...