Skip to content

Getting into the kernel

Driver Signature Enforcement Tampering on Windows

How attackers switch off Windows driver signature enforcement: test signing, nointegritychecks, Code Integrity flags. BCD, event 4826 traces, Secure Boot, HVCI.

Goal
Getting into the kernel
Layer
Kernel
Platforms
Windows
Also known as
DSE bypass, Code integrity tampering, Test signing abuse
Used by
Snake
Checked by
Windows drivers

Overview

Driver signature enforcement (DSE) is the check, made by Windows Code Integrity, that refuses kernel code without an acceptable signature. Since Vista it has been mandatory on 64-bit Windows (Microsoft). Tampering with it means switching that check off, or weakening it, so that an unsigned or self-signed rootkit driver loads.

There are three places to do it:

  • the boot configuration, with the testsigning or nointegritychecks options, which take effect at the next boot;
  • kernel memory, by changing the variable Code Integrity consults, through a vulnerable driver;
  • the boot chain itself, by a bootkit that patches the loader before Windows starts; bootkits.dev covers that under turning off code integrity from the boot chain.

MITRE ATT&CK tracks this as Code Signing Policy Modification (T1553.006), naming bcdedit.exe -set TESTSIGNING ON and the modification of g_CiOptions through a signed but vulnerable driver as examples. The technique is old: Snake used it in the early 2010s. Its role has shrunk as Secure Boot, Kernel Patch Protection and memory integrity closed each route, and as attackers found it easier to obtain a valid signature (see malicious drivers with valid signatures).

How it works

WhereSetting or dataEffectWhat protects it
BCD storetestsigning, element 0x16000049 (BcdLibraryBoolean_AllowPrereleaseSignatures)Drivers signed by any certificate load; a "Test Mode" watermark appears on the desktopSecure Boot: bcdedit answers that "the value is protected by Secure Boot policy"
BCD storenointegritychecks, element 0x16000048 (BcdLibraryBoolean_DisableIntegrityChecks)Integrity checks offMicrosoft: "Cannot be set when secure boot is enabled"; ignored by Windows 7 and 8
Kernel memoryThe Code Integrity flag: nt!g_CiEnabled on older Windows, CI!g_CiOptions laterEnforcement off until the flag is restoredKernel Patch Protection; Kernel Data Protection under VBS; memory integrity (HVCI)
Boot chainBoot manager or loader patched in memoryEnforcement off before the kernel startsSecure Boot, the revocation list (DBX); see bootkits.dev

Boot options. Test signing exists for driver developers. Microsoft's test-signing page says that with it "any certificate can sign drivers" and that the certificate need not chain to a trusted root, but every driver must still carry a signature. Both options need administrator rights and a reboot, and both are refused while Secure Boot is on (BCDEdit /set). They are noisy: a change in the BCD store, a boot-time audit event and, for test signing, the desktop watermark.

The in-memory flag. Kaspersky's GhostEmperor report summarises the older approach: attackers obtained a kernel write primitive through a vulnerable signed driver and disabled Code Integrity "by switching the nt!g_CiEnabled flag", mostly on older Windows versions. Kernel Patch Protection now watches such data, so the attacker has to flip the flag, load the driver and restore it before PatchGuard notices, which Kaspersky says "still introduces a race condition that can crash the system" (a bug check 0x109). With virtualization-based security, Microsoft uses Kernel Data Protection so that Code Integrity's policy state is read-only once initialised (Microsoft). TrustedSec's research confirms that the variable cannot be written under VBS, but that VBS without memory integrity still leaves other routes; with memory integrity on, its code-patching attempt crashed.

How families use it

Snake. G DATA's 2014 analysis describes the 64-bit installer bringing Oracle VirtualBox's signed VBoxDrv.sys version 1.6.2 and using "a vulnerability in a legitimately signed driver to disable the policy" before loading the unsigned Uroburos driver. G DATA presents g_CiEnabled as the flag that stores the policy's state but does not say whether Snake restored it. MITRE ATT&CK lists the Turla procedure the same way: it "modified variables in kernel memory to turn off Driver Signature Enforcement". The rootkit's driver files (Ultra3.sys, msw32.sys, vstor32.sys) were unsigned.

A contrast: Demodex. It shows the alternative: Kaspersky stresses that its loader runs the unsigned rootkit through Cheat Engine's signed driver "without modifying the Code Integrity image", avoiding the crash risk. That is BYOVD, not DSE tampering.

POORTRY's 2024 driver "bypasses Driver Signature Enforcement" in Sophos's words, but by means of leaked certificates, forged timestamps and attestation signing: it satisfies the check rather than disabling it, and is covered on the signed-drivers page.

Outside the catalogue, ATT&CK lists BlackEnergy enabling the TESTSIGNING boot option to load a driver component, and Pandora using CVE-2017-15303 to disable DSE. Bootkits that switch enforcement off from the boot chain are covered on bootkits.dev.

Traces it leaves

