WHAT’S ROOTKIT AND RKHUNTER IN LINUX . HOW TO RUN RKHUNTER IN LINUX

In this post you will learn about rootkit and rootkit hunter in linux .

RKhunter also known as Rootkit hunter , is a tool for linux systems that scans backdoors , rootkits and local exploits on your system . Now you must be thinking what Rootkit is ? A rootkit is collection of programs that allows attacker to get root access and steal files on system  , also maintained access to the hijacked system  .

rootkit in linux rkhunter

  • I have a rkhunter but it’s in tar.gz format .
[root@deepitp5 ~]# ls
3usageeks  anaconda-ks.cfg  Desktop  install.log  install.log.syslog  rkhunter-1.4.0.tar.gz
  • First we have to compress .tar.gz file .
[root@deepitp5 ~]# tar xvzf rkhunter-1.4.0.tar.gz
rkhunter-1.4.0/
rkhunter-1.4.0/installer.sh
rkhunter-1.4.0/files/
rkhunter-1.4.0/files/rkhunter.conf
rkhunter-1.4.0/files/LICENSE
rkhunter-1.4.0/files/i18n/
rkhunter-1.4.0/files/i18n/zh.utf8
rkhunter-1.4.0/files/i18n/en
rkhunter-1.4.0/files/i18n/cn
rkhunter-1.4.0/files/i18n/de
rkhunter-1.4.0/files/i18n/zh
rkhunter-1.4.0/files/filehashsha.pl
rkhunter-1.4.0/files/ACKNOWLEDGMENTS
rkhunter-1.4.0/files/contrib/
rkhunter-1.4.0/files/contrib/rkhunter_remote_howto.txt
rkhunter-1.4.0/files/contrib/README.txt
rkhunter-1.4.0/files/contrib/run_rkhunter.sh
rkhunter-1.4.0/files/README
rkhunter-1.4.0/files/CHANGELOG
rkhunter-1.4.0/files/development/
rkhunter-1.4.0/files/development/new-OS-support
rkhunter-1.4.0/files/development/i18nchk
rkhunter-1.4.0/files/mirrors.dat
rkhunter-1.4.0/files/readlink.sh
rkhunter-1.4.0/files/rkhunter.spec
rkhunter-1.4.0/files/stat.pl
rkhunter-1.4.0/files/programs_bad.dat
rkhunter-1.4.0/files/check_modules.pl
rkhunter-1.4.0/files/suspscan.dat
rkhunter-1.4.0/files/rkhunter.8
rkhunter-1.4.0/files/tools/
rkhunter-1.4.0/files/backdoorports.dat
rkhunter-1.4.0/files/rkhunter
rkhunter-1.4.0/files/testing/
rkhunter-1.4.0/files/FAQ
  • Now theres one new folder named rkhunter  after extract .
[root@deepitp5 ~]# ls
3usageeks  anaconda-ks.cfg  Desktop  install.log  install.log.syslog  rkhunter-1.4.0  rkhunter-1.4.0.tar.gz
  • Go to that folder . And you fill find script file( .sh ) for installing rkhunter .
[root@deepitp5 ~]# cd rkhunter-1.4.0
[root@deepitp5 rkhunter-1.4.0]# ls
files  installer.sh
  • To install rkhunter run that script file by typing below commands .
[root@deepitp5 rkhunter-1.4.0]# ./installer.sh --install
  • After typing that above commands process of installation will start .
Starting installation:
 Checking installation directory "/usr/local": it exists and is writable.
 Checking installation directories:
  Directory /usr/local/share/doc/rkhunter-1.4.0: creating: OK
  Directory /usr/local/share/man/man8: exists and is writable.
  Directory /etc: exists and is writable.
  Directory /usr/local/bin: exists and is writable.
  Directory /usr/local/lib: exists and is writable.
  Directory /var/lib: exists and is writable.
  Directory /usr/local/lib/rkhunter/scripts: creating: OK
  Directory /var/lib/rkhunter/db: creating: OK
  Directory /var/lib/rkhunter/tmp: creating: OK
  Directory /var/lib/rkhunter/db/i18n: creating: OK
 Installing check_modules.pl: OK
 Installing filehashsha.pl: OK
 Installing stat.pl: OK
 Installing readlink.sh: OK
 Installing backdoorports.dat: OK
 Installing mirrors.dat: OK
 Installing programs_bad.dat: OK
 Installing suspscan.dat: OK
 Installing rkhunter.8: OK
 Installing ACKNOWLEDGMENTS: OK
 Installing CHANGELOG: OK
 Installing FAQ: OK
 Installing LICENSE: OK
 Installing README: OK
 Installing language support files: OK
 Installing rkhunter: OK
 Installing rkhunter.conf: OK
