← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux LD_PRELOAD Rootkit Dataset

This hunt uses a simulated Linux auditd dataset (linux_ld_preload_rootkit_2022-05-28T033000.json) capturing T1014: Rootkit and T1574.006: Dynamic Linker Hijacking, where an adversary with root access installs a shared-object rootkit via /etc/ld.so.preload, hooking libc functions to hide malicious processes, files, and network connections from standard tools.

Step 1: Hypothesis Formation

Hypothesis: A shared library is written to disk (commonly under /usr/lib or /lib) and a reference to it is added to /etc/ld.so.preload, after which standard enumeration tools (ps, ls, netstat) on the host fail to show a process/connection that is independently confirmed present via kernel-level telemetry (auditd syscalls, eBPF). Indicators:

Null Hypothesis: The .so file and ld.so.preload entry are part of a legitimate performance/monitoring tool (e.g., an APM agent using LD_PRELOAD for instrumentation). Invalidate via checking the file against known vendor hashes and confirming a documented change ticket for the software installation.

Rationale: LD_PRELOAD rootkits defeat userspace enumeration entirely, making this one of the few Linux persistence techniques that specifically requires kernel-level or out-of-band telemetry to detect; this hunt validates the auditd-plus-cross-tool-discrepancy approach.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (6 shown) confirm a rootkit library installed via ld.so.preload, with a confirmed discrepancy between kernel-level and userspace process visibility.

Timestamp (UTC)HostActorEventIOC/Why Suspicious?
2022-05-28 03:32:15db02.internalrootauditd WRITE: /usr/lib/libselinux-cache.so createdNew-library IOC: file created by a root shell process, no corresponding dpkg transaction in package manager logs.
2022-05-28 03:32:20db02.internalrootauditd WRITE: /etc/ld.so.preload set to /usr/lib/libselinux-cache.soPreload IOC: this file is empty by default on a hardened baseline; any content is a high-confidence rootkit indicator.
2022-05-28 03:35:00db02.internal-eBPF telemetry shows process nc -lvp 4444 running (PID 8821)Kernel-level visibility confirms a listening backdoor process.
2022-05-28 03:35:00db02.internal-ps aux output (same timestamp) shows no PID 8821Hiding IOC: userspace enumeration fails to show a process that kernel-level telemetry confirms exists - textbook LD_PRELOAD hooking of readdir//proc parsing.
2022-05-28 03:36:10db02.internal-Raw /proc/net/tcp parse shows a listener on port 4444netstat on the same host at the same time shows no such listener - second independent hiding confirmation.
-db02.internal(static analysis)libselinux-cache.so exports hooks for readdir, fopen, statFunction exports match exactly the libc calls typically hooked by userland rootkits to filter process/file listings.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an LD_PRELOAD rootkit was installed to hide a listening backdoor process from standard userspace enumeration tools!