Skip to Content
Linux Security Cookbook
book

Linux Security Cookbook

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
June 2003
Intermediate to advanced
336 pages
8h 54m
English
O'Reilly Media, Inc.
Content preview from Linux Security Cookbook

9.12. Looking for Rootkits

Problem

You want to check for evidence that a rootkit—a program to create or exploit security holes—has been run on your system.

Solution

Use chkrootkit . Download the tarfile from http://www.chkrootkit.org, verify its checksum:

$ md5sum chkrootkit.tar.gz

unpack it:

$ tar xvzpf chkrootkit.tar.gz

build it:

$ cd chkrootkit-*
$ make sense

and run it as root:

# ./chkrootkit

More securely, run it using known, good binaries you have previously copied to a secure medium, such as CD-ROM, e.g.:

# ./chkrootkit -p /mnt/cdrom

Discussion

chkrootkit tests for the presence of certain rootkits, worms, and trojans on your system. If you suspect you’ve been hacked, this is a good first step toward confirmation and diagnosis.

chkrootkit invokes a handful of standard Linux commands. At press time they are awk, cut, egrep, find, head , id, ls, netstat, ps, strings, sed, and uname. If these programs have been compromised on your system, chkrootkit’s output cannot be trusted. So ideally, you should keep around a CD-ROM or write-protected floppy disk with these programs, and run chkrootkit with the -p option to use these known good binaries.

Be sure to use the latest version of chkrootkit, which will be aware of the most recently discovered threats.

See Also

The README file included with chkrootkit explains the tests conducted, and lists the full usage information.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Command Line

Mastering Linux Command Line

Coding Gears | Train Your Brain

Publisher Resources

ISBN: 0596003919Errata Page