Installation complete
  • To run rkhunter  , type  –   rkhunter  –  c  ( c  for check )
  • Now rkhunter will search for all backdoors for attackers , rootkit  present in your linux machine  .
  • If you see { OK } sign means  no need to worry about that segment .
  • If you see { warning } , that means you better need to go through that part .
[root@deepitp5 ~]# rkhunter -c
[ Rootkit Hunter version 1.4.0 ]
Checking system commands...
  Performing 'strings' command checks
    Checking 'strings' command                               [ OK ]
  Performing 'shared libraries' checks
    Checking for preloading variables                        [ None found ]
    Checking for preloaded libraries                         [ None found ]
    Checking LD_LIBRARY_PATH variable                        [ Not found ]
  Performing file properties checks
    Checking for prerequisites                               [ Warning ]
    /usr/local/bin/rkhunter                                  [ OK ]
    /sbin/chkconfig                                          [ OK ]
    /sbin/depmod                                             [ OK ]
    /sbin/fsck                                               [ OK ]
    /sbin/fuser                                              [ OK ]
    /sbin/ifconfig                                           [ OK ]
    /sbin/ifdown                                             [ Warning ]
    /sbin/ifup                                               [ Warning ]
    /sbin/init                                               [ OK ]
    /sbin/insmod                                             [ OK ]
    /sbin/ip                                                 [ OK ]
    /sbin/kudzu                                              [ OK ]
    /sbin/lsmod                                              [ OK ]
    /sbin/modinfo                                            [ OK ]
    /sbin/modprobe                                           [ OK ]
    /sbin/nologin                                            [ OK ]
    /sbin/rmmod                                              [ OK ]
    /sbin/route                                              [ OK ]
    /sbin/runlevel                                           [ OK ]
    /sbin/sulogin                                            [ OK ]
    /sbin/sysctl                                             [ OK ]
    /sbin/syslogd                                            [ OK ]
    /bin/awk                                                 [ OK ]
    /bin/basename                                            [ OK ]
    /bin/bash                                                [ OK ]
    /bin/cat                                                 [ OK ]
    /bin/chmod                                               [ OK ]
    /bin/chown                                               [ OK ]
    /bin/cp                                                  [ OK ]
    /bin/csh                                                 [ OK ]
    /bin/cut                                                 [ OK ]
    /bin/date                                                [ OK ]
    /bin/df                                                  [ OK ]
    /bin/dmesg                                               [ OK ]
    /bin/echo                                                [ OK ]
    /bin/ed                                                  [ OK ]
    /bin/egrep                                               [ OK ]
    /bin/env                                                 [ OK ]
    /bin/fgrep                                               [ OK ]
    /bin/grep                                                [ OK ]
    /bin/kill                                                [ OK ]
    /bin/logger                                              [ OK ]
    /bin/login                                               [ OK ]
    /bin/ls                                                  [ OK ]
    /bin/mail                                                [ OK ]
    /bin/mktemp                                              [ OK ]
    /bin/more                                                [ OK ]
    /bin/mount                                               [ OK ]
    /bin/mv                                                  [ OK ]
    /bin/netstat                                             [ OK ]
    /bin/ping                                                [ OK ]
    /bin/ps                                                  [ OK ]
    /bin/pwd                                                 [ OK ]
    /bin/rpm                                                 [ OK ]
    /bin/sed                                                 [ OK ]
    /bin/sh                                                  [ OK ]
    /bin/sort                                                [ OK ]
    /bin/su                                                  [ OK ]
    /bin/touch                                               [ OK ]
    /bin/uname                                               [ OK ]
    /bin/gawk                                                [ OK ]
    /bin/tcsh                                                [ OK ]
    /usr/sbin/adduser                                        [ OK ]
    /usr/sbin/chroot                                         [ OK ]
    /usr/sbin/groupadd                                       [ OK ]
    /usr/sbin/groupdel                                       [ OK ]
    /usr/sbin/groupmod                                       [ OK ]
    /usr/sbin/grpck                                          [ OK ]
    /usr/sbin/kudzu                                          [ OK ]
    /usr/sbin/lsof                                           [ OK ]
    /usr/sbin/prelink                                        [ OK ]
    /usr/sbin/pwck                                           [ OK ]
    /usr/sbin/sestatus                                       [ OK ]
    /usr/sbin/tcpd                                           [ OK ]
    /usr/sbin/useradd                                        [ OK ]
    /usr/sbin/userdel                                        [ OK ]
    /usr/sbin/usermod                                        [ OK ]
    /usr/sbin/vipw                                           [ OK ]
    /usr/sbin/xinetd                                         [ OK ]
    /usr/bin/awk                                             [ OK ]
    /usr/bin/chattr                                          [ OK ]
    /usr/bin/curl                                            [ OK ]
    /usr/bin/cut                                             [ OK ]
    /usr/bin/diff                                            [ OK ]
    /usr/bin/dirname                                         [ OK ]
    /usr/bin/du                                              [ OK ]
    /usr/bin/elinks                                          [ OK ]
    /usr/bin/env                                             [ OK ]
    /usr/bin/file                                            [ OK ]
    /usr/bin/find                                            [ OK ]
    /usr/bin/GET                                             [ Warning ]
    /usr/bin/groups                                          [ Warning ]
    /usr/bin/head                                            [ OK ]
    /usr/bin/id                                              [ OK ]
    /usr/bin/kill                                            [ OK ]
    /usr/bin/killall                                         [ OK ]
    /usr/bin/last                                            [ OK ]
    /usr/bin/lastlog                                         [ OK ]
    /usr/bin/ldd                                             [ Warning ]
    /usr/bin/less                                            [ OK ]
    /usr/bin/links                                           [ OK ]
    /usr/bin/locate                                          [ OK ]
    /usr/bin/logger                                          [ OK ]
    /usr/bin/lsattr                                          [ OK ]
    /usr/bin/md5sum                                          [ OK ]
    /usr/bin/newgrp                                          [ OK ]
    /usr/bin/passwd                                          [ OK ]
    /usr/bin/perl                                            [ OK ]
    /usr/bin/pgrep                                           [ OK ]
    /usr/bin/pkill                                           [ OK ]
    /usr/bin/pstree                                          [ OK ]
    /usr/bin/readlink                                        [ OK ]
    /usr/bin/runcon                                          [ OK ]
    /usr/bin/sha1sum                                         [ OK ]
    /usr/bin/sha224sum                                       [ OK ]
    /usr/bin/sha256sum                                       [ OK ]
    /usr/bin/sha384sum                                       [ OK ]
    /usr/bin/sha512sum                                       [ OK ]
    /usr/bin/size                                            [ OK ]
    /usr/bin/stat                                            [ OK ]
    /usr/bin/strings                                         [ OK ]
    /usr/bin/sudo                                            [ OK ]
    /usr/bin/tail                                            [ OK ]
    /usr/bin/test                                            [ OK ]
    /usr/bin/top                                             [ OK ]
    /usr/bin/tr                                              [ OK ]
    /usr/bin/uniq                                            [ OK ]
    /usr/bin/users                                           [ OK ]
    /usr/bin/vmstat                                          [ OK ]
    /usr/bin/w                                               [ OK ]
    /usr/bin/watch                                           [ OK ]
    /usr/bin/wc                                              [ OK ]
    /usr/bin/wget                                            [ OK ]
    /usr/bin/whatis                                          [ Warning ]
    /usr/bin/whereis                                         [ OK ]
    /usr/bin/which                                           [ OK ]
    /usr/bin/who                                             [ OK ]
    /usr/bin/whoami                                          [ OK ]
    /usr/bin/gawk                                            [ OK ]
    /etc/rkhunter.conf                                       [ OK ]
