Skip to content

What an Offline Bootkit Check Can and Cannot Prove

Firmware and boot chain: what the ESP, disk boot sectors and Measured Boot logs show about a bootkit, what they never show, and what to do when checks run out.

Published on 9 min read

TL;DR. An offline bootkit check reads what a bootkit left below the operating system: the EFI system partition (ESP), the disk's boot sectors and the Measured Boot logs. It can prove that something is there.

It cannot prove that nothing is there, because four places stay out of reach:

  • SPI flash firmware;
  • NVRAM: the Secure Boot databases, the MOK list and the boot entries;
  • memory, where bootkits patch the OS loader and the kernel during boot;
  • anything the bootkit 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 read of the live Secure Boot state, an image taken outside the host, or a rebuild. Kernel drivers, Linux modules and userland rootkits are the operating system's layers, covered on rootkits.dev in what an offline rootkit check can and cannot prove.

The layers at a glance

LayerExamplesWhat files and logs can showWhat they cannot showNext step
FirmwareLoJax, MoonBounce, CosmicStrandHints at best: changed firmware measurements in Measured Boot logs, a dropper on diskThe implant itself, in SPI flashDump and compare the flash; reflash or replace
UEFI bootBlackLotus, ESPecter, Bootkitty, FinSpyChanged or unsigned boot files on the ESP, staging folders, BCD settings, boot applications in TCG logsWhether the firmware trusts or revokes a binary (db/dbx in NVRAM), in-memory patches made during bootRead Secure Boot state and DBX; rebuild the ESP
Legacy bootTDL4, Rovnix, GapzNon-standard MBR or VBR code, data around the partitions, a hidden-sectors value that does not matchSectors the bootkit filtered from a live read; encrypted payloadsImage the whole disk from a clean boot; rebuild

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; its installation tools also used a kernel driver, a trace that rootkits.dev can see.
  • 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.

UEFI boot: files, plus state that is not in files

UEFI bootkits replace or patch code that runs between the firmware and the kernel: the boot managers and loaders on the EFI system partition.

What files show. A copy of the ESP 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);
  • BCD settings that lower the defences, such as test signing, integrity checks turned off, or another BCD store;
  • file times that stand out from the rest of their folder.

Measured Boot logs add which boot applications ran, whether Secure Boot was on, and Windows' own boot settings, boot by boot. 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, and efi-readvar -v dbx from efitools.
  • 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.
  • Enrolled keys. An attacker certificate in shim's MOK list, as BlackLotus and Bootkitty's LogoFAIL file add, lives in NVRAM. mokutil --list-enrolled reads it on the live host, knowing an active bootkit may control the answer.
  • 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.
  • The logs' own integrity. Measured Boot logs are files an administrator can edit or delete. Only a quote signed by the host's TPM binds a log to its PCR values, and an offline copy has none.

Recovery. Rebuild the ESP from trusted media, remove attacker keys from the MOK list, apply the vendor's revocation updates, keep Secure Boot on, and reinstall the operating system the bootkit loaded.

Legacy boot: sectors, read from outside

On BIOS machines, MBR and VBR bootkits replace the boot code in the disk's first sector or in a partition's volume boot record, and keep their payload in sectors outside any file system.

What sectors show. The disk's first and last megabytes show:

  • non-standard MBR boot code, or NTFS boot and loader sectors that match no known loader;
  • data in the sectors before the first partition or after the last one;
  • an NTFS boot record whose hidden-sectors field does not match its partition, the Gapz trick;
  • an extra small partition at the end of the disk, as TDL4's Olmasco variant adds.

What sectors cannot show:

  • A live read under the bootkit. TDL4, Rovnix and Gapz filter disk reads, so a disk head copied through the infected, running Windows shows the clean sectors they return.
  • What the payload does. Their stores are encrypted, and the checker does not decrypt or parse them.
  • A partial image. A disk head of the first megabyte misses a payload kept at the end of the disk.

