Linux LKM rootkit
Drovorub Linux Rootkit: Traces and Offline Checks
Drovorub is a Linux implant with a kernel module rootkit, disclosed by NSA and FBI in 2020. Its components, what it hides, offline checks and recovery.
- Kind
- Linux LKM rootkit · Kernel layer
- Platforms
- Linux
- First seen
- 2019
- Status
- In the wild
- Checked by
- Linux kernel
Overview
Drovorub is a Linux malware toolset that the US National Security Agency and the FBI disclosed in a joint Cybersecurity Advisory in August 2020. It has four components:
| Component | Role |
|---|---|
| Drovorub-client | The implant on the victim: file transfer, port forwarding, a root shell |
| Drovorub-kernel module | The rootkit that hides the client, its files, processes and connections, and itself |
| Drovorub-agent | File transfer and port forwarding, likely on internet-facing or actor-controlled hosts; no rootkit |
| Drovorub-server | Command and control, with a MySQL database |
The components talk JSON over WebSockets, through a statically linked copy of the open-source POCO C++ libraries.
Attribution. NSA and FBI attribute Drovorub to the Russian GRU's 85th Main Special Service Center (GTsSS), military unit 26165. Private-sector reporting tracks that unit as APT28, Fancy Bear or Strontium. The advisory supports the attribution with infrastructure: an IP address that Microsoft had linked to Strontium in 2019 was used to reach a Drovorub C2 server in April 2019. That is the earliest date the advisory gives, hence the "first seen" year on this page.
The advisory is the only primary technical source. It gives no victim names or numbers.
How it loads and hides
Loading. The client is packaged with the kernel module. When both start:
- the module installs its hooks;
- the client registers with it;
- the module hides the client's processes and its executable on disk.
If the client cannot reach the module, it exits. After registering with the server, the client asks for lists of extra files, modules and ports to hide.
The advisory says the rootkit "persists through reboot of an infected machine unless UEFI secure boot is enabled in 'Full' or 'Thorough' mode". It does not name Drovorub's own persistence file. It lists the standard places a module can be loaded from at boot:
| Distribution | Load configuration named in the advisory |
|---|---|
| Red Hat family | an executable *.modules script in /etc/sysconfig/modules/, /etc/modules.conf, a .conf file in /etc/modules-load.d/ |
| Debian family | /etc/modules, a .conf file in /etc/modules-load.d/ |
| Both | modules usually stored under /lib/modules/<release>/kernel/drivers/ |
Hiding. The module hooks kernel functions, by patching them or by overwriting function pointers:
- Processes. Depending on the kernel version, it hooks
find_pid_ns(),find_pid()orfind_task_by_pid_type(). For/proc, it hooksd_lookup(),iterate_dir()orvfs_readdir()and the/proclookup operation. It also hooksdo_fork()so that children of hidden processes are hidden too. - Files.
iterate_dir()orvfs_readdir()filter listings. A hidden file stays accessible by name. - Sockets. It finds the functions behind
/proc/net/tcp,tcp6,udpandudp6and filters entries by port or owning process. - Netfilter. It registers hooks at
LOCAL_INandLOCAL_OUT, and hooksnf_register_hook()so that its own hook stays ahead of any firewall hook added later. It drops hidden traffic before other hooks see it. - Raw sockets. It hooks
skb_recv_datagram()to filter hidden sessions from packet captures. - Modules. It hides "specified loaded kernel modules, to include itself".
The client controls the module through a pseudo-device that normally takes no meaningful input, /dev/zero in the analysed samples. The module answers by sending SIGUSR1 to the client.
Traces on disk
The advisory stresses that the client's files "are present and persistent on compromised endpoint disk media, though hidden from normal system binaries". Reading the disk from a clean system is the most practical host check after memory analysis.
| Item | What | Source |
|---|---|---|
| The client executable | Statically linked, with POCO and OpenSSL; hidden from listings while the module runs | NSA/FBI |
| The client's JSON configuration file, written after first registration | Fields "id" (a UUID), "key" and a "monitor" section listing hidden files, modules and ports. The default key is Y2xpZW50a2V5, the base64 of clientkey | NSA/FBI |
The kernel module, usually under /lib/modules/<release>/kernel/drivers/ | Unsigned rootkit module | NSA/FBI (typical location) |
| A boot load entry from the table above | Persistence of the module | NSA/FBI (generic) |
| Kernel log taint lines naming an unknown module | Load of an unsigned, out-of-tree module | Linux kernel |
The agent's JSON configuration (client_login, client_pass, server_host, server_port, server_uri, then clientid, clientkey_base64) | On relay hosts, not on rootkit victims | NSA/FBI |
The file names and paths in the advisory's examples (for instance a client running from /tmp) come from a lab. NSA and FBI warn that they "should not be assumed to have actually been used by the actor". Do not hunt for them as indicators. The advisory's Yara rules (drovorub_kernel_module_unique_strings among them) and Snort rules are the indicators to use.
How to check a host
Network. The advisory rates network detection as high-confidence:
- Client-to-server WebSocket messages are XOR-masked, as RFC 6455 requires.
- Server-to-client messages are plain JSON with a
{"children":[{"name":…structure. - A periodic
pingmessage is also recognisable.
The Snort rules in the advisory match both. TLS interception at the boundary is needed if the channel is encrypted.
Live. NSA and FBI state that the module hides artifacts from the tools used "for live-response at scale", which leads to false negatives. The advisory gives a probe that writes a hide request for a test file to the pseudo-device. If the file disappears, the host is infected. If not, nothing is proven, because the signature string or the device may differ. Read the advisory's detection section before running it, and prefer memory capture.
cat /proc/sys/kernel/tainted
dmesg | grep -iE 'taint|module verification'
for m in /sys/module/*; do [ -e "$m/initstate" ] && ! grep -q "^${m##*/} " /proc/modules && echo "only in sysfs: ${m##*/}"; done
The advisory does not say whether Drovorub leaves a /sys/module entry, so the last check may or may not fire.
Memory. The advisory calls memory analysis "the most effective approach". With Volatility 2, it finds the module with linux_hidden_modules and the client with linux_psxview and linux_psaux, then dumps the module and matches the Yara rule. Volatility 3's equivalents are linux.malware.hidden_modules, linux.psscan and linux.psaux.
Offline.
R=/mnt/evidence
cat "$R"/etc/modules "$R"/etc/modules.conf "$R"/etc/modules-load.d/*.conf "$R"/etc/sysconfig/modules/*.modules 2>/dev/null
grep -rlaF 'Y2xpZW50a2V5' "$R"/etc "$R"/usr "$R"/var "$R"/opt "$R"/root "$R"/home "$R"/tmp 2>/dev/null # default client key
yara -r drovorub.yar "$R"
zgrep -hE 'taint|module verification' "$R"/var/log/kern.log* "$R"/var/log/messages* 2>/dev/null
Use the Yara rules exactly as published in the advisory (drovorub.yar above stands for a file holding them). Then check every module you cannot explain for a signature and an owning package: see checking kernel modules offline.
What the checker looks for
The linuxkernel module can see:
- A module file under
lib/modules/: "Unsigned module among signed modules", and "Module unknown to the kernel build and to every package" whenmodules.orderdoes not list it and no dpkg package owns it. Ownership is read from the dpkg database only: on an RPM-based host the finding rests onmodules.orderand says the database is missing.modules.deplists the file ifdepmodran after it was planted; if not, "Module not indexed by depmod" adds a low finding. - Its boot entry in
/etc/modulesormodules-load.d: "Boot configuration loads a flagged module". - The kernel's taint warnings in
kern.logormessages: "Kernel log: out-of-tree module loaded", "Kernel log: unsigned module loaded". - The live module lists. With the collect script's
_live/outputs, "Loaded module missing from /proc/modules" if Drovorub leaves its/sys/moduleentry, which the advisory does not settle; and, for a module set to load at boot that is on disk but absent from/proc/modules, "Set to load at boot, missing from the live module list".
It does not see:
- RHEL
/etc/sysconfig/modules/*.modulesscripts; - the client and its JSON configuration;
- the network channel.
It does not run the advisory's YARA rules.
Removal and recovery
- Capture memory, then image. The hidden process list, the module and the client's live state are best recovered from memory, as the advisory recommends.
- Find every component from the image and with the advisory's Yara rules: the client, its configuration (which lists what else was hidden), the module and its load entry. Use the configuration's hidden-port list and the network logs to find relays and other infected hosts.
- Rebuild. The client ran arbitrary commands as root, and the module controlled what the kernel reported. Rebuild from known-good media.
- Rotate credentials used on the host. Hunt for the same C2 server and agent hosts across the network.
- Harden as the advisory recommends:
- Run a kernel recent enough for signature enforcement (3.7 or later).
- Allow only validly signed modules.
- Enable UEFI Secure Boot in full or thorough mode, which the advisory says stops Drovorub's persistence.
See Reptile for an open-source rootkit used in espionage intrusions with similar hiding goals.
Sources
Primary public reports, newest first.
- 2020-08-13Russian GRU 85th GTsSS Deploys Previously Undisclosed Drovorub MalwareNSA and FBI
See also
Related families
- ReptileLinux LKM rootkit
- DiamorphineLinux LKM rootkit
- SkidmapLinux LKM rootkit