scanrootkit

Bootkits and Firmware Rootkits: MBR, UEFI and SPI Flash Threats

A bootkit is a rootkit that infects the startup process instead of the running operating system. It loads before Windows, which means it can modify Windows as it loads and disable protections such as driver signature checks before they get a chance to run. A firmware rootkit goes one step further and lives in the motherboard’s own flash chip, below the disk entirely.

These are the two hardest rootkit types to get rid of, and they need different fixes. A disk-based bootkit is removed by wiping the right partitions. A firmware rootkit survives a new drive and a new copy of Windows, and needs the firmware itself rewritten. This page covers both. For how they fit with the other layers, see types of rootkits.

How a PC starts, and where each threat hides

Stage What runs Threat that targets it Survives a disk wipe?
1. Firmware UEFI (or legacy BIOS) from the SPI flash chip on the motherboard Firmware rootkit (LoJax, MoonBounce, CosmicStrand) Yes
2. Boot sector or boot manager MBR/VBR on BIOS systems, or the boot manager on the EFI System Partition Bootkit (TDL-4, BlackLotus) No, if every partition is wiped
3. Kernel and drivers Windows kernel Kernel-mode rootkit No
4. Programs Applications User-mode rootkit No

MBR and VBR bootkits

On older PCs with a legacy BIOS, the first code read from the disk is the Master Boot Record, a tiny program in the first sector, followed by the Volume Boot Record of the active partition. A bootkit replaces or patches that code. When the PC starts, the bootkit runs first, then hands control to the real boot loader while keeping hooks in place to patch the Windows kernel as it loads.

TDL-4 (Alureon)

TDL-4, a version of the TDSS family also known as Alureon, was the best-known MBR bootkit. Kaspersky reported in 2011 that it had infected more than 4.5 million computers in the first three months of that year. By infecting the MBR it could load its own driver on 64-bit Windows, getting around the driver signing requirement that blocked ordinary kernel rootkits. It used a peer-to-peer network for commands and could remove competing malware from the machines it took over.

An earlier Alureon version produced a memorable side effect. In February 2010, Windows XP machines started crashing after installing security update MS10-015. Microsoft traced the crashes to Alureon, which had modified Windows kernel files in a way the update broke, and changed the update so it would not install on systems showing those signs.

MBR bootkits faded as PCs moved to UEFI with Secure Boot, which verifies boot code before running it.

UEFI bootkits

On a UEFI PC, the firmware loads a boot manager file from the EFI System Partition (ESP), a small FAT32 partition on the disk. Secure Boot checks that file’s signature against trusted keys stored in the firmware. A UEFI bootkit has to get its own code into that chain without failing the signature check.

BlackLotus

BlackLotus is the case that showed Secure Boot could be bypassed in practice. ESET published its analysis in March 2023, describing it as the first publicly known UEFI bootkit able to bypass Secure Boot on fully patched Windows 11. It had been advertised on criminal forums for $5,000 since at least October 2022.

It exploited CVE-2022-21894, a Secure Boot flaw Microsoft had patched in January 2022. The patch did not help because the old, vulnerable boot manager files were still validly signed and had not been added to the Secure Boot revocation list, so BlackLotus simply brought an old vulnerable copy along. Once running, ESET found it could switch off memory integrity (HVCI), suspend BitLocker’s protection and disarm Microsoft Defender.

Microsoft released further fixes under CVE-2023-24932, starting in May 2023 with protections that administrators had to switch on deliberately. The NSA published a BlackLotus mitigation guide in June 2023 that explains why patching alone does not fully remediate it while the vulnerable boot managers remain trusted.

BlackLotus lives on the EFI System Partition, not in the firmware chip. Microsoft’s guidance for an infected device is to take it off the network and reformat it, including both the operating system partition and the EFI partition, or restore it from a known clean backup that includes the EFI partition.

SPI flash implants (firmware rootkits)

The UEFI firmware itself is stored in an SPI flash chip soldered to the motherboard. Malware written into that chip runs before any boot loader and can re-plant its payload into Windows on every start. It does not care if you reformat the drive, swap it for a new one or install a different operating system.

