Most malware is a squatter. It occupies RAM or hides in a partition. Evict it with a format and a fresh ISO. The machine is clean. The attack is over.
In 2018, Sednit showed what happens when the attack lives below the OS.
LoJax was the first UEFI rootkit documented in a real-world campaign. It didn't target Windows. It targeted the SPI flash, the chip that holds the UEFI firmware, the code that runs before any operating system breathes. Reformat the drive. Reinstall the OS. Pull the SSD and replace it. LoJax survives all of it. The infection is in the motherboard. The machine is owned before it boots.
The Persistence Mechanism
The brilliance of LoJax wasn't novelty. It was opportunistic reuse.
Sednit repurposed the persistence module from Absolute LoJack, legitimate commercial anti-theft software that used the same UEFI persistence trick to survive factory resets. The legal tool had already solved the hard problem. The Sednit group borrowed the solution.
The entry was through RwDrv.sysa kernel driver that exposes direct hardware access. If the platform's BIOS_CNTL register wasn't properly locked, the driver could write to SPI flash. That register controls whether the BIOS region is writable. Most enterprise systems leave it unprotected unless explicitly hardened.
# Detect SPI flash write protection status using chipsec
# Intel's own security testing framework — runs on authorized hardware
# pip install chipsec
sudo chipsec_main.py -m common.bios_wp
# What to read in the output:
# [*] BIOS region write protection is enabled (BIOS_CNTL.BIOSWE = 0) ← protected
# [!] BIOS region write protection is DISABLED (BIOS_CNTL.BIOSWE = 1) ← vulnerable
# [!] SMM BIOS Write Protect (BLE) is DISABLED ← critical
# If BIOSWE = 1 and BLE = 0, an attacker with kernel access
# can write to SPI flash. That is the LoJax entry condition.
# Check this before you trust the rest of your security stack.
The DXE Injector
LoJax worked by injecting a malicious DXE driver into the UEFI firmware image. DXE, Driver Execution Environment, is the phase of UEFI boot where hardware initialization drivers run, before the OS loader starts.
The injected driver executes at boot, drops a payload into the Windows System32 directory, and re-infects any new drive connected to the machine. The persistence survives hardware replacement because the infection is in the firmware, not the storage.