How I Detected and Eradicated a Linux Rootkit on My Home Network

After a sudden network outage, the author discovers a Linux virtual machine consuming all upstream bandwidth, uncovers a hidden rootkit through process inspection, and documents step‑by‑step methods—including disabling the NIC, using strace, and forcibly removing malicious binaries—to remediate the infection.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How I Detected and Eradicated a Linux Rootkit on My Home Network

One evening, while trying to call a friend, the author noticed QQ going offline and back online automatically, suspecting a hack. After the call, the issue was traced to an unstable broadband connection, but soon even basic sites like Baidu became unreachable.

Event Origin

The author logged into the router and found a Linux virtual machine monopolizing all upstream traffic, indicating a possible malware infection.

Investigation Steps

1. Examine processes with ps and top

Two processes with random English names appeared in ps. The top screenshot showed high bandwidth usage.

Killing these processes temporarily reduced bandwidth, but they reappeared quickly, suggesting a background daemon.

2. Disable the VM network card

The VM NIC was switched to vmnet host only mode and its IP set to the same subnet as the VMware virtual NIC to allow SSH access while isolating it from the internet.

3. Locate the program files

Using ls /proc/\<pid\>/exe revealed that the malicious binaries changed paths within the PATH directories, appearing in /bin, /sbin, and /usr/bin.

4. Search for hidden files

Scanning /bin, /sbin, and /usr/bin for files starting with a dot uncovered numerous hidden executables that regenerated after deletion.

Because strace was not installed, the author mounted an ISO, created a local YUM repository, and installed it.

Running strace /bin/hzqzqdmatu showed the process self‑deleting its executable file.

Further checks with netstat revealed no external connections, and timestamps of common commands ( ps, ls, netstat, etc.) indicated they had been modified on June 24, suggesting a user‑mode rootkit.

The author also inspected for additional admin accounts; only root existed, confirming no extra users were created.

5. Delete malicious binaries and reboot

All identified malicious programs were forcefully removed, the VM was powered off, and then rebooted.

Despite the reboot, the programs reappeared, indicating they were registered as startup services across multiple run levels.

After another round of forced deletion and reboot, CPU usage dropped and the malicious processes ceased.

The author concluded that once a rootkit compromises the system, the only reliable remedy is a full reinstall. For demonstration, a recovery method on CentOS 6.8 is described: identify the RPM packages providing compromised commands, force‑remove them, and reinstall via a local YUM source.

Finally, the author emphasizes that systematic troubleshooting—examining processes, network activity, and system logs—is essential, and encourages continuous learning to handle such security incidents effectively.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

network troubleshootingCentOSRootkit
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.