These are rare and have so far been tied to targeted espionage, not mass infections. Three cases are well documented:

Does Secure Boot stop firmware rootkits?

Not reliably. Secure Boot is enforced by the firmware, so malware inside the firmware is already past it. ESET corrected its own LoJax white paper on this point to say that Secure Boot does not protect against the UEFI rootkit it described. What does help is hardware that verifies the firmware before it runs (Intel Boot Guard and similar features), flash write protection set correctly by the manufacturer, and keeping firmware updated.

How to remove a bootkit

For a disk-based bootkit, whether an MBR bootkit or a UEFI bootkit on the ESP:

  1. Disconnect the PC from the network and change important passwords from a clean device.
  2. Run an offline scan. Microsoft Defender Offline runs from outside Windows and Microsoft says it is designed to catch malware that infects or overwrites the MBR. See offline rootkit scan.
  3. Back up documents, not programs. Copy personal files to an external drive. Do not back up executables or the whole system image, which could carry the bootkit back.
  4. Wipe and reinstall. Boot from official Windows installation media, delete every partition on the system drive, including the EFI System Partition and recovery partition, and let Windows create new ones. Install all updates immediately.
  5. Turn on Secure Boot in the UEFI settings if it was off, and check it shows as On under Secure Boot State in System Information (msinfo32).

Boot repair tools can rewrite a damaged MBR or boot manager, but on their own they leave you guessing whether the kernel or other files were also changed. For a confirmed bootkit, the wipe is the reliable answer. The full process is in how to remove a rootkit.

How to remove a firmware rootkit

This is the case people mean when they search for how to remove a “hardware rootkit”. Reinstalling Windows will not work.

  1. Get confirmation. Firmware infections are rare. Some security suites include a firmware scanner (ESET’s UEFI Scanner and Kaspersky’s Firmware Scanner are two examples) that can flag a modified firmware image. ESET’s own support guidance notes that it cannot remove a UEFI detection itself, because the fix depends on the hardware maker’s firmware.
  2. Contact the PC or motherboard maker. Ask for the current official firmware image for your exact model and how to flash it. Download it on a clean computer.
  3. Reflash the firmware. Ask the maker’s support team which method writes a complete clean image to the chip for your model, rather than assuming a routine update from inside Windows is enough. ESET’s guidance for LoJax was that reflashing the SPI flash is the first step, and that it differs for each motherboard.
  4. Replace the board if reflashing is not possible. ESET’s LoJax guidance names motherboard replacement as the alternative. For a laptop, that often means replacing the machine.
  5. Then wipe the drive and reinstall, since the firmware rootkit will have planted something in the operating system as well.

Be careful with this step. A failed firmware flash can leave a PC unable to start. If the computer belongs to an employer, stop and hand it to the IT or security team, who will want the firmware image for investigation.

How to lower the risk

The real-world history of these threats is collected in famous rootkits.

Frequently asked questions

What is a bootkit?
A bootkit is a rootkit that infects the code that starts the computer, such as the master boot record or the UEFI boot manager, so it runs before the operating system. That lets it tamper with Windows as it loads and switch off protections before they start.
Does reinstalling Windows remove a bootkit?
A clean install that deletes and recreates every partition, including the EFI System Partition, removes a disk-based bootkit such as TDL-4 or BlackLotus. It does not remove a firmware rootkit stored in the motherboard's flash chip.
How do you remove a firmware rootkit?
Reflash the motherboard's UEFI firmware with a clean image from the PC or board maker, ideally with help from their support team. ESET's guidance for LoJax was that reflashing is the first step and replacing the motherboard is the alternative if reflashing is not possible.
Does Secure Boot stop bootkits?
It stops most of them, because it refuses to run boot code without a trusted signature. It is not perfect. BlackLotus bypassed it in 2023 by abusing an old, still-trusted Windows boot component, and Secure Boot does not protect against malware already written into the firmware itself.