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:
- LoJax (2018). ESET found it in September 2018 and called it the first UEFI rootkit seen in a real attack. ESET attributed it to the Sednit group (also known as APT28), targeting government organisations in the Balkans and Central and Eastern Europe. It was built from a trojanized copy of Absolute Software’s LoJack anti-theft agent, and it was written to flash on machines where the chip’s write protections were missing or misconfigured.
- MoonBounce (2022). Kaspersky disclosed it in January 2022 and linked it to APT41. Instead of adding a new component to the firmware, the attackers modified an existing core part of it (CORE_DXE), which made it harder to spot.
- CosmicStrand (2022). Kaspersky reported it in July 2022 in firmware images for certain Gigabyte and ASUS motherboards using the Intel H81 chipset. Kaspersky said it appeared to have been in use since late 2016, mostly against victims in China, and that how the firmware was first modified remains unknown.
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:
- Disconnect the PC from the network and change important passwords from a clean device.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- Keep Secure Boot on and install Windows updates, including the boot manager revocation updates Microsoft has issued since BlackLotus.
- Install firmware updates from your PC or board maker. MoonBounce research from Kaspersky specifically recommended regular UEFI updates and checking that Boot Guard is enabled where the hardware supports it.
- Leave memory integrity on. See kernel-mode rootkits for how it works.
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.