[Press <ENTER> to continue]
  • Press ENTER to check in other directories .
 Performing check of known rootkit files and directories
    55808 Trojan - Variant A                                 [ Not found ]
    ADM Worm                                                 [ Not found ]
    AjaKit Rootkit                                           [ Not found ]
    Adore Rootkit                                            [ Not found ]
    aPa Kit                                                  [ Not found ]
    Apache Worm                                              [ Not found ]
    Ambient (ark) Rootkit                                    [ Not found ]
    Balaur Rootkit                                           [ Not found ]
    BeastKit Rootkit                                         [ Not found ]
    beX2 Rootkit                                             [ Not found ]
    BOBKit Rootkit                                           [ Not found ]
    cb Rootkit                                               [ Not found ]
    CiNIK Worm (Slapper.B variant)                           [ Not found ]
    Danny-Boy's Abuse Kit                                    [ Not found ]
    Devil RootKit                                            [ Not found ]
    Dica-Kit Rootkit                                         [ Not found ]
    Dreams Rootkit                                           [ Not found ]
    Duarawkz Rootkit                                         [ Not found ]
    Enye LKM                                                 [ Not found ]
    Flea Linux Rootkit                                       [ Not found ]
    Fu Rootkit                                               [ Not found ]
    Fuck`it Rootkit                                          [ Not found ]
    GasKit Rootkit                                           [ Not found ]
    Heroin LKM                                               [ Not found ]
    HjC Kit                                                  [ Not found ]
    ignoKit Rootkit                                          [ Not found ]
    IntoXonia-NG Rootkit                                     [ Not found ]
    Irix Rootkit                                             [ Not found ]
    Jynx Rootkit                                             [ Not found ]
    KBeast Rootkit                                           [ Not found ]
    Kitko Rootkit                                            [ Not found ]
    Knark Rootkit                                            [ Not found ]
    ld-linuxv.so Rootkit                                     [ Not found ]
    Li0n Worm                                                [ Not found ]
    Lockit / LJK2 Rootkit                                    [ Not found ]
    Mood-NT Rootkit                                          [ Not found ]
    MRK Rootkit                                              [ Not found ]
    Ni0 Rootkit                                              [ Not found ]
    Ohhara Rootkit                                           [ Not found ]
    Optic Kit (Tux) Worm                                     [ Not found ]
    Oz Rootkit                                               [ Not found ]
    Phalanx Rootkit                                          [ Not found ]
    Phalanx2 Rootkit                                         [ Not found ]
    Phalanx2 Rootkit (extended tests)                        [ Not found ]
    Portacelo Rootkit                                        [ Not found ]
    R3dstorm Toolkit                                         [ Not found ]
    RH-Sharpe's Rootkit                                      [ Not found ]
    RSHA's Rootkit                                           [ Not found ]
    Scalper Worm                                             [ Not found ]
    Sebek LKM                                                [ Not found ]
    Shutdown Rootkit                                         [ Not found ]
    SHV4 Rootkit                                             [ Not found ]
    SHV5 Rootkit                                             [ Not found ]
    Sin Rootkit                                              [ Not found ]
    Slapper Worm                                             [ Not found ]
    Sneakin Rootkit                                          [ Not found ]
    'Spanish' Rootkit                                        [ Not found ]
    Suckit Rootkit                                           [ Not found ]
    Superkit Rootkit                                         [ Not found ]
    TBD (Telnet BackDoor)                                    [ Not found ]
    TeLeKiT Rootkit                                          [ Not found ]
    T0rn Rootkit                                             [ Not found ]
    trNkit Rootkit                                           [ Not found ]
    Trojanit Kit                                             [ Not found ]
    Tuxtendo Rootkit                                         [ Not found ]
    URK Rootkit                                              [ Not found ]
    Vampire Rootkit                                          [ Not found ]
    VcKit Rootkit                                            [ Not found ]
    Volc Rootkit                                             [ Not found ]
    Xzibit Rootkit                                           [ Not found ]
    zaRwT.KiT Rootkit                                        [ Not found ]
    ZK Rootkit                                               [ Not found ]
[Press <ENTER> to continue]
  • Again press ENTER to allow rkhunter to check other possible backdoors .
Performing additional rootkit checks
    Suckit Rookit additional checks                          [ OK ]
    Checking for possible rootkit files and directories      [ None found ]
    Checking for possible rootkit strings                    [ None found ]
  Performing malware checks
    Checking running processes for suspicious files          [ None found ]
    Checking for login backdoors                             [ None found ]
    Checking for suspicious directories                      [ None found ]
    Checking for sniffer log files                           [ None found ]
  Performing trojan specific checks
    Checking for enabled xinetd services                     [ Warning ]
  Performing Linux specific checks
    Checking loaded kernel modules                           [ OK ]
    Checking kernel module names                             [ OK ]
[Press <ENTER> to continue]
  • Again press ENTER to allow rkhunter to check in network ports or interface
Checking the network...
  Performing checks on the network ports
    Checking for backdoor ports                              [ None found ]
  Performing checks on the network interfaces
    Checking for promiscuous interfaces                      [ None found ]
Checking the local host...
  Performing system boot checks
    Checking for local host name                             [ Found ]
    Checking for system startup files                        [ Found ]
    Checking system startup files for malware                [ None found ]
  Performing group and account checks
    Checking for passwd file                                 [ Found ]
    Checking for root equivalent (UID 0) accounts            [ None found ]
    Checking for passwordless accounts                       [ None found ]
    Checking for passwd file changes                         [ None found ]
    Checking for group file changes                          [ None found ]
    Checking root account shell history files                [ OK ]
  Performing system configuration file checks
    Checking for SSH configuration file                      [ Found ]
    Checking if SSH root access is allowed                   [ Warning ]
    Checking if SSH protocol v1 is allowed                   [ Not allowed ]
    Checking for running syslog daemon                       [ Found ]
    Checking for syslog configuration file                   [ Found ]
    Checking if syslog remote logging is allowed             [ Not allowed ]
  Performing filesystem checks
    Checking /dev for suspicious file types                  [ Warning ]
    Checking for hidden files and directories                [ Warning ]
[Press <ENTER> to continue]
  • Press ENTER to allow rkhunter to check all applications .
  • In the end Rkhunter will give summary of system check . In that summary you will see total number of files checked , possible rootkits in your system and suspected application .
Checking application versions...
    Checking version of GnuPG                                [ OK ]
    Checking version of OpenSSL                              [ Warning ]
    Checking version of Procmail MTA                         [ OK ]
    Checking version of OpenSSH                              [ Warning ]

System checks summary
=====================
File properties checks...
    Required commands check failed
    Files checked: 140
    Suspect files: 6
Rootkit checks...
    Rootkits checked : 316
    Possible rootkits: 0
Applications checks...
    Applications checked: 4
    Suspect applications: 2
The system checks took: 3 minutes and 35 seconds
All results have been written to the log file (/var/log/rkhunter.log)
One or more warnings have been found while checking the system.
Please check the log file (/var/log/rkhunter.log)
  • You can check the log file in  ( /var /log/rkhunter.log )
[root@deepitp5 ~]# vim /var/log/rkhunter.log
9:47:51] Running Rootkit Hunter version 1.4.0 on deepitp5
[09:47:51]
[09:47:51] Info: Start date is Sun Feb  5 09:47:51 EST 2017
[09:47:51]
[09:47:51] Checking configuration file and command-line options...
[09:47:51] Info: Detected operating system is 'Linux'
[09:47:51] Info: Uname output is 'Linux deepitp5 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux'
[09:47:51] Info: Command line is /usr/local/bin/rkhunter -c
[09:47:51] Info: Environment shell is /bin/bash; rkhunter is using bash
[09:47:51] Info: Using configuration file '/etc/rkhunter.conf'
[09:47:51] Info: Installation directory is '/usr/local'
[09:47:51] Info: Using language 'en'
[09:47:51] Info: Using '/var/lib/rkhunter/db' as the database directory
[09:47:51] Info: Using '/usr/local/lib/rkhunter/scripts' as the support script directory
[09:47:51] Info: Using '/usr/kerberos/sbin /usr/kerberos/bin /usr/local/sbin /usr/local/bin /sbin /bin /usr/sbin /usr/bin /usr/libexec /usr/local/libexec' as the command directories
[09:47:51] Info: Using '/var/lib/rkhunter/tmp' as the temporary directory
[09:47:51] Info: No mail-on-warning address configured
[09:47:51] Info: X will be automatically detected
[09:47:51] Info: Found the 'basename' command: /bin/basename
[09:47:51] Info: Found the 'diff' command: /usr/bin/diff
[09:47:51] Info: Found the 'dirname' command: /usr/bin/dirname
[09:47:51] Info: Found the 'file' command: /usr/bin/file
[09:47:51] Info: Found the 'find' command: /usr/bin/find
[09:47:51] Info: Found the 'ifconfig' command: /sbin/ifconfig
[09:47:51] Info: Found the 'ip' command: /sbin/ip
[09:47:51] Info: Found the 'ldd' command: /usr/bin/ldd
[09:47:51] Info: Found the 'lsattr' command: /usr/bin/lsattr
[09:47:51] Info: Found the 'lsmod' command: /sbin/lsmod
[09:47:51] Info: Found the 'lsof' command: /usr/sbin/lsof
[09:47:51] Info: Found the 'mktemp' command: /bin/mktemp
[09:47:51] Info: Found the 'netstat' command: /bin/netstat
[09:47:51] Info: Found the 'perl' command: /usr/bin/perl
[09:47:51] Info: Found the 'pgrep' command: /usr/bin/pgrep
[09:47:51] Info: Found the 'ps' command: /bin/ps
[09:47:51] Info: Found the 'pwd' command: /bin/pwd
  • If you want to configure rkhunter ,  go to  /etc/rkhunter.conf through vim ( if you want to edit ) or cat ( to look)
[root@deepitp5 ~]# vim /etc/rkhunter.conf

 

 

WHAT’S RUNLEVELS AND HOW TO CONFIGURE RUNLEVELS IN LINUX

WHAT’S STELNET AND HOW TO CONFIGURE STELNET IN LINUX AS SERVER AND WINDOWS OR ANDROID AS CLIENT

HOW TO INSTALL WINDOWS SOFTWARE IN LINUX THROUGH CROSSOVER .

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s