Rootkits and Bootkits
A rootkit is malware designed to hide its presence and that of other components, lying to the operating system (and the analyst) about its own state: processes, files, keys, or connections that “don’t exist” even though they’re there. A bootkit takes the idea to boot time, loading before the OS to control it from below. They’re the stealthy extreme of malware and the hardest to eradicate. This page treats them from detection and response.
Threat model
Section titled “Threat model”A rootkit’s power depends on the privilege ring it lives in: the deeper, the more it can hide, but the more privilege it takes to install. A user-mode rootkit (ring 3) only fools what passes through its hooks; a kernel one (ring 0) can lie to any tool that trusts the OS; a bootkit lives beneath the whole OS. The defensive consequence: the deeper the rootkit, the less reliable it is to analyze the system from within itself — you must look from outside (acquired memory, external boot, firmware integrity).
flowchart TD R3[Ring 3 · user-mode<br/>API hooks, hides within an app] --> V[Attacker visibility] R0[Ring 0 · kernel<br/>driver, hides from the whole OS] --> V FW[Firmware / UEFI<br/>bootkit, before the OS] --> V V --> D[Detection and eradication difficulty]
Levels
Section titled “Levels”User-mode (ring 3)
Section titled “User-mode (ring 3)”They hook APIs in user space to filter what applications see (e.g. hiding a process from a list). Easier to install (no kernel required) but also to detect: a tool that doesn’t go through their hooks sees them. ATT&CK T1014.
Kernel-mode (ring 0)
Section titled “Kernel-mode (ring 0)”A malicious driver manipulates kernel structures (e.g. unlinking a process from the scheduler’s list) or intercepts system calls. It can lie to almost any tool that trusts the OS. It requires loading a driver — which is why modern Windows sees BYOVD (Bring Your Own Vulnerable Driver) abuse: loading a legitimate signed but vulnerable driver to operate from kernel without signing your own code.
Bootkits and boot threats
Section titled “Bootkits and boot threats”They persist in firmware or the first boot sectors, loading before the OS:
- MBR/VBR (legacy BIOS): tampering with the boot sector.
- UEFI: implants in the EFI partition or the SPI flash itself; the most persistent, surviving OS reinstalls.
- Device firmware: implants in peripheral firmware.
Detection
Section titled “Detection”The key is cross-view comparison: compare what the system says from inside with what’s observed from outside.
- Acquired memory (see Memory forensics):
psscanfinds processespslisthides; discrepancies = rootkit suspicion. - Anti-rootkit tools that compare views at different levels.
- Firmware integrity: CHIPSEC-type tools verify UEFI configuration and SPI flash.
- osquery/EDR to enumerate loaded drivers and modules and contrast with a signed baseline.
- External boot: boot from clean media to analyze the disk without the active rootkit.
Modern defenses that changed the picture
Section titled “Modern defenses that changed the picture”- Secure Boot verifies each boot component’s signature → cuts unsigned bootkits.
- Driver Signature Enforcement and the Microsoft Driver Blocklist make loading malicious drivers harder and mitigate BYOVD.
- HVCI / VBS (virtualization-based security) isolates the kernel and protects its integrity.
- TPM + measured boot detects tampering with the boot chain.
Red Team
Section titled “Red Team”In authorized exercises, emulating rootkit/bootkit capability is uncommon and high-risk; when it’s in scope, the value is checking whether Secure Boot, the driver blocklist, and integrity monitoring stop or detect the attempt. Recognizing BYOVD and known vulnerable drivers is, above all, detection work.
Blue Team
Section titled “Blue Team”Telemetry
Section titled “Telemetry”- Driver loads (Sysmon 6), installation of driver-type services, code-integrity events (HVCI).
- Alerts from the Driver Blocklist and from attempts to disable Secure Boot/HVCI.
Response (eradication)
Section titled “Response (eradication)”- A confirmed user/kernel rootkit: don’t “clean” — reinstall from clean media after preserving evidence.
- A UEFI bootkit: may require reflashing the firmware; in severe cases, hardware replacement.
- Always: preserve memory and disk images before eradicating (see DFIR).
CVEs and real-world cases
Section titled “CVEs and real-world cases”- LoJax (2018) — first documented UEFI bootkit used in the wild (APT28), able to survive OS reinstallation.
- BlackLotus (2023) — a UEFI bootkit that evaded Secure Boot by abusing a flaw (CVE-2022-21894, “baton drop”), a milestone that forced boot-certificate revocations.
- BYOVD: drivers like RTCore64 (MSI Afterburner) and CVE-2021-21551 (Dell dbutil) abused by ransomware and APTs to take down defenses from kernel.
- ATT&CK: T1014 (Rootkit), T1542 (Pre-OS Boot / bootkits), T1068 (Exploitation for Privilege Escalation, to reach kernel).
Testing checklist
Section titled “Testing checklist”- Cross-view comparison on acquired memory (
pslistvspsscan) - Enumerate loaded drivers/modules vs a signed baseline
- Verify firmware/UEFI integrity (CHIPSEC) on bootkit suspicion
- Vulnerable driver loaded (BYOVD)? contrast with the blocklist
- Analyze the disk from a clean external boot
- Preserve memory and disk before eradicating
- Eradication matched to the level (reinstall / reflash / replace)
- Verify Secure Boot / HVCI / Driver Blocklist are active