What to do next. Boot the machine from external media and image the whole disk, or at least its first 4 MiB and last 1 MiB, then compare the MBR and boot sectors with a clean disk of the same build.

Recovery. Wipe the whole disk, including the space outside the partitions, and reinstall from trusted media. Moving the machine to UEFI boot from a GPT disk with Secure Boot on takes MBR and VBR code out of the boot path.

Where the evidence came from matters

The same check gives different assurance depending on how the files were collected:

SourceTrust
Disk image read on a clean analysis machineBest for the ESP and the boot sectors: no bootkit runs while you read
Files and sectors copied from a clean boot (rescue media)Equivalent, if the boot media is trusted and the firmware is not implanted
ESP copied on the running hostGood for most files; an active bootkit can lock its files, as BlackLotus's driver does, or hide them
Disk head read through the running hostDefeated by any MBR or VBR bootkit that filters disk reads
Measured Boot logsA record of what ran at each boot, not tamper-proof without a TPM quote
Flash dump read through the running hostTrusts that host's firmware; an external programmer is the reference

The collect guide gathers the ESP, the Measured Boot logs and the disk's boot regions. Taken on the live host, it is fast but inherits the host's blindness. Take a disk image from a clean boot when a bootkit is suspected.

What to do when the checks run out

SituationNext step
A finding in the ESP, the boot sectors or the logsPreserve: the ESP, the Measured Boot folder and the whole disk, from a clean boot. Read the live Secure Boot state, dbx and the MOK list. Plan a rebuild
No finding, but signs that the boot chain lies: Secure Boot off with no reason, a new boot application, a gap in the boot logsImage the disk from external media; compare the ESP with a known-good host of the same build
No finding, high-value host, firmware threat in scopeSPI flash dump compared with the vendor image; Secure Boot state and DBX
Bootkit confirmedRebuild the ESP or boot sectors and the OS from trusted media; remove attacker keys; apply revocations; reflash firmware if implicated; rotate credentials; keep Secure Boot on

An offline check is the cheap, fast first pass: it finds what bootkits 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 bootkits.dev checker runs these checks in the browser:

ModuleReads
espThe EFI system partition: EFI binaries and their signatures, BCD stores, other files
measuredbootMeasured Boot and TCG logs
bootsectorMBR, VBR and GPT, and the sectors around them

Next to its results, each module says what it could not read or see. The sample walk-through shows what the checker reports on three synthetic hosts, and what it leaves open. For the operating system above the boot chain, the rootkits.dev checker reads Windows drivers and Linux kernel modules.

Frequently asked questions

If an offline boot check finds nothing, is the boot chain clean?

No. An offline check reads files, sectors and logs. Firmware implants live in SPI flash, the Secure Boot databases live in NVRAM, bootkits patch the OS loader in memory, and an MBR or VBR bootkit can return clean sectors to a collection taken while it runs. A clean result lowers the odds for what was collected and says nothing about the rest.

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.

Secure Boot was on. Does that rule out a bootkit?

No. BlackLotus keeps Secure Boot on and boots through old boot managers that Microsoft signed and that stayed valid until the DBX revoked them. Secure Boot being on rules out unsigned loaders that the firmware itself would run; it says nothing about a signed but vulnerable one, an enrolled attacker key or a firmware implant.

Is reinstalling the operating system enough after a bootkit?

Not on its own. Also rebuild the EFI system partition or the boot sectors, remove any attacker key from the MOK list, and apply the vendor's Secure Boot revocations where they apply. For a firmware implant, a reinstall does nothing: the flash has to be rewritten or the board replaced.

Related articles

Collect the EFI system partition on Windows and Linux, learn what a normal one holds, and check signers, the BCD store, file times and BlackLotus traces.
A worked bootkit check of three synthetic hosts: a clean ESP and two Measured Boot logs, a Gapz-like disk head and a BlackLotus-like EFI system partition.
Where Windows keeps Measured Boot logs, how the TCG log and its SIPA events are built, how to decode and compare boots, and what BlackLotus leaves in them.