• Get In Touch
August 10, 2016

How to Install and Use chkrootkit on Ubuntu 14.04

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

HP_NO_IMG/data/uploads/users/70fed463-d441-452e-bb7e-e0e3fa684498/989945849.png” alt=”” />

Introduction

Previously we learned how-to install and use rkhunter to check for rootkits on Ubuntu 14.04. In this tutorial we’ll learn how to install and use chkrootkit as alternative to check rootkits on Ubuntu 14.04.
chkrootkit is a tool to locally detect for signs of a rootkit. It is listed in the top 100 network security tools survey in 2006 released by insecure.org.

Install chkrootkit

We can install chkrootkit from Ubuntu repository using command below:

$ sudo apt-get install chkrootkit

We need root privileges to run chkrootkit, so we use sudo here to run chkrootkit.

If any of the output shown below shows as infected, then you need to check:

$ sudo chkrootkit
ROOTDIR is `/'
Checking `amd'...                                           not found
Checking `basename'...                                      not infected
Checking `biff'...                                          not found
Checking `chfn'...                                          not infected
Checking `chsh'...                                          not infected
Checking `cron'...                                          not infected
Checking `crontab'...                                       not infected
Checking `date'...                                          not infected
Checking `du'...                                            not infected
Checking `dirname'...                                       not infected
Checking `echo'...                                          not infected
Checking `egrep'...                                         not infected
Checking `env'...                                           not infected
Checking `find'...                                          not infected
Checking `fingerd'...                                       not found
Checking `gpm'...                                           not found
Checking `grep'...                                          not infected
Checking `hdparm'...                                        not infected
Checking `su'...                                            not infected
Checking `ifconfig'...                                      not infected
Checking `inetd'...                                         not infected
Checking `inetdconf'...                                     not found
Checking `identd'...                                        not found
Checking `init'...                                          not infected
Checking `killall'...                                       not infected
Checking `ldsopreload'...                                   not infected
Checking `login'...                                         not infected
Checking `ls'...                                            not infected
Checking `lsof'...                                          not infected
Checking `mail'...                                          not found
Checking `mingetty'...                                      not found
Checking `netstat'...                                       not infected
Checking `named'...                                         not found
Checking `passwd'...                                        not infected
Checking `pidof'...                                         not infected
Checking `pop2'...                                          not found
Checking `pop3'...                                          not found
Checking `ps'...                                            not infected
Checking `pstree'...                                        not infected
Checking `rpcinfo'...                                       not infected
Checking `rlogind'...                                       not found
Checking `rshd'...                                          not found
Checking `slogin'...                                        not infected
Checking `sendmail'...                                      not found
Checking `sshd'...                                          not infected
Checking `syslogd'...                                       not tested
Checking `tar'...                                           not infected
Checking `tcpd'...                                          not infected
Checking `tcpdump'...                                       not infected
Checking `top'...                                           not infected
Checking `telnetd'...                                       not found
Checking `timed'...                                         not found
Checking `traceroute'...                                    not found
Checking `vdir'...                                          not infected
Checking `w'...                                             not infected
Checking `write'...                                         not infected
Checking `aliens'...                                        no suspect files
Searching for sniffer's logs, it may take a while...        nothing found
Searching for rootkit HiDrootkit's default files...         nothing found
Searching for rootkit t0rn's default files...               nothing found
Searching for t0rn's v8 defaults...                         nothing found
Searching for rootkit Lion's default files...               nothing found
Searching for rootkit RSHA's default files...               nothing found
Searching for rootkit RH-Sharpe's default files...          nothing found
Searching for Ambient's rootkit (ark) default files and dirs... nothing found
Searching for suspicious files and dirs, it may take a while... nothing found
Searching for LPD Worm files and dirs...                    nothing found
Searching for Ramen Worm files and dirs...                  nothing found
Searching for Maniac files and dirs...                      nothing found
Searching for RK17 files and dirs...                        nothing found
Searching for Ducoci rootkit...                             nothing found
Searching for Adore Worm...                                 nothing found
Searching for ShitC Worm...                                 nothing found
Searching for Omega Worm...                                 nothing found
Searching for Sadmind/IIS Worm...                           nothing found
Searching for MonKit...                                     nothing found
Searching for Showtee...                                    nothing found
Searching for OpticKit...                                   nothing found
Searching for T.R.K...                                      nothing found
Searching for Mithra...                                     nothing found
Searching for LOC rootkit...                                nothing found
Searching for Romanian rootkit...                           nothing found
Searching for Suckit rootkit...                             Warning: /sbin/init INFECTED
Searching for Volc rootkit...                               nothing found
Searching for Gold2 rootkit...                              nothing found
Searching for TC2 Worm default files and dirs...            nothing found
Searching for Anonoying rootkit default files and dirs...   nothing found
Searching for ZK rootkit default files and dirs...          nothing found
Searching for ShKit rootkit default files and dirs...       nothing found
Searching for AjaKit rootkit default files and dirs...      nothing found
Searching for zaRwT rootkit default files and dirs...       nothing found
Searching for Madalin rootkit default files...              nothing found
Searching for Fu rootkit default files...                   nothing found
Searching for ESRK rootkit default files...                 nothing found
Searching for rootedoor...                                  nothing found
Searching for ENYELKM rootkit default files...              nothing found
Searching for common ssh-scanners default files...          nothing found
Searching for suspect PHP files...                          nothing found
Searching for anomalies in shell history files...           nothing found
Checking `asp'...                                           not infected
Checking `bindshell'...                                     not infected
Checking `lkm'...                                           chkproc: nothing detected
chkdirs: nothing detected
Checking `rexedcs'...                                       not found
Checking `sniffer'...                                       lo: not promisc and no packet sniffer sockets
eth0: PACKET SNIFFER(/sbin/dhclient[577])
eth1: not promisc and no packet sniffer sockets
Checking `w55808'...                                        not infected
Checking `wted'...                                          chkwtmp: nothing deleted
Checking `scalper'...                                       not infected
Checking `slapper'...                                       not infected
Checking `z2'...                                            chklastlog: nothing deleted
Checking `chkutmp'...                                       chkutmp: nothing deleted
Checking `OSX_RSPLUG'...                                    not infected

