rkhunter(8)
π¦ rkhunter π¦
okay so this is the System Manager's Manual page for rkhunter, aka RootKit Hunter, and honestly she's kind of a big deal. π
β¨ NAME β¨
rkhunter β RootKit Hunter. bestie, the name literally tells you what she does. π
πΈ SYNOPSIS πΈ
rkhunter {--check | --unlock | --update | --versioncheck |
--propupd [{filename | directory | package name},...] |
--list [tests | {lang | languages} | rootkits | perl |
propfiles] |
--config-check | --version | --help} [options]
π DESCRIPTION π
rkhunter is a shell script that runs a whole bunch of checks on your local system to try and detect known rootkits and malware. she also checks whether commands have been modified, whether the system startup files have been modified, and does various checks on your network interfaces β including checking for listening applications. π
she's been written to be as generic as possible, so she should run on most Linux and UNIX systems. she comes with some support scripts in case certain commands are missing from your system, and some of those support scripts are perl scripts. but listen: rkhunter does require certain commands to be present for her to be able to execute. also, some tests need specific commands, and if those aren't there, the test just gets skipped. no drama, but facts are facts. π¦
rkhunter needs to be run under a Bourne-type shell β typically bash or ksh. she can be run as a cron job or straight from the command-line. β¨
π COMMAND OPTIONS π
if you give no command option at all, then --help is assumed. and rkhunter will return a non-zero exit code if any error or warning occurs. periodt. π
-c,--checkβ tellsrkhunterto perform various checks on the local system. the result of each test gets displayed on stdout. if anything suspicious is found, a warning is displayed. a log file of the tests and results is automatically produced. she suggests running this regularly so you can make sure your system hasn't been compromised. π«Ά--unlockβ simply unlocks (removes) the lock file. if this option is used on its own, then no log file is created. that's it, that's the whole vibe. π--updateβ makesrkhuntercheck if there's a later version of any of her text data files. a command-line web browser β for examplewgetorlynxβ must be present on the system when using this option. she suggests running this regularly so the data files stay up to date. if you're using this option via cron, then it's recommended that you also use--nocolors. π
exit codes for this one are specific, so pay attention: an exit code of zero means no updates were available. an exit code of one means a download error occurred. and a code of two means no error occurred, but updates were available and have been installed. π
--propupd [{filename | directory | package name},...]β one of the checksrkhunterperforms is comparing various current file properties of various commands against the ones she previously stored. this command option makesrkhunterupdate her data file of stored values with the current values.
if the filename option is used, then it must either be a full pathname, or a plain file name (for example, 'awk'). when used, only the entry in the file properties database for that file gets updated. if the directory option is used, then only those files listed in the database that are in the given directory get updated. similarly, if the package name option is used, then only those files in the database which are part of the specified package get updated. the package name must be the base part of the name β no version numbers should be included, for example, 'coreutils'. package names will, of course, only be stored in the file properties database if a package manager is being used. if a package name is the same as a file name β for example, 'file' could refer to the 'file' command or to the RPM 'file' package (which contains the 'file' command) β the package name will be used. if no specific option is given, then the entire database is updated.
WARNING: it is the user's responsibility to ensure that the files on the system are genuine and from a reliable source.rkhuntercan only report if a file has changed, but not what caused the change. hence, if a file has changed, and the--propupdcommand option is used, thenrkhunterwill assume that the file is genuine. π bestie please be careful with this one.
--versioncheckβ makesrkhuntercheck if there's a later version of the program. a command-line web browser must be present on the system when using this option. if this option is used via cron, then it's recommended that you also use--nocolors. πΈ
exit codes: an exit code of zero means no new version was available. an exit code of one means an error occurred downloading the latest version number. and a code of two means no error occurred, but a new version is available. π
--list [tests | {lang | languages} | rootkits | perl | propfiles]β this command option lists some of the supported capabilities of the program, and then exits. thetestsoption lists the currently available test names (see theREADMEfile for more details about test names). thelanguagesoption lists the currently available languages, and therootkitsoption lists the rootkits that are searched for byrkhunter. theperloption lists the installation status of theperlcommand and perl modules that may be used by some of the tests. note that it is not required to install these modules. however, ifrkhunteris forced to use perl to execute a test, then the module must be present. thepropfilesoption lists the file names that are used to generate the file properties database. if no specific option is given, then all the lists, except for the file properties database, are displayed. π-C,--config-checkβ makesrkhuntercheck her configuration file(s), and then exit. the program runs through her normal configuration checks as specified by the enable and disable options on the command-line and in the configuration files. that is, only the configuration options for tests which would normally run are checked. in order to check all the configured options, use the--enable all --disable noneoptions on the command line. additionally, the program checks to see if there are any unrecognised configuration options. if any configuration problems are found, then they will be displayed and the return code will be set to1. she suggests using this option whenever the configuration file(s) have been changed. π§-V,--versionβ makesrkhunterdisplay her version number, and then exit. short and iconic. π-h,--helpβ displays the help screen menu, and then exits. π
π OPTIONS π
rkhunter uses a configuration file named rkhunter.conf for many of her configuration options. she can also use a local configuration file named rkhunter.conf.local, and a directory named rkhunter.d if it's present. both the local configuration file and the local directory must be in the same directory as the main configuration file. the installer does not create the local file or directory, but one, or both, can be created by the user if required. if a directory is used, then within the directory any file ending in .conf will be treated as a local configuration file. π¦
some options can also be specified on the command-line, and these will override the equivalent configuration file options. the configuration file options are well documented within the main configuration file itself. the following are the command-line options. the defaults mentioned here are the program defaults, unless explicitly stated as the configuration file default. β¨
--appendlogβ by default a new log file will be created whenrkhunterruns, and the previous log file will be renamed by having.oldappended to its name. this option tellsrkhunterto append to the existing log file. if the log file does not exist, then it will be created. π«Ά--bindir <directory>...β this option modifies which directoriesrkhunterlooks in to find the various commands she requires (that is, herPATH). the default is the rootPATH, and an internal list of some common command directories. by default a specified directory will be appended to the default list. however, if the directory name begins with the'+'character, then it will be prepended to the list (that is, it will be put at the start of the list). π--cs2,--color-set2β by defaultrkhunterdisplays her test results in color. the colors used are green for successful tests, red for failed tests (warnings), and yellow for skipped tests. these colors are visible when a black background is used, but are difficult to see on a white background. this option tellsrkhunterto use a different color set which is more suited to a white background. πΈ--configfile <file>β the installation process automatically tellsrkhunterwhere her configuration file is located. however, if necessary, this option can be used to specify a different pathname. if a local configuration file, or directory, is to be used, then it must reside in the same directory as the configuration file specified by this option. π--cronjobβ this is similar to the--checkcommand option, but it disables several of the interactive options. when this option is used,--check,--nocolorsand--skip-keypressare assumed. by default no output is sent to stdout, so the--report-warnings-onlyoption may be useful with this option. π°οΈ--dbdir <directory>β the installation process automatically configures where the data files are stored forrkhunter. however, if necessary, this option can be used to specify a different directory. the directory can be read-only, after installation, provided that neither of the--updateor--propupdoptions are specified, and that the--versioncheckoption is not specified ifROTATE_MIRRORSis set to1in the configuration file. π₯--debugβ okay so this one is lowkey a dev-only secret π€« it's mainly for the developers. It produces no output on stdout. Regular logging keeps going as per default or as specified by--logfile, and the debug output lands in a randomly generated filename that starts with/tmp/rkhunter-debug.--disable <test>[,<test>...]β tells rkhunter not to run the tests you name. Read theREADMEfile for more info about test names, bestie. By default no tests are disabled. β¨--display-logfileβ the way this one just shows the logfile on your screen once rkhunter has finished π--enable <test>[,<test>...]β tells rkhunter to only run the tests you name. If only one test name is given, other thanall, then--skip-keypressis assumed. Read theREADMEfile for more info about test names. By default all tests are enabled, and all the test names are listed below under TESTS π«Ά--hash {MD5 | SHA1 | SHA224 | SHA256 | SHA384 | SHA512 | NONE | <command>}β both the file properties check and the--propupdcommand option use a hash function to work out a file's current hash value, and this tells rkhunter which one. TheMD5andSHAoptions look for the relevant command and, if it isn't found, a perl support script is used to see whether a perl module supporting the function is installed. Alternatively you can name a specific command. A value ofNONEmeans the hash values are not obtained or used as part of the file properties check. Default isSHA256.
π¨ Systems using prelinking must use eitherMD5,SHA1orNONE. No cap, that one's not negotiable.
--lang,--language <language>β picks which language is used for the displayed tests and results π You can see the currently supported languages with the--listcommand option. Default isen(English). If a message to be displayed can't be found in the language file, the English version gets used β so the English language file must always be present, periodt. The--updatecommand option updates the language files when new versions are available.-l,--logfile [file]β by default rkhunter writes out a log file, at/var/log/rkhunter.log. You can change that location with this option. If/dev/nullis specified as the log file, then no log file is written. If no specific file is given, the default is used. By default rkhunter creates a new log file each time it runs β any previously existing logfile is moved out of the way and gets.oldappended to it π--noappend-logβ reverts rkhunter to its default behaviour of creating a new log file rather than appending to it.--nocfβ this one is only valid when the command-line--disableoption is used. When--disableis used, by default the configuration file option to disable tests is also used to determine which tests to run. If only the--disableoption is to determine which tests run, then--nocfmust be given. iykyk π§--nocolorsβ causes the result of each test to not be displayed in a specific color. The default color β usually the reverse of the background color β is used (typically that's just black and white).--nologβ tells rkhunter not to write anything to a log file.--nomow,--no-mail-on-warningβ the config file has an option that sends a simple email message to a user should rkhunter detect any warnings during system checks. This command-line option overrides the config file option and prevents an email from being sent. The config file default is not to email a message. π--ns,--nosummaryβ when--checkis used, a short summary of results is displayed at the end by default. This stops the summary from being displayed.--novl,--no-verbose-loggingβ during some tests rkhunter logs a lot of information. This option reduces the amount of logging and so can improve performanceβ¦ but the log file will contain less info should any warnings occur π By default verbose logging is enabled.--pkgmgr {RPM | DPKG | BSD | BSDng | SOLARIS | NONE}β used during the file properties check or when the--propupdcommand option is given. It tells rkhunter that the current file property values should be obtained from the relevant package manager. See theREADMEfile for more details. Default isNONE, which means don't use a package manager.-q,--quietβ tells rkhunter not to display any output. Super useful when you're only checking the exit code. Other options can be used alongside to force only specific items to be displayed. π€«--rwo,--report-warnings-onlyβ only warning messages get displayed. Great when rkhunter is run via cron. Other options can force other bits of info to be displayed too.--sk,--skip-keypressβ when--checkis used, after certain sections of tests the user gets prompted to press the return key to continue. This disables that and rkhunter runs until all the tests have completed πββοΈ
If this option hasn't been given and the user is prompted to press return, a single s character β upper- or lowercase β may be given followed by the return key. rkhunter will then continue the tests without prompting again (as if this option had been given). Slay.
--summaryβ causes the summary of test results to be displayed. This is the default. β¨--syslog [facility.priority]β when--checkis used, this causes the start and finish times to be logged to syslog. Default is not to log anything to syslog, but if the option is used the default level isauthpriv.notice.--tmpdir <directory>β the installation process automatically configures where temporary files are created, but if necessary this option specifies a different directory.
π¨ The directory must not be a symbolic link, and must be secure (root access only). Do not skip this one, bestie.
--vl,--verbose-loggingβ tells rkhunter that when it runs some tests it should log as much information as possible. Useful when diagnosing why a warning occurred, but obviously it takes more time. Default is to use verbose logging.-x,--autoxβ rkhunter will try to detect if the X Window system is in use. If it is, the second color set gets used automatically (see the--color-set2option). This lets rkhunter run on, like, a server console (no X, so the default color set) and on a user's terminal (X in use, so the second color set) β and in both cases it uses the correct one π The config file default is to try and detect X.-X,--no-autoxβ stops rkhunter from automatically detecting whether the X Window system is being used. See--autoxabove. π
πΈ TESTS πΈ
Literally the original page just says:
[This section to be written]
so that's what we have to work with, no cap. Here's what's there:
additional_rktsβ this test is for SHORT_EXPLANATION. It works as part of GROUP. Corresponding configuration file entries:ONE=one,TWO=twoand for white-listingTHREE=three,three. Simple globbing (/dev/shm/file-*) works. π¦allappsattributesavail_modulesdeleted_filesfilesystemgroup_accountsgroup_changeshasheshidden_portshidden_procsimmutableknown_rktsloaded_moduleslocal_hostmalwarenetworknoneos_specificother_malwarepacket_cap_appspasswd_changesportspossible_rkt_filespossible_rkt_stringspromiscpropertiesrootkitsrunning_procsscriptsshared_libsshared_libs_pathstartup_filesstartup_malwarestringssuspscansystem_commandssystem_configstrojans
π FILES π
For a default installation:
/etc/rkhunter.conf
/var/log/rkhunter.log
π¦ SEE ALSO π¦
- See the
CHANGELOGfile for recent changes. - The
READMEfile has info about installing rkhunter, plus specific sections on test names and using package managers. - The
FAQfile should also answer some questions π
π LICENSING π
RootKit Hunter is licensed under the GPL, copyright Michael Boelen. See the LICENSE file for details of GPL licensing.
π CONTACT INFORMATION π
This software was developed by the RootKit Hunter project team. To report bugs, patches, comments and questions, please go to:
http://rkhunter.sourceforge.net/
and that's the whole page, bestie π«Ά this version is dated June 2017 and it's the rkhunter(8) page β go forth and vibe check your system π
β¨
π¦ where this page comes from
- arch rolling: rkhunter 1.4.6-4 Β· GPL
- epel 10: rkhunter 1.4.6-31.el10_2 Β· GPL-2.0-or-later
- epel 9: rkhunter 1.4.6-17.el9 Β· GPLv2+
- fedora 43: rkhunter 1.4.6-30.fc43 Β· GPL-2.0-or-later
- fedora 43: rkhunter 1.4.6-31.fc43 Β· GPL-2.0-or-later
- fedora 44: rkhunter 1.4.6-32.fc44 Β· GPL-2.0-or-later
- opensuse-leap 16.0: rkhunter 1.4.6-bp160.1.9 Β· GPL-2.0-or-later
- opensuse-leap 16.0: rkhunter 1.4.6-bp160.1.9 Β· GPL-2.0-or-later
- opensuse-leap 16.0: rkhunter 1.4.6-bp160.1.9 Β· GPL-2.0-or-later
- opensuse-leap 16.0: rkhunter 1.4.6-bp160.1.9 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms