How to Scan for Rootkits and Malware on Linux Servers with chkrootkit

Keeping a server secure is an ongoing task, and one of the biggest threats is malicious software that hides in the system to grant an attacker persistent access. The most dangerous among them are rootkits.

In this tutorial, we will introduce an essential, top-tier tool for any system administrator: the chkrootkit.

It is a lightweight and efficient script that helps identify signs of rootkits and other suspicious files on your system.

What is a Rootkit and Why is it So Dangerous?

Before we get practical, it’s important to understand the enemy. A rootkit is a type of malicious software designed to hide itself (and other malicious activities) within the operating system.

Once installed, it can hide processes, files, network connections, and even its own binaries, making detection extremely difficult for an unsuspecting administrator.

Tutorial: Using chkrootkit on Ubuntu/Debian

chkrootkit can be easily installed from the standard repositories of Ubuntu and other Debian-based distributions.

Step 1: Update and Install chkrootkit

First, let’s ensure your system’s package list is up-to-date, and then install the tool. The -y parameter automatically confirms the installation.

sudo apt update && sudo apt install chkrootkit -y

Step 2: Run the Scan

With the tool installed, you can run the scan with a single command. It’s crucial to run it with superuser privileges (sudo) so it can inspect all areas of the system.

sudo chkrootkit

The tool will begin checking system binaries, running processes, network interfaces in promiscuous mode, and other possible indicators of compromise.

Crucial Points When Analyzing the Results

Running the tool is easy, but interpreting the results requires attention. Here are the points you need to know:

Beware of False Positives

chkrootkit can occasionally flag legitimate files or processes as suspicious. This is a “false positive”.

Before taking any drastic measures, research the specific alert you received.

Often, a quick Google search will reveal if it is a known false positive for your operating system version.

It’s a Screening Tool, Not a Forensic Analysis Tool

Think of chkrootkit as a “thermometer” for your system. It’s great for a quick check and for pointing out obvious signs of trouble.

However, it does not replace a full digital forensic analysis, nor continuous monitoring tools like an IDS (Intrusion Detection System) or IPS (Intrusion Prevention System).

Combine Tools for Better Coverage

No security tool is foolproof. A recommended practice is to combine chkrootkit with other solutions.

An excellent complement is rkhunter (Rootkit Hunter), which uses a different approach, based on signatures and file hash comparisons, to find anomalies.

Using both significantly increases your chances of detecting a real problem.

Conclusion

chkrootkit is an indispensable and easy-to-use tool in the arsenal of any system administrator who values security.

While it is not a definitive solution, it represents an excellent first layer of defense and a starting point for deeper investigations.

See more:

Netcat for Windows: The Ultimate Guide to Test-NetConnection in PowerShell

How to install and configure NGINX on Linux

Tutorial: How to Install OPNsense on VirtualBox

Packet Tracer network with one router

How to Create a Network with a Switch in Packet Tracer – Step-by-Step Guide for Beginners

https://www.vivaolinux.com.br/artigo/Chkrootkit-Como-determinar-se-o-sistema-esta-infectado-com-rootkit

Juliana Mascarenhas

Data Scientist and Master in Computer Modeling by LNCC.
Computer Engineer