{"id":5079,"date":"2015-08-06T13:50:06","date_gmt":"2015-08-06T05:50:06","guid":{"rendered":"http:\/\/rmohan.com\/?p=5079"},"modified":"2015-08-06T13:51:10","modified_gmt":"2015-08-06T05:51:10","slug":"install-rootkit-hunter-centos-7-6-5","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5079","title":{"rendered":"Install Rootkit Hunter Centos 7 \/ 6 \/ 5"},"content":{"rendered":"<p>Rootkit Hunter (rkhunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. Rootkits are self-hiding toolkits secretly installed by a malicious intruder to allow that user to gain access to the server. Rootkit Hunter offers protection by comparing SHA-1 hashes of important files with known good ones in a online database as well as:<\/p>\n<p>MD5 hash compare<br \/>\nLook for default files used by rootkits<br \/>\nWrong file permissions for binaries<br \/>\nLook for suspected strings in LKM and KLD modules<br \/>\nLook for hidden files<br \/>\nOptional scan within plaintext and binary files<br \/>\nIf this is the first installation of RHEL and CentOS RPMForge Repository:<br \/>\n<strong>RHEL\/CentOS 7:<\/strong><\/p>\n<p># yum install http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm<\/p>\n<p><strong>RHEL\/CentOS 6 64 bit:<\/strong><\/p>\n<p># wget http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm<br \/>\n# rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm<\/p>\n<p><strong>RHEL\/CentOS 6 32 bit:<\/strong><\/p>\n<p># wget http:\/\/pkgs.repoforge.org\/rpmforge-release\/rpmforge-release-0.5.3-1.el6.rf.i686.rpm<br \/>\n# rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.i686.rpm<\/p>\n<p>yum install rkhunter<\/p>\n<p># \/usr\/local\/bin\/rkhunter \u2013update<br \/>\n# \/usr\/local\/bin\/rkhunter \u2013propupd<br \/>\n# rkhunter -c<\/p>\n<p>grep Warning \/var\/log\/rkhunter\/rkhunter.log<\/p>\n<p>Check the version<\/p>\n<p># rkhunter &#8211;versioncheck<\/p>\n<p>Rootkit Hunter version 1.4.2<\/p>\n<p>Checking rkhunter version&#8230;<br \/>\nThis version : 1.4.2<br \/>\nLatest version: 1.4.2<br \/>\nManual Scan<\/p>\n<p># rkhunter -c<br \/>\nrkhunter -c -l \/var\/log\/rkhunter.log<br \/>\nCreate the run-file in the following location (RHEL based distributions only):<\/p>\n<p>#nano -w \/etc\/cron.daily\/rkhunter.sh<br \/>\nInstall into shell script<\/p>\n<p>#!\/bin\/sh<br \/>\n(<br \/>\n\/usr\/bin\/rkhunter &#8211;versioncheck<br \/>\n\/usr\/bin\/rkhunter &#8211;update<br \/>\n\/usr\/bin\/rkhunter &#8211;cronjob &#8211;report-warnings-only<br \/>\n) | \/bin\/mail -s &#8216;rkhunter Daily Scan Report (ServerNameHere)&#8217; your@email.here<\/p>\n<p>Set Execute Permissions<\/p>\n<p>Set execute permission on the file you have just created:<\/p>\n<p># chmod 755 \/etc\/cron.daily\/rkhunter.sh<br \/>\nhe cron utility will run once daily, and if a threat is detected, the rkhunter command itself will email our user to alert them. If no problems were found, no email will be received.<\/p>\n<p>Rootkit Hunter configuration<\/p>\n<p>The configuration file for rkhunter can be found at:<\/p>\n<p># \/etc\/rkhunter.conf<br \/>\nSSHD Root Logon<\/p>\n<p>The parameter ALLOW_SSH_ROOT_USER tells rkhunter whether or not the root user is allowed to ssh into the system. This is unset by default in the rkhunter.conf file. Rkhunter will complain about this on every run. If you have disabled root login, you should set this parameter to \u201cno\u201d.<\/p>\n<p>ALLOW_SSH_ROOT_USER=no<br \/>\nIf you need root login over SSH, you should change this parameter to \u201cyes\u201d so that rkhunter can check this and will mark this setting as valid:<\/p>\n<p>ALLOW_SSH_ROOT_USER=yes<br \/>\nSecurity practices recommend disabling root login.<\/p>\n<p>Update rkhunter<\/p>\n<p>To check the currently installed version enter the following:<\/p>\n<p># rkhunter &#8211;versioncheck<br \/>\nRun the updater by issuing the following command:<\/p>\n<p># rkhunter &#8211;update<br \/>\nWith our database files refreshed, we need to tell rkhunter to check the current values and store them as known-good values:<\/p>\n<p># rkhunter &#8211;propupd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rootkit Hunter (rkhunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. Rootkits are self-hiding toolkits secretly installed by a malicious intruder to allow that user to gain access to the server. Rootkit Hunter offers protection by comparing SHA-1 hashes of important files with known good ones in a online database [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,73,4,17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5079"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5079"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5079\/revisions"}],"predecessor-version":[{"id":5081,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5079\/revisions\/5081"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}