📄 readme
字号:
to giving false-positive results. They can, of course, be enabled by editingthe DISABLE_TESTS list. To run the tests from the command line, either userthe '--enable' command-line option with the specified test name, or useeither '--enable all' or '--disable none'.If either of the '--enable' or '--disable' command-line options is used, andthe '--propupd' option is not given, then '--check' is assumed.If the '--enable' option is used and only one test name, other than 'all',is given, then the '--skip-keypress' option is assumed as well. So, forexample, to run all the rootkit tests just use: rkhunter --enable rootkitsSimilarly, to run all the tests except the rootkit tests, then use: rkhunter --disable rootkitsIn this example RKH will assume the enabled test list of '--enable all'. In theprevious example, '--disable none' will have been assumed.If a combination of enabled and disabled tests are specified, then RKH willdisable a test if it is specified in the enable list. So, for example: rkhunter --enable 'rootkits,deleted_files' --disable malwareIn this example the 'malware' test is disabled because it is part of the'rootkits' test. The fact that the 'deleted_files' test is specified to berun is ignored, because that is part of the 'malware' test. RKH will alwayslook to see what tests to disable first. It will then run any enabled teststhat are left.By default RKH will log what tests names have been enabled and disabled.Additionally it will log each test name that it is about to execute. Wheninitially run RKH may skip some tests due to missing commands or files. It isusually possible to omit these tests by including them in the DISABLE_TESTSlist in the configuration file. The test name associated with these tests canbe found by looking in the log file.It should be noted that not all the tests have been given names. As such sometest names may execute more tests than expected. For example: rkhunter --enable group_changesThe 'group_changes' test name refers to the check to see if the /etc/group filehas been modified. However, running the above command will also cause severaltests on the /etc/passwd file to be executed. This is because those tests arepart of the 'local_host' grouped test name, as is the 'group_changes' test,but those other tests have no specific names. As such, RKH will start the'local_host' tests, executing some of the /etc/passwd file tests and then the'group_changes' test, but ignoring any other tests within 'local_host' whichdo have specific names (for example, 'filesystem' and 'passwd_changes').USING PACKAGE MANAGERS======================The RKH file properties check, by default, performs a check of various currentfile properties against those that it has previously stored in the'rkhunter.dat' file. This way RKH can warn the user if a file has changed. Thefile properties include items such as the files hash value, file permissions,uid, gid, inode number and so on. The properties are obtained and stored in therkhunter.dat file when RKH is run with the '--propupd' option.Typically the file properties are obtained using commands such as 'stat','file', 'md5sum' and 'prelink'. However, it is also possible to specify thatRKH should get whatever values it can by using a package manager. This can bedone by using the '--pkgmgr' command-line option, or the 'PKGMGR' configurationfile option. When the RPM package manager is specified, during the fileproperties check the results from the RPM verification command are used as thetest results. For the other package managers, the values from the packagemanager database are compared against the current values for the files. Byusing a package manager, it is possible to avoid some false-positive reportsthat a file has changed when in fact it has been automatically updated by thesystem.The currently available package managers are 'RPM' for RedHat/RPM-basedsystems, 'DPKG' for Debian-based systems, and 'BSD' for *BSD systems. It isalso possible to specify 'NONE' to indicate not to use a package manager.The program default is 'NONE'.Any file which is not part of a package is treated as before, that is, theHASH_FUNC configuration file option, or the '--hash' command-line option, willbe used.It should be noted that all the package managers provide an MD5 hash value fora file. However, the 'RPM' package manager can provide other file propertyvalues as well, such as the file permissions, uid, gid, modification time andso on. During the file properties check all of these values will be used,rather than the ones stored in the rkhunter.dat file.It should also be noted that the 'DPKG' and 'BSD' package manager optionsonly provide the files MD5 hash value. As such, during the file propertiescheck, all the other current file properties will be re-calculated as before,and compared against the values in the rkhunter.dat file. Hence, only the 'RPM'package manager offers any real benefit in using a package manager.NOTE: It is possible for a package manager database to become maliciouslycorrupted. To that extent the use of the package manager options with RKHdoes not provide any increase in security. However, it may result in lessfalse-positive warnings of files which have changed. As always RKH can onlyreport on changes, but not on what has caused the change.USING LOCAL MIRRORS===================When the '--update' or '--versioncheck' options are used, rkhunter usesa mirror site from the mirrors.dat file to obtain the required information.By default rkhunter will use any mirror listed in the file, and it willthen rotate the list of mirrors. At the time of writing the suppliedmirrors.dat file lists the Rootkit Hunter SourceForge site as a mirror.However, it is possible for users to define a local mirror if they wish to.This is done by simply editing the mirrors.dat file and inserting themirror URL. The line should begin with the text 'local='. For example: local=http://www.example.com/rkhunter_dataThe required rkhunter files must be placed in a location, of the users choice,which is accessible by the clients. So in the above example, the rkhunterdata files would have been placed in the 'rkhunter_data' directory. Therequired files consist of the '.dat' files supplied with rkhunter, and whichwill have been installed in the database directory. For a defaultinstallation this would have been in '/var/lib/rkhunter/db'.Additionally, the mirror directory must have an 'i18n' sub-directory whichcontains all the current language translation files for the various versionsof rkhunter. Each version is put into its own sub-directory. So, for example,there would be a '1.3.1' sub-directory, a '1.3.2' sub-directory and so on,all within the 'i18n' directory. Again, the database directory will alreadyhave had the 'i18n' sub-directory installed in to it, but it will onlycontain the language files for the current version of rkhunter. There areno version sub-directories installed by default. As such, the mirror willneed to have the various version sub-directories created, and the relevantlanguage files put in to them, for the versions of rkhunter that the mirroris required to support. If a client tries to access the language files for aversion of rkhunter that is not supported by the mirror, then the downloadwill fail. Depending on how the client is configured, another, possiblyremote, mirror may be tried, or rkhunter will give a warning.Within each rkhunter version sub-directory of the 'i18n' directory, it isnecessary to have a file called 'i18n.ver'. This file simply contains a listof the available language files, and their version numbers. For example: cn:2007061401 en:2007102501So, as an example, the mirror file structure will need to look similarto this: rkhunter_data || || =============================================== || || || || mirrors.dat rkhunter_latest.dat i18n suspscan.dat || || 1.3.1 ============ 1.3.2 ============ 1.3.3 / | \ / | \ / | \ / | \ / | \ / | \ cn en i18n.ver cn en i18n.ver cn en i18n.verFinally, if the '--versioncheck' option is to be supported with the localmirror, then the directory, 'rkhunter_data' in the above example, mustcontain a file called 'rkhunter_latest.dat'. This file must contain thecurrent rkhunter version number (for example, '1.3.0') and no other text.It is possible to similarly define 'remote' mirrors, which begin with thetext 'remote='. At present though there is no real difference between alocal or remote mirror.The supplied mirror site(s) in the mirrors.dat file begin with the text'mirror=', and this should not be changed.In order to select whether all the mirrors or only the local or remotemirrors should be used, the rkhunter configuration file has an option init called 'MIRRORS_MODE'. This option takes a numeric value, which by defaultis zero. The current values and meanings are: 0 - use any mirror (the default) 1 - use only local mirrors 2 - use only remote mirrorsTo further support local and remote mirrors there are two other configurationoptions available:The first is 'UPDATE_MIRRORS', which simply tells rkhunter whether themirrors.dat file itself should be updated (i.e. overwritten) when the'--update' option is used. If local mirrors are listed in the file then youprobably do not want the file automatically updated. The 'UPDATE_MIRRORS'option has a default value of one, indicating that the mirrors.dat file shouldbe updated. Set this option to zero to disable this feature.The second option is 'ROTATE_MIRRORS'. This tells rkhunter whether it shouldrotate the list of mirrors whenever the '--update' or '--versioncheck' optionsare used. Again, with local mirrors you may want these accessed in a specificorder, rather than rotated each time. The option has a default value of oneindicating that the mirrors should be rotated. Set this option to zero todisable this feature.By default if a mirror fails for some reason, then rkhunter will use the nextmirror, of the configured type, listed in the file. If there are no moremirrors left, then rkhunter will give a warning message.ROOTKIT HUNTER SUPPORT======================If a problem is found with RKH, it is recommended that users initiallytry and resolve the problem themselves. This can be done by firstchecking the FAQ file, which is present in your installation if thedistributed tarball is used as source. The FAQ will contain answers to many common problems. The latest version of the FAQ can always be found at RKH's project pages on SourceForge, in the 'Documentation' section.If the problem has occurred directly after upgrading RKH, then pleasecheck the CHANGELOG file. It will contain information about changesmade since the previous version of RKH, and may indicate why you arenow experiencing a problem.Users should also check the rkhunter-users mailing list archives(available on the web site). The problem will be investigated by theRKH development team, and, where appropriate, a solution posted on themailing list. Hence the mailing list archives may well contain asolution to the problem.Additionally, users should check the RKH tracker system (available athttp://sourceforge.net/tracker/?group_id=155034). It is quitepossible that the problem has already been reported to us as a bug orsupport request. It is also possible that a fix for the problem hasbeen provided in the tracker log.Depending upon the nature of the problem it may be worthwhile tryingan Internet search (for example using google), to see if anyone elsehas experienced a similar problem.Finally, if you have still not found an answer to the problem, thenmail it to the rkhunter-users mailing list. Please provide as muchinformation as possible about the problem, but do not make themessage excessively long! Information such as your operating systemand version of RKH should always be included.If you are sure the problem is a bug, or want it considered as asupport request, then please submit it directly into the trackersystem.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -