What an Offline Rootkit Check Can and Cannot Prove
Layer by layer (firmware, boot, kernel, userland): what files and logs show about a rootkit, what they never show, and what to do when offline checks run out.
TL;DR. An offline check reads what a rootkit left in files: the EFI system partition, boot sectors, Measured Boot logs, driver and module files, their load configuration, preload files and kernel logs. It can prove that something is there.
It cannot prove that nothing is there, because three places stay out of reach:
- SPI flash firmware;
- kernel memory;
- anything the rootkit hid from a collection taken while it ran.
For each layer below, read what the files show, what they never show, and the next step: a firmware dump, a memory image, a capture taken outside the host, or a rebuild.
The layers at a glance
| Layer | Examples | What files and logs can show | What they cannot show | Next step |
|---|---|---|---|---|
| Firmware | LoJax, MoonBounce, CosmicStrand | Hints at best: changed firmware measurements in Measured Boot logs, a dropper on disk | The implant itself, in SPI flash | Dump and compare the flash; reflash or replace |
| Boot | BlackLotus, ESPecter, Bootkitty, Gapz | Changed or unsigned boot files on the ESP, staging folders, odd MBR/VBR code, boot events in TCG logs | Whether the firmware trusts or revokes a binary (db/dbx in NVRAM), in-memory patches made during boot | Read Secure Boot state and DBX; rebuild the ESP or boot sectors |
| Kernel | Diamorphine, Reptile, KoviD, TripleCross, Snake | Module or driver files, signatures, load configuration, taint and code-integrity events, live outputs | Modules loaded from memory, eBPF programs, hooks, anything the rootkit filters | Memory image and analysis |
| Userland | libprocesshider, Azazel, Symbiote, r77 | Preload files and libraries, replaced binaries and PAM modules that differ from packages | Per-process preloads, deleted libraries still mapped, injected code | Static tools on the live host, memory image |
Firmware: out of reach of the disk
A firmware implant is code in the motherboard's SPI flash: a modified or added UEFI driver. It runs before any disk is read. Wiping or replacing the disk does not remove it.
What files show. At most, hints:
- Droppers. Some families leave a dropper or a payload on disk after the firmware stage runs. LoJax's userland agent is one example.
- Measurements. Measured Boot logs record hashes of firmware components as the platform measures them. A firmware measurement that changes between two boots of the same machine, with no firmware update in between, is worth explaining.
Both are indirect. A measurement log records what was measured, not whether it was good, and the code that measures runs inside the firmware being judged.
What to do next. Dump the flash and compare it with the vendor's image for the same version:
chipsec_util spi dump rom.bin # CHIPSEC, as root; it loads its own kernel driver
fwupdmgr security # fwupd's host security summary (firmware protections, Secure Boot)
CHIPSEC documents spi dump among its SPI commands. Open the dump in a UEFI image parser such as UEFITool and look for drivers the vendor image does not have. A dump read through the running system trusts that system. Where the stakes justify it, read the chip with an external programmer.
Recovery. A reinstall does nothing here. Reflash the firmware from a known-good vendor image or replace the board, as ESET's guidance for LoJax describes, then dump the flash again to confirm. The checker's modules do not read SPI flash. The LoJax and MoonBounce pages say so explicitly.
Boot: files, plus state that is not in files
Bootkits replace or patch code that runs between the firmware and the kernel: UEFI boot managers and loaders on the EFI system partition, or the MBR and volume boot records on BIOS systems.
What files show. A copy of the ESP and of the disk's first and last megabyte shows a lot:
- changed boot managers, broken or missing signatures, and files that should not be there (BlackLotus's staging folder, an unexpected
grubx64.efi); - non-standard MBR boot code, and data in the sectors before the first partition;
- an NTFS boot record whose hidden-sectors field does not match its partition.
Measured Boot logs add which boot applications ran and whether Secure Boot was on. The checker's esp, bootsector and measuredboot modules read these. See checking the ESP for bootkits offline and reading Measured Boot logs.
What files cannot show:
- Firmware trust. Which certificates the firmware trusts (
db) and which binaries it revokes (dbx) live in NVRAM variables, not on the disk. A boot manager signed by Microsoft may still be one that the DBX should block, as with BlackLotus's vulnerable boot managers. Read the state on the machine:- Windows:
Confirm-SecureBootUEFI; - Linux:
mokutil --sb-state, andefi-readvar -v dbxfrom efitools.
- Windows:
- Chain trust. A signature that parses is not a signature the firmware accepts. The checker reports signers; it does not rebuild trust chains against the machine's
db. - In-memory patches. Several bootkits patch the OS loader or kernel in memory during boot and never write those changes to disk. ESPecter is an example.
Recovery. Rebuild the ESP or boot sectors from trusted media, apply the vendor's revocation updates, keep Secure Boot on, and reinstall the operating system the bootkit loaded.
Kernel: memory is the reference
Kernel rootkits run as code in the kernel: Linux modules, eBPF programs and Windows drivers.
What files show:
- Linux. Module files that are unsigned, unowned or missing from the kernel's own lists. Load configuration lines, and the kernel's taint warnings in the logs. See checking Linux kernel modules offline.
- Windows. Driver services, unsigned or blocklisted driver files, and Code Integrity events. See hunting BYOVD drivers offline.
- Live outputs saved by a collection. They add a cross-check: a module listed in
/sys/modulebut not in/proc/modules.
What files cannot show:
- Modules that never reached the disk. Reptile's loader decrypts its module in memory. PUMAKIT's dropper runs from anonymous memory files. A module can be deleted after loading.
- eBPF programs. They are kernel objects, not files. TripleCross leaves only a loader and its cron and sudoers entries.
- Hooks and hidden objects. Syscall table entries, ftrace callbacks, replaced VFS operations, unlinked modules and processes exist only in memory.
- Honest live outputs. A loaded rootkit filters what the collection reads. KoviD hides from both module views and sets the taint value to zero. A collect script that ran on the infected host saw the filtered view.
What to do next. Capture memory before rebooting or cleaning:
- Acquisition. AVML runs in userland. LiME is itself an out-of-tree kernel module and taints the kernel. Linux Forensics' memory acquisition page compares them.
- Linux analysis. Run Volatility 3's
linux.malware.hidden_modules,linux.malware.check_modules,linux.malware.check_syscall,linux.tracing.ftraceandlinux.ebpf. - Windows analysis. The equivalents include
windows.modscan,windows.driverscan,windows.ssdtandwindows.callbacks. - Live programs. On a running Linux host,
bpftool prog showlists eBPF programs from the kernel's own interface.
Recovery. Code ran with full control of the machine. Rebuild from trusted media and rotate every credential the host held or saw. Removing the module and rebooting is not a reason to trust the host again.
Userland: easy to see from outside
Userland rootkits hook libraries inside processes: a library in /etc/ld.so.preload on Linux, API hooks injected into processes on Windows.
What files show. On Linux, the preload file and the library it names: its exported libc functions, its owner and its times. Replaced binaries or PAM modules show by comparing them with their packages. See ld.so.preload and userland rootkits.
What files cannot show:
- a preload set only in one service's environment;
- a library deleted from disk but still mapped in running processes;
- code injected into memory without a file;
- a live collection that the rootkit filtered. Azazel hides
/etc/ld.so.preloaditself from dynamically linked programs.
What to do next. A userland rootkit cannot hide from what does not load it:
- statically linked tools on the live host, started as a static shell;
/proc/<pid>/mapsread through those tools;- a disk image read on a clean machine;
- network captures taken on another device.
Capture memory if processes need to be examined.
Recovery. Removing the preload stops new processes from loading the library. The intruder still had root to install it. Rebuild unless every action of that root session can be accounted for, and rotate credentials that passed through PAM, SSH or sudo.
Where the evidence came from matters
The same check gives different assurance depending on how the files were collected:
| Source | Trust |
|---|---|
| Disk image read on a clean analysis machine | Best for files: no rootkit runs while you read |
| Files copied from a clean boot (rescue media) | Equivalent, if the boot media is trusted and the firmware is not implanted |
| Collection made on the running host with static tools | Defeats userland rootkits; a kernel rootkit still filters it |
| Collection made on the running host with the system's own tools | Filtered by any active rootkit; good for live state, weak for absence |
| Memory image | The reference for what is running, kernel and userland |
The rootkits.dev collect script runs on the live host. It is fast and captures live state the disk does not have, but it inherits the host's blindness. Take a disk image when a rootkit is suspected.
What to do when the checks run out
| Situation | Next step |
|---|---|
| A finding at any layer | Preserve: memory first, then disk, then the ESP and disk head. Scope from network logs. Plan a rebuild |
| No finding, but signs that the host lies: taint with no culprit, traffic with no process, CPU load with no consumer | Memory image; network capture from outside the host; compare with a known-good host of the same build |
| No finding, high-value host, firmware threat in scope | SPI flash dump compared with the vendor image; Secure Boot state and DBX |
| Rootkit confirmed | Rebuild from trusted media; rotate credentials; reflash firmware if implicated; enforce module and driver signing; keep Secure Boot on |
An offline check is the cheap, fast first pass: it finds what rootkits most often leave behind, with nothing uploaded. Treat a clean result as "nothing found in the files examined", and say which layers those were.
The rootkits.dev checker runs these checks in the browser:
| Module | Reads |
|---|---|
esp | The EFI system partition: EFI binaries and their signatures, BCD stores, other files |
measuredboot | Measured Boot and TCG logs |
windrivers | Windows driver services and files, Amcache, System and CodeIntegrity events |
bootsector | MBR, VBR and GPT, and the sectors around them |
linuxkernel | Linux modules, load configuration, preload files and libraries, kernel logs, the collect script's live outputs |
Next to its results, each module says what it could not read or see. The sample walk-through shows what the checker reports on four synthetic hosts, and what it leaves open.
Frequently asked questions
If an offline check finds nothing, is the host clean?
No. An offline check reads files and logs. Firmware implants live in SPI flash, many kernel rootkits exist only in memory, and a rootkit active during a live collection can hide its files from it. A clean result lowers the odds for the layers the check covers and says nothing about the others.
When do I need a memory image?
Whenever a kernel or userland rootkit is suspected on a running machine: an unexplained taint, network activity no process accounts for, a preload file, a module that hides. Memory is the only place where unlinked modules, eBPF programs, hooks and injected libraries can be seen together. Capture it before rebooting or cleaning.
Can I check firmware for an implant from a disk image?
No. Firmware implants such as LoJax, MoonBounce and CosmicStrand live in the SPI flash chip on the motherboard, not on the disk. You need a dump of the flash, read with a tool such as CHIPSEC or an external programmer, and a known-good image from the vendor to compare against.
Is reinstalling the operating system enough after a rootkit?
For userland and kernel rootkits, a reinstall from trusted media with new credentials is the standard answer. For bootkits, also rebuild the EFI system partition or boot sectors and update the Secure Boot revocation list (DBX) where the vendor requires it. For firmware implants, a reinstall does nothing: the flash has to be rewritten or the board replaced.