Rkhunter
Rkhunter is a rootkit detection tool.
Installationโ
On Ubuntu: sudo apt install rkhunter
Configurationโ
For a first run, edit /etc/rkhunter.conf and update the following properties:
WEB_CMD: this is initially set to/bin/falseon Ubuntu, which will cause all updates to fail. This should be able to be set tocurl.UPDATE_MIRRORS: by default, this is disabled, but mirrors will need to be updated at some point to get the most up-to-date database1. Set this to1to allow updates.MIRRORS_MODE: This defaults to1(use only local mirrors), however you can set this to0to use a remote mirror as well.
After config changes, check your config files by running
rkhunter --config-check.
Usageโ
Get database updates using rkhunter --update
Run rkhunter --check. The following additional options can be used as well:
--sk: skips the โPress <ENTER> to continueโ checks that exist when running.--rwo: reports warnings only
When youโre comfortable with the state of the system, running
rkhunter --propupd will update your local database of the current state.
Regular Scanningโ
Apply the following changes to /etc/default/rkhunter.conf:
CRON_DAILY_RUN="true": Runs a scan dailyCRON_DB_UPDATE="true": Updates the database weeklyAPT_AUTOGEN="true": Automatic database updates (what is the difference between the two of these?)
Footnotesโ
-
Itโs possible with an infected system that a malicious database could be uploaded, so in sensitive environments you probably only want to accept local mirrors. I donโt know what the risk of this would be however. โฉ