Install the Latest Version of chkrootkit

The chkrootkit version that Ubuntu Trusty Tahr shipped is version 0.49 while the latest version is 0.50. We can use latest version by downloading from chkrootkit website.

Download the latest version of chkrootkit :

$ wget -c ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz

Download the package md5 hash file.

$ wget -c ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.md5

Let’s verify that the file we downloaded is not corrupted or tampered with in any way. It should show OK.

$ md5sum -c chkrootkit.md5 
chkrootkit.tar.gz: OK

Extract the package.

$ tar xzvf chkrootkit.tar.gz 
chkrootkit-0.50
chkrootkit-0.50/chkproc.c
chkrootkit-0.50/COPYRIGHT
chkrootkit-0.50/README.chkwtmp
chkrootkit-0.50/chkutmp.c
chkrootkit-0.50/chkwtmp.c
chkrootkit-0.50/ifpromisc.c
chkrootkit-0.50/strings.c
chkrootkit-0.50/chklastlog.c
chkrootkit-0.50/chkrootkit.lsm
chkrootkit-0.50/check_wtmpx.c
chkrootkit-0.50/chkdirs.c
chkrootkit-0.50/Makefile
chkrootkit-0.50/README
chkrootkit-0.50/README.chklastlog
chkrootkit-0.50/ACKNOWLEDGMENTS
chkrootkit-0.50/chkrootkit

Go to extracted directory and compile chkrootkit.

$ cd chkrootkit-0.50
$ make sense

Now to run chkrootkit you can use command below :

$ sudo ./chkrootkit

To check whether we already get the latest version we can use -V option :

$ ./chkrootkit -V
chkrootkit version 0.50

The one installed from Ubuntu repository is still there, we can check the version also by running command below:

$ chkrootkit -V
chkrootkit version 0.49

Enable Scheduled Check

chkrootkit package that comes from Ubuntu repository comes with crontab configuration. The crontab is scheduled to run daily. To enabled the daily check you can open /etc/chkrootkit.conf :

Replace the first line:

RUN_DAILY="false"

with

RUN_DAILY="true"

Summary

In this tutorial we learned how to install and use chkrootkit on Ubuntu 14.04. We also learned to install the latest version of chkrootkit by downloading the source code and compiling the code to create executable binary. We also learn enabling daily check schedule that comes with chkrootkit package.

Using chkrootkit will help us secure our servers by making sure the server does not have rootkits running.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]