TraceWhereNotes
BCD elements 16000049 or 16000048 setThe BCD store, a registry hive: \EFI\Microsoft\Boot\BCD on the EFI system partition, or \Boot\BCD on BIOS systemsThe persistent record of the boot options
Security event 4826Security.evtxLogged at every boot regardless of audit policy; fields "Test Signing" and "Disable Integrity Checks" read Yes or No (Microsoft)
Measured Boot logC:\Windows\Logs\MeasuredBoot\*.logWindows records the test signing and code integrity state of each boot; see bootkits.dev's Measured Boot guide
bcdedit.exe process creationSecurity 4688, Sysmon 1Command lines with testsigning or nointegritychecks
CodeIntegrity 3001Microsoft-Windows-CodeIntegrity%4Operational.evtx"An unsigned driver was attempted to load on the system"
Unsigned, self-signed or test-signed driversDriver services and filesWhat the tampering was for
The vulnerable driverServices, files, AmcacheThe tool of the in-memory route
Bug check 0x109Crash dumps, System logA flag change caught by Kernel Patch Protection, or an unrelated fault

The in-memory route leaves no record of the flag itself: only the tool that wrote it and the driver it let in.

How to check a host

Offline:

  • Mount the EFI system partition from the image and open the BCD store as a registry hive; under Objects\{GUID}\Elements, look for 16000049 and 16000048 with a true value in the Windows loader entries.
  • Read the latest 4826 events in Security.evtx, and compare them with older ones to date a change. Microsoft recommends comparing 4826 with a BCD baseline.
  • In the CodeIntegrity log, look for 3001; in the System log, for 7045 events of kernel drivers.
  • Check the signatures of all driver services' files. An unsigned or self-signed driver that Windows actually loaded means signature enforcement was off at some point, or the driver was mapped some other way.
  • Read the Measured Boot logs; Reading Windows Measured Boot logs on bootkits.dev shows how.

Live, from an elevated prompt:

bcdedit /enum '{current}'
Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 4826 } -MaxEvents 3 | Format-List TimeCreated, Message
Get-WinEvent -FilterHashtable @{ LogName = 'Microsoft-Windows-CodeIntegrity/Operational'; Id = 3001 } -ErrorAction SilentlyContinue
Confirm-SecureBootUEFI
Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard | Select-Object SecurityServicesRunning, VirtualizationBasedSecurityStatus

bcdedit /enum shows testsigning Yes or nointegritychecks Yes when set. A short-lived in-memory flip cannot be seen after the fact on a live host; look for the driver it allowed, and capture memory to list loaded modules. A rootkit that loaded this way can hide its own files from the live system.

What the checker looks for

The windrivers module sees what the tampering let in, not the switch itself:

  • "An unsigned kernel driver" for a driver file with no Authenticode signature, and "A driver signed with a self-signed certificate", whose explanation points to test signing;
  • "Code Integrity reports an unsigned kernel module loaded" for event 3001, which is only possible with integrity checks off or test signing on;
  • for the in-memory route, the vulnerable driver: "A known vulnerable driver (LOLDrivers)", which covers vboxdrv.sys, with its service and its install events;
  • "Memory integrity (HVCI) is turned off in the registry".

It does not read the BCD store or event 4826. bootkits.dev's checker does: its esp module flags testsigning and nointegritychecks in the BCD on the EFI system partition, and its measuredboot module flags test signing or disabled code integrity measured at boot (bootkits.dev). Neither site can see a flag flipped and restored in memory.

Mitigation and recovery

  • Secure Boot blocks both boot options and is ATT&CK's first mitigation for T1553.006. Check that it is on and that its revocation list is current.
  • Memory integrity (HVCI) with VBS moves Code Integrity's decisions out of reach of the normal kernel, protects its policy state with KDP and enforces the vulnerable driver blocklist that the in-memory route depends on.
  • Monitor 4826 against a baseline, bcdedit command lines and new kernel driver services. Limit administrator rights, which every route needs.

Recovery: on a host where enforcement was off, any kernel code may have loaded. Capture memory, preserve the BCD store, the logs and the drivers, then reset the options (bcdedit /set testsigning off, bcdedit /deletevalue nointegritychecks) only as part of a rebuild, not as a cleanup. If the boot chain was patched, follow bootkits.dev's guidance: reinstalling Windows does not fix a boot partition or firmware implant.

Sources

Primary public reports, newest first.

  1. 2026-05-12Subvert Trust Controls: Code Signing Policy Modification (T1553.006)MITRE ATT&CK
  2. 2025-04-16Loading Test Signed CodeMicrosoft
  3. 2022-05-02g_CiOptions in a Virtualized WorldTrustedSec
  4. 2022-03-16BCDEdit /setMicrosoft
  5. 2021-09-30GhostEmperor: From ProxyLogon to kernel modeKaspersky
  6. 2021-09-074826(S) Boot Configuration Data loadedMicrosoft
  7. 2020-07-08Introducing Kernel Data ProtectionMicrosoft
  8. 2020-05-13Bug Check 0x109: CRITICAL_STRUCTURE_CORRUPTIONMicrosoft
  9. 2018-05-31BcdLibraryElementTypes enumerationMicrosoft
  10. 2014-03-07Uroburos: Deeper travel into kernel protection mitigationG DATA

See also

Families that use it

  • SnakeWindows kernel rootkit