Taking over the boot
Turning Off Driver Signing From the Boot Chain (DSE, HVCI)
How bootkits defeat kernel code signing before Windows or Linux enforces it: TDL4's WinPE trick, ESPecter's DSE patch, BlackLotus and HVCI, Bootkitty. Checks.
- Goal
- Taking over the boot
- Layer
- Boot
- Where it acts
- UEFI variablesEFI system partitionIn memoryOn the system volumeOn the boot chain map
- Platforms
- Windows, Linux
- Also known as
- DSE bypass from the boot chain, Code integrity bypass, Module signature bypass
- Checked by
- EFI system partitionMeasured Boot logs
Overview
64-bit Windows loads kernel code only if it is signed: the kernel-mode code signing policy has applied since Windows Vista, and since Windows 10 version 1607 new drivers must, with few exceptions, be signed through Microsoft's portal. Memory integrity (HVCI) moves the check into a hypervisor-protected environment. Linux kernels that enforce module signatures load only validly signed modules (kernel.org).
A bootkit runs before the check exists. From the boot chain it can switch the check off for this boot, patch the code that performs it, load its own kernel code by a path the check never sees, or stop the hypervisor layer from starting. ESET's Virus Bulletin 2014 paper ties the return of bootkits after 2007 to the code signing policy of 64-bit Vista. For most families in this catalogue, this is what the boot infection is for.
Doing the same from the running operating system, with a vulnerable signed driver or by patching code integrity variables in kernel memory, is a different technique, covered on rootkits.dev as driver signature enforcement tampering.
How it works
| Approach | What changes | Where it lives | Families |
|---|---|---|---|
| Change the configuration | A boot option the loader reads: test signing, integrity checks off, Windows PE mode | The BCD on disk, or the loader's copy in memory | TDL4; BlackLotus's exploit configuration |
| Patch the check | The code that sets up or performs signature checks | Kernel or loader memory, every boot | ESPecter, Bootkitty |
| Go around the check | Kernel code loaded by the bootkit itself, never by the Windows loader | Kernel memory | Rovnix, Gapz, TDL4 |
| Stop the enforcer | Memory integrity and virtualization-based security | Registry and a UEFI variable | BlackLotus |
The configuration route is the one Windows exposes. bcdedit /set testsigning on lets drivers signed with any certificate load and shows a "Test Mode" watermark; nointegritychecks disables integrity checks. Both need administrator rights and both are guarded by Secure Boot: nointegritychecks "cannot be set when secure boot is enabled", and setting test signing fails with "The value is protected by Secure Boot policy". A bootkit does not need bcdedit: it can change the settings in memory as the loader reads them.
The patching route leaves the configuration alone: the patch exists only in memory, redone at every boot. Nothing in ESET's descriptions of ESPecter or Bootkitty touches the boot configuration, so the settings on disk, and those Windows measures at boot, would show their defaults.
Going around the check changes nothing in it. The loader and kernel check the drivers they load; a bootkit that hooks the kernel during initialisation copies its own code into kernel memory and runs it, and no check ever sees it.
How families use it
| Family | Approach | What the reports describe | Source |
|---|---|---|---|
| TDL4 | Configuration, in memory; going around | Replaces the BCD element BcdLibraryBoolean_EmsEnabled (16000020) with BcdOsLoaderBoolean_WinPEMode (26000022) as the loader reads it: "There is no code integrity control in WinPE mode". It then substitutes its own kdcom.dll, which loads the rootkit driver from the hidden store, and disables WinPE mode again by distorting the /MININT option | Kaspersky, 2011; ESET, 2011 and 2014 |
| ESPecter | Patching | Patches the kernel function SepInitializeCodeIntegrity in memory to disable Driver Signature Enforcement, and also MiComputeDriverProtection; without that patch it does not drop its driver | ESET, 2021 |
| Rovnix | Going around | Copies itself over the second half of the IDT, sets hardware breakpoints, regains control during kernel initialisation and "manually loads its own malicious driver", "thus bypassing the kernel-mode code integrity check" | ESET, 2011 |
| Gapz | Going around | Hooks IoInitSystem, then reads its kernel code from disk and runs it in a new system thread. Its kernel code is position-independent blocks, not a driver, and ESET notes that ELAM cannot help, since it "is only able to monitor legitimately loaded drivers" | ESET, 2012 and 2013 |
| BlackLotus | Stopping the enforcer; configuration for the exploit | The installer sets HypervisorEnforcedCodeIntegrity\Enabled to 0 "to be able to run custom unsigned kernel code later". At boot the bootkit creates the boot-only VbsPolicyDisable variable, which the Windows loader evaluates so that HVCI and Credential Guard "will not be initialized", and hooks the entry point of disk.sys to run its kernel driver. The attacker BCD used for CVE-2022-21894 sets testsigning and nointegritychecks so that hvloader.efi runs self-signed code | ESET, 2023 |
| Bootkitty | Patching | In the Linux kernel, "the function module_sig_check is patched to always return 0", so "the kernel will load any module without verifying the signature". Earlier it hooks GRUB's signature checks and, with Secure Boot on, the firmware's EFI_SECURITY_ARCH_PROTOCOL and EFI_SECURITY2_ARCH_PROTOCOL authentication functions so that they report success | ESET, 2024 |
Microsoft closed TDL4's route in April 2011 with update 2506014: ESET found that the WinPE option "is no longer used in the initialization of code integrity policy" and that kdcom.dll gained an export so TDL4 no longer recognised it; infected machines could not be expected to install it.
Traces it leaves
| Where | Trace | Route |
|---|---|---|
BCD (ESP\EFI\Microsoft\Boot\BCD, or \Boot\BCD on BIOS systems) | testsigning or nointegritychecks set; a store pointing at another BCD | Configuration on disk (BlackLotus's staging BCD) |
C:\Windows\Logs\MeasuredBoot\ | Test signing on, code integrity off, a transfer without signature check, modules loaded without a validated image | Configuration, when the loader saw it |
| SYSTEM hive | DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity, Enabled = 0 | BlackLotus |
| UEFI NVRAM | VbsPolicyDisable | BlackLotus |
| Live Windows | Memory integrity configured but not running; "Test Mode" watermark | Stopping the enforcer; test signing |
| Linux kernel | Taint flag E ("unsigned module was loaded") in /proc/sys/kernel/tainted | Bootkitty and its unsigned modules |
| Memory | Patched code integrity routines; kernel code with no driver file | Patching; going around |
The patch and go-around routes leave no configuration trace. Their evidence is the rest of the infection: the boot sectors, the ESP files and the unsigned kernel code.
How to check a host
Offline.
- Read every BCD store: the one on the ESP, any other on the ESP (BlackLotus stages one in
ESP:\system32\), and\Boot\BCDon BIOS systems. On an analysis machine,bcdedit /store <file> /enum alllists their settings. - Decode the Measured Boot logs boot by boot and compare Windows' boot settings: test signing, code integrity, debugging, Windows PE, and the memory integrity and VBS policy events. Reading Measured Boot logs shows how.
- Read the memory integrity value in the SYSTEM hive; on Linux, the kernel log's taint messages.
Live, Windows, elevated:
bcdedit /enum "{current}"
powershell -c "Confirm-SecureBootUEFI"
powershell -c "Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard | Format-List SecurityServicesConfigured, SecurityServicesRunning, VirtualizationBasedSecurityStatus"
In Microsoft's documentation, the value 2 in SecurityServicesConfigured and SecurityServicesRunning means memory integrity is configured and running. Memory integrity off where policy wants it on, or configured but not running, needs an explanation: BlackLotus does the first through the registry and the second through VbsPolicyDisable.
Live, Linux: mokutil --sb-state, cat /proc/sys/kernel/tainted (0 means untainted; the kernel documentation decodes the bits) and uname -v, where ESET lists BoB13 as a Bootkitty sign. ESET adds that an unsigned test module that loads on a Secure Boot system means signature checking is off; run that test only on a host you can afford to taint.
Memory. For patched code integrity state in a Windows memory image, see rootkits.dev's DSE tampering page. A live check runs under the bootkit's kernel code, so a clean answer is weak.
What the checker looks for
espreads every BCD store on the ESP and BIOS-era\Boot\BCDstores, and raises "The BCD enables test signing", "The BCD disables integrity checks" (fornointegritychecksor aDISABLE_INTEGRITY_CHECKSload option), "The BCD turns the hypervisor off", "The BCD disables early-launch anti-malware drivers" and the debugging findings. On BlackLotus's staging BCD it also raises "The boot manager is told to load another BCD store".measuredbootreads Windows' boot settings in each log and raises "Test signing was on at boot", "Code integrity was off at boot", "The boot manager handed over to an application without a signature check" and "A module was loaded without a validated signature", plus kernel, boot and hypervisor debugging. It shows Windows PE, safe mode and the hypervisor launch type in the boot's details without a finding, and it does not report the VBS and memory integrity policy events: read those with TCGLogTools.
What it cannot see: in-memory patches (ESPecter, Bootkitty, TDL4's WinPE switch), kernel code loaded around the check (Rovnix, Gapz), and the VbsPolicyDisable variable in NVRAM. The SYSTEM hive's memory integrity value and the Linux kernel taint are read by the rootkits.dev checker instead. The family pages list what the checker sees of each bootkit's own files.
Mitigation and recovery
Prevention.
- Secure Boot on. It locks the test signing and integrity options and, on Windows 10 version 1607 and later, limits kernel drivers to Microsoft's roots (Driver Signing Policy). It also stops unsigned boot code such as ESPecter's patched boot manager. Keep its revocations current: BlackLotus ran with Secure Boot on (see Secure Boot rollback).
- Memory integrity with UEFI lock. Microsoft notes that the lock prevents it being disabled "remotely or by policy update"; turning it off then needs access to the firmware menu.
- Linux: Secure Boot with a kernel that enforces module signatures (lockdown allows "only validly signed modules"), a reviewed MOK list (see shim and MOK abuse), and firmware updates for LogoFAIL.
- Measured Boot with remote attestation, so that the TPM, not the host, reports a boot with test signing or integrity checks off.
Recovery. Undoing a setting is not enough. Unsigned kernel code ran with full control for at least one boot. Preserve the ESP, the boot sectors, the Measured Boot logs and the SYSTEM hive, then rebuild from trusted media, restore the settings (test signing off, memory integrity on), remove attacker keys from the MOK list, and rotate the credentials used on the host.
Sources
Primary public reports, newest first.
- 2026-10-21Enable memory integrityMicrosoft
- 2025-04-16Loading Test Signed CodeMicrosoft
- 2024-11-27Bootkitty: Analyzing the first UEFI bootkit for LinuxESET
- 2024-08-19Driver Signing PolicyMicrosoft
- 2023-04-11Guidance for investigating attacks using CVE-2022-21894: The BlackLotus campaignMicrosoft
- 2023-03-01BlackLotus UEFI bootkit: Myth confirmedESET
- 2022-03-16BCDEdit /setMicrosoft
- 2021-10-05UEFI threats moving to the ESP: Introducing ESPecter bootkitESET
- 2014-11-12Bootkits: past, present & futureVirus Bulletin (ESET)
- 2013-04-08Mind the Gapz: The most complex bootkit ever analyzed?ESET
- 2012-12-27Win32/Gapz: New Bootkit TechniqueESET
- 2011-08-23Hasta La Vista, Bootkit: Exploiting the VBRESET
- 2011-04-15KB2506014 kills TDL4 on x64ESET
- 2011-01-25TDSS. TDL-4Kaspersky
See also
Related techniques
- Hooking the BIOS disk service (int 13h)Taking over the boot
- Replacing the MBR boot codePersisting in the boot chain
- Infecting the VBR, its BPB or the IPLPersisting in the boot chain
- Replacing or patching the ESP boot managerPersisting in the boot chain
- Hooking the UEFI hand-over to the OSTaking over the boot
- Enrolling an attacker key in shim's MOK listGetting past Secure Boot
- Rollback to a vulnerable signed boot managerGetting past Secure Boot
Families that use it
- BlackLotusUEFI bootkit
- BootkittyUEFI bootkit
- ESPecterUEFI bootkit
- GapzVBR bootkit
- RovnixVBR bootkit
- TDL4 (TDSS / Alureon)MBR bootkit