Persisting in the boot chain
DXE Driver Implants in UEFI Firmware: Traces and Checks
How LoJax added its own DXE driver to a board's SPI flash firmware, why disk checks and Secure Boot miss it, and how to dump and compare firmware to find one.
- Goal
- Persisting in the boot chain
- Layer
- Firmware
- Where it acts
- UEFI drivers (DXE)On the boot chain map
- Platforms
- Firmware
- ATT&CK
- T1542.001
- Also known as
- UEFI firmware implant, DXE implant
- Used by
- LoJax
- Checked by
- None: no module reads its traces
Overview
UEFI firmware is not one program. The image in the motherboard's SPI flash chip holds firmware volumes, and each volume holds files identified by GUIDs: drivers for the chipset, storage, network, graphics, the setup screen. During the Driver Execution Environment (DXE) phase, the DXE Foundation (the DXE Core) finds these drivers and runs them, one after another, with full control of the machine and before any boot loader starts.
This technique adds one more file to a firmware volume: the attacker's own DXE driver. The firmware runs it at every boot exactly as it runs the vendor's drivers. From there it can do what firmware can do: register a callback for the moment the operating system is about to start, read and write the disk through its own file system driver, and drop a payload into the operating system. Reinstalling the OS or replacing the disk does not remove it, because nothing of it lives on the disk.
It works at the firmware layer and needs a prior foothold with kernel access (or physical access), plus a way to write the flash (writing the SPI flash from the operating system). ESET's 2018 report on LoJax called it the first UEFI rootkit found in the wild. The idea is older: Absolute's Computrace anti-theft module had used firmware to restore its agent into Windows, and the LoJax tools reused that model.
How it works
| Step | What happens | Where |
|---|---|---|
| Dump | The current firmware is read from the SPI flash | From the OS, through a kernel driver |
| Insert | A new firmware file, the attacker's DXE driver, is added to a DXE volume with free space; other files may be removed to make room | In the dumped image |
| Write | The modified image is written back to the BIOS region of the flash | Possible only if the flash is not write-protected |
| Every boot | The DXE Core loads the new driver with the others; the driver registers a callback, for example on the ready-to-boot event | Firmware, before the boot loader |
| Payload | The callback writes files or settings into the OS volume, which the OS then runs | OS volume |
Why it hides:
- Secure Boot does not apply. Secure Boot checks the boot applications and option ROMs the firmware loads, against
dbanddbx; it does not check the firmware's own DXE drivers. ESET's first LoJax white paper said Secure Boot would block the unsigned driver; ESET corrected this on 9 October 2018: Secure Boot does not protect against it, while Intel Boot Guard, configured, would have refused the modified firmware. - No disk trace of the implant. Disk images, the EFI system partition and the OS hold only what the implant drops, and the implant puts that back at every boot.
- Few tools read the flash. Microsoft notes that firmware is not stored in or reachable from main memory, so a scanner has to read the SPI flash through the chipset's own protocol.
How families use it
| Family | The added driver | What it does at boot | Source |
|---|---|---|---|
| LoJax | SecDxe, an unsigned DXE driver, GUID 682894B5-6B70-4EBA-9E90-A607E5676297, added to a DXE volume by ReWriter_binary.exe; the vendor's AMI NtfsDxe driver is removed from the volume | Registers a ready-to-boot callback that, through an embedded NTFS driver ESET traces to Hacking Team's leaked UEFI project, writes autoche.exe and rpcnetp.exe to Windows and edits the SYSTEM hive's BootExecute | ESET |
Outside this catalogue, Kaspersky's 2020 report on MosaicRegressor describes four rogue components (SmmInterfaceBase, Ntfs, SmmReset, SmmAccessSub) inserted into otherwise benign firmware images, mostly built from Hacking Team's leaked VectorEDK code. They wrote IntelUpdate.exe to the Windows Startup folder and rewrote it if it was removed. Kaspersky noticed them because their GUIDs were unusually close to each other, and could not determine how the firmware was written.
Traces it leaves
| Where | What | Source |
|---|---|---|
| SPI flash, DXE volume | A firmware file the vendor's image of the same version does not have; for LoJax, SecDxe with the GUID above | ESET |
| SPI flash, same volume | A vendor file missing (LoJax removed NtfsDxe); free space reduced | ESET |
| OS volume | The payload the driver drops: autoche.exe, rpcnetp.exe and a changed BootExecute for LoJax; IntelUpdate.exe in the Startup folder for MosaicRegressor | ESET, Kaspersky |
| OS volume | Files that come back after deletion: the clearest live sign that firmware is writing them | ESET, Kaspersky |
| Installation host | The flashing tools and their kernel driver (RwDrv.sys for LoJax), a dumped image file | ESET |
| TPM event log, PCR 0 | A different firmware measurement from earlier boots, with no firmware update to explain it | General Measured Boot behaviour |
How to check a host
The firmware. The implant is visible only in a dump of the flash, compared with the vendor's image for the exact board and BIOS version.
- Dump the flash from a trusted environment:
chipsec_util spi dump rom.binfrom a clean Linux live medium, or a hardware programmer on the chip. CHIPSEC's Windows driver needs driver signature checks turned off (installation guide), which you should not do on a suspect host. - Open the dump and the vendor's image in UEFITool, or decode them with
chipsec_util decode rom.bin, and compare the list of firmware files per volume: files added, files removed, files that changed. - Let CHIPSEC do the module comparison and the known-implant check:
chipsec_main -i -n -m tools.uefi.scan_image -a generate,efilist.json,vendor.rom
chipsec_main -i -n -m tools.uefi.scan_image -a check,efilist.json,rom.bin
chipsec_main -i -n -m tools.uefi.scan_blocked -a rom.bin,blockedlist.json
CHIPSEC's default blocked list has entries for LoJax, MosaicRegressor and Hacking Team's UEFI rootkit. It matches known names and GUIDs only; the scan_image comparison against the vendor's image also catches a driver nobody has catalogued.
The operating system. Look for what the driver drops, as listed on the family page, and for the tools used to flash it. Delete a suspect dropped file and see whether it returns after a reboot. Microsoft Defender for Endpoint includes a UEFI scanner that reads the SPI flash at runtime when Defender Antivirus is the active antivirus.
What these cannot prove: a dump read through the running platform depends on that platform. Microsoft notes that on misconfigured devices attackers can reprogram the BIOS control register to make it harder for security software to tell what actually runs at boot; a hardware programmer avoids that dependency. Two dumps of the same model differ in NVRAM and serial numbers, so compare modules, not whole files. And without the vendor's image for the same version there is nothing to compare against.
What the checker looks for
None of the checker's modules can see a DXE driver implant, so checks is empty for this technique. The implant is in the SPI flash, which no collection contains as a file.
esp: the EFI system partition is untouched.measuredboot: PCR 0 records the platform firmware's code. The module lists each log's events but does not compare PCR 0 measurements between boots and has no vendor reference values, so it raises nothing for changed firmware. Decoding two saved logs yourself would show that PCR 0 changed, not why.bootsector: not involved.
The dropped Windows payload is outside the checker too: rootkits.dev sees the flashing tool's kernel driver, as the LoJax page explains. See what an offline bootkit check can and cannot prove.
Mitigation and recovery
Prevent:
- keep BIOS write protection enabled and locked, so the flash cannot be written from the OS (see writing the SPI flash from the operating system), and check it with
chipsec_main -m common.bios_wporfwupdmgr securityon Linux; - use platforms with Intel Boot Guard, or an equivalent hardware root of trust, configured by the manufacturer. Intel describes Boot Guard as verifying the initial boot block before the CPU runs it, with keys and policies in fuses; the firmware must then verify the rest;
- keep firmware updated and set a firmware administrator password;
- keep TPM-backed Measured Boot logs, so a firmware change at least leaves a record.
Recover:
- Preserve the flash dump and the dropped files.
- Reflash the whole BIOS region with the vendor's image for that board, from a trusted environment, then dump again and confirm the added driver is gone. ESET's guidance for LoJax: a firmware update may remove the implant if it rewrites the whole BIOS region; otherwise reflash, or replace the motherboard.
- Only then clean or reinstall the OS. Files deleted while the implant is in the flash come back at the next boot.
- Investigate how the flash was written: the installation needed earlier control of the host.
Sources
Primary public reports, newest first.
- 2025-05-01Firmware (UEFI) scanning in Defender for EndpointMicrosoft
- 2024-11-15Intel vPro Security OverviewIntel
- 2020-10-05MosaicRegressor: Lurking in the Shadows of UEFIKaspersky
- 2018-09-27LoJax: First UEFI rootkit found in the wild, courtesy of the Sednit groupESET
- 2018-09-27LOJAX: First UEFI rootkit found in the wild, courtesy of the Sednit group (white paper)ESET
See also
Related techniques
- Writing the SPI flash from the operating systemGetting past Secure Boot
- Patching an existing firmware modulePersisting in the boot chain
- Firmware image parser exploits (LogoFAIL)Getting past Secure Boot
Families that use it
- LoJaxFirmware implant