Elevate & Conquer: A Journey Into Kernel Exploitation
Tijme Gommers (Product Lead Adversary Simulation · Northwave Cyber Security)
Security BSides London 2023 · Day 1 · Track 2
Overview
In this compelling talk from BSides London, Tijme Gommers of Northwave Cyber Security, along with his colleague Alex, takes the audience on a deep dive into the intricacies of kernel privilege escalation. The presentation, titled "Elevate & Conquer," unveils a zero-day vulnerability discovered in the gmprtdi.sys driver, a component of the widely used Ivanti Secure Connect (formerly Pulse Secure) VPN client. This research is not merely an academic exercise but stems directly from real-world red team operations, highlighting the critical importance of understanding Windows internals and proactively identifying kernel vulnerabilities to stay ahead of advanced threat actors.

Key moments
- 0:00 Introduction and motivation for kernel research
- 2:07 Identifying the vulnerable Ivanti Secure Connect driver
- 4:00 Kernel exploitation basics: virtual memory and IOCTLs
- 12:44 Discovering a denial-of-service vulnerability via fuzzing
- 15:00 Exploiting IOCSQREMOVEIRP for kernel callback execution
- 20:45 Bypassing kernel exploitation constraints and mitigations
- 24:00 Crafting a kernel write-what-where primitive
- 30:10 Enabling the driver and live privilege escalation demo
Elevate & Conquer: A Journey Into Kernel Exploitation
Speakers: Tijme Gommers, Product Lead Adversary Simulation, Northwave Cyber Security
Conference: BSides London
YouTube: https://www.youtube.com/watch?v=hmYK5yoR6UI
Overview
In this compelling talk from BSides London, Tijme Gommers of Northwave Cyber Security, along with his colleague Alex, takes the audience on a deep dive into the intricacies of kernel privilege escalation. The presentation, titled "Elevate & Conquer," unveils a zero-day vulnerability discovered in the gmprtdi.sys driver, a component of the widely used Ivanti Secure Connect (formerly Pulse Secure) VPN client. This research is not merely an academic exercise but stems directly from real-world red team operations, highlighting the critical importance of understanding Windows internals and proactively identifying kernel vulnerabilities to stay ahead of advanced threat actors.
The core of the talk revolves around the meticulous process of identifying, analyzing, and exploiting a severe design flaw within a legacy kernel driver. Gommers details how a seemingly innocuous denial-of-service vulnerability was meticulously escalated into a powerful write-what-where primitive, ultimately leading to full system privilege escalation. This journey showcases advanced exploitation techniques, including bypassing modern Windows mitigations like Control Flow Guard (CFG) and creatively activating disabled vulnerable components.
The research presented is significant for several reasons. Firstly, it demonstrates the persistent threat posed by legacy software components, which often harbor critical vulnerabilities due to outdated design patterns and inadequate security scrutiny. Secondly, it provides a practical blueprint for how sophisticated attackers can leverage kernel vulnerabilities to achieve persistent and high-privileged access on compromised systems. Finally, the talk offers invaluable insights for defenders on how to identify and mitigate similar risks within their own environments, emphasizing robust input validation, careful driver management, and continuous security research.
Background
▶ Watch: Introduction and motivation for kernel research (0:00)
The landscape of modern cyber security necessitates a deep understanding of underlying operating system mechanics, particularly at the kernel level. For red team operators and security researchers like Tijme Gommers and Alex, this translates into a continuous effort to uncover kernel driver vulnerabilities that can be weaponized for privilege escalation. Their motivation is multi-faceted: it’s driven by the intellectual challenge, the desire to outpace malicious actors by finding and fixing vulnerabilities before they can be abused, and the practical need to demonstrate the impact of advanced threats to their clients during red team engagements. This research directly contributes to a comprehensive understanding of Windows internals, providing the knowledge required to craft sophisticated exploits.
The specific target of this research was the gmprtdi.sys driver, a component historically associated with Juniper Networks' Pulse Secure and now part of the Ivanti Secure Connect client. This driver, in use for approximately ten years, had remained largely unchanged, making it a prime candidate for harboring undiscovered vulnerabilities. The lifecycle of this software—from Juniper Networks to Pulse Secure, and eventually acquired by Ivanti in 2020—illustrates how legacy codebases can persist across company acquisitions, often carrying inherited security debt. With Ivanti Secure Connect being deployed in an estimated 40,000 organizations worldwide, any vulnerability in its core components carries significant risk.
To contextualize the exploitation process, Gommers provided a brief but crucial recap of fundamental Windows memory management and kernel interaction. Every process on a Windows system operates within its own virtual memory space, conceptually vast at 128 TB, but mapped to a much smaller physical memory. The higher addresses in this virtual space are reserved for the kernel (ntoskrnl.exe), while lower addresses are for user processes. Crucially, user processes cannot directly access kernel memory, nor can the kernel directly access user memory without proper context, due to strict isolation mechanisms enforced by the virtual memory mapper.
Communication between user processes and kernel drivers is typically facilitated through the DeviceIoControl API. A user application obtains a handle to a driver and then invokes DeviceIoControl, passing an Input Output Control Code (IOCTL). An IOCTL is a numerical identifier that represents a specific function or operation within the driver, akin to an API endpoint. Along with the IOCTL, the user process supplies input and output buffers. The kernel packages this request into an I/O Request Packet (IRP) and dispatches it to the driver. The driver's IRP_MJ_DEVICE_CONTROL dispatch function, often a large switch statement, processes the IOCTL and performs the requested operation, potentially interacting with the user-supplied buffers. This standard communication mechanism, while necessary, also represents a critical attack surface if driver developers fail to implement rigorous input validation.
Key Findings
▶ Watch: Kernel exploitation basics: virtual memory and IOCTLs (4:00)
The research journey into gmprtdi.sys began with standard vulnerability discovery techniques, combining static analysis with automated fuzzing. By loading the driver's .sys file into IDA Pro, the team began reversing the IRP_MJ_DEVICE_CONTROL function to identify supported IOCTLs and their associated logic. Simultaneously, they employed a specialized IOCTL fuzzer, ioctlbf, designed to automate the process of sending malformed inputs to driver IOCTLs.
This initial fuzzing quickly yielded a significant discovery: a Denial of Service (DoS) vulnerability. Specifically, when ioctlbf sent a NULL buffer to IOCTL 2018, the system would immediately crash with a blue screen. Further analysis in IDA Pro revealed that the driver's handler for IOCTL 2018 performed a dereference on the user-supplied buffer without any prior validation. If the buffer was NULL, this resulted in a null pointer dereference, a critical error in kernel space that leads to an unrecoverable system crash. This finding underscored a fundamental lack of input validation within the driver, hinting at deeper, exploitable flaws.
The true breakthrough came with the realization that the IOCTL 2018 handler, after its initial problematic dereference, made a call to IoCsqRemoveIrp. This obscure kernel function, designed for managing IRP queues in a thread-safe manner, accepts a structure of callbacks as its first argument. Crucially, the vulnerable driver was passing the user-supplied buffer directly as this callback structure. This meant that an attacker could define arbitrary kernel functions to be called, effectively turning the DoS into a powerful arbitrary kernel callback primitive.
Exploiting this primitive, however, presented several significant challenges:
ExFreePoolWithTagCrash Bypass: After the callbacks, the driver would attempt to callExFreePoolWithTagon the user-supplied buffer. Since this buffer was user-mode memory, not a kernel pool, this would inevitably lead to another system crash.- Control Flow Guard (CFG) Circumvention: Windows' Control Flow Guard (CFG) mitigation prevents arbitrary code execution by ensuring that indirect calls only target valid, known function entry points within the kernel. This meant attackers couldn't simply inject shellcode.
- Limited Argument Control: The arguments passed to the hijacked kernel callbacks were largely predetermined by the driver's context, offering limited attacker control.
- Driver Activation: The
gmprtdi.sysdriver was disabled by default on Ivanti Secure Connect installations.
Through clever function chaining and kernel pattern searching (egg hunting) to locate unexported kernel functions, the research team successfully crafted a robust write-what-where primitive. This primitive, capable of writing a single controlled byte to an arbitrary kernel address, was then leveraged to achieve full privilege escalation by manipulating the current process's privilege token. The final exploit demonstrated a complete chain from a low-privileged user to SYSTEM privileges on a vulnerable system.
Technical Deep Dive
▶ Watch: Exploiting IO_CSQ_REMOVE_IRP for kernel callback execution (15:00)
The journey from a denial-of-service to full privilege escalation required overcoming several technical hurdles, each revealing a deeper understanding of the gmprtdi.sys driver's flaws and Windows kernel internals. The initial DoS was triggered by IOCTL 2018 receiving a NULL or invalid user-supplied buffer. The driver's IRP_MJ_DEVICE_CONTROL dispatch function, after moving the user buffer address into the RBX register, immediately attempted to dereference it. This lack of validation meant a NULL pointer in RBX would cause a bug check and a blue screen, as the kernel has no exception handling for such errors.
The pivotal discovery was that, further down the execution path for IOCTL 2018, the driver invoked IoCsqRemoveIrp. This function is part of the I/O Canceled-Safe Queue (IoCsq) mechanism, designed to manage IRP queues in a thread-safe manner, particularly for drivers that process IRPs asynchronously. IoCsqRemoveIrp takes two arguments: a pointer to an IO_CSQ structure (which contains a set of callbacks for queue operations like acquiring/releasing locks, inserting/removing IRPs) and the IRP to remove. Crucially, gmprtdi.sys was passing the attacker-controlled user buffer as the IO_CSQ structure, effectively allowing the attacker to define the kernel callbacks.
The structure of the IO_CSQ involves multiple function pointers (callbacks). The IoCsqRemoveIrp function, when called, would invoke three of these callbacks: one for acquiring a lock, one for removing the IRP, and one for releasing a lock. The challenge was to select kernel functions that, when called with the limited attacker control over arguments, would achieve a useful primitive without crashing the system due to Control Flow Guard (CFG) or other issues. CFG restricts indirect calls to valid kernel function entry points, meaning direct injection of shellcode was out of the question.
The first major obstacle was the ExFreePoolWithTag crash. After IoCsqRemoveIrp completed its execution, the driver would attempt to free the user-supplied buffer using ExFreePoolWithTag. Since this was user-mode memory, not a kernel memory allocation, this operation would inevitably lead to a blue screen. Alex, the speaker's colleague, devised an ingenious bypass: setting the third callback (the "release lock" callback) to KeWaitForSpinLockAndAcquire. This function accepts one argument, which was always the address of the user buffer in this context. KeWaitForSpinLockAndAcquire enters an infinite loop, waiting for the spinlock value at the provided address to become zero. By ensuring the user buffer never contained a zero at that offset, the execution thread would effectively halt, preventing the code path from ever reaching ExFreePoolWithTag. A side effect was a 50% CPU usage spike, which was mitigated by setting the thread priority to the lowest possible using SetThreadPriority.
With the crash bypassed, the focus shifted to achieving a useful primitive. For the second callback (the "remove IRP" callback), the team identified RtlWriteCharZero. This function is particularly interesting because, unlike common kernel memory manipulation functions like memcpy or memset where the destination address is typically the first argument, RtlWriteCharZero uses its second argument as the destination address and the least significant byte of its first argument as the byte to write. The third argument was the IOCTL 2018 value, which RtlWriteCharZero would use as a counter. Initially, this third argument caused a crash because 0x2018 is not a valid kernel address. However, it was discovered that DeviceIoControl provides the kernel with the context of the calling user process, allowing the kernel to dereference user-mode addresses if they are allocated. By allocating 0x2018 in user space and setting its value to zero, the function would no longer crash.
To control the byte written, the attackers leveraged the fact that the first argument to RtlWriteCharZero was always the address of their user buffer. By carefully choosing the base address for their allocated user buffer (e.g., 0x1000 vs. 0x1001), they could manipulate the least significant byte (LSB) of this address, which RtlWriteCharZero would then write to the target kernel address. This provided a single-byte write-what-where primitive.
For the first callback (the "acquire lock" callback), a benign function was needed that wouldn't interfere with registers or cause crashes. Initially, HalMakeBeep was considered, but it modified registers in unpredictable ways. The final choice was KeTestSpinLock, a simple function that checks a value without altering any registers, ensuring stability for subsequent calls.
A final, significant technical challenge was locating the addresses of unexported kernel functions like RtlWriteCharZero. Since these functions are not listed in the kernel's export table, their addresses cannot be directly resolved. The solution involved kernel pattern searching, also known as "egg hunting." This technique involves identifying a unique sequence of opcodes (a "pattern") that corresponds to the target function's machine code. By scanning the ntoskrnl.exe binary in memory for this pattern, the exploit could dynamically determine the runtime address of RtlWriteCharZero, making the exploit robust across different Windows versions. This intricate chain of function calls and bypasses ultimately formed the foundation of the privilege escalation exploit.
Demo / Proof of Concept
▶ Watch: Bypassing kernel exploitation constraints and mitigations (20:45)
The successful development of the write-what-where primitive faced one final, practical hurdle: the gmprtdi.sys driver was disabled by default on Ivanti Secure Connect installations. This meant that even with a fully functional exploit, the vulnerable component wouldn't be active on a typical target system. However, the researchers discovered a critical design flaw in how the Ivanti client managed driver activation.
Ivanti provided a utility called pulse_launcher.exe. This tool, intended to facilitate client-server connections, had the unintended side effect of enabling the gmprtdi.sys driver if the client attempted to connect to a VPN server configured to use the deprecated (and thus vulnerable) driver. This presented a perfect activation vector for a low-privileged attacker.
The solution involved setting up a rogue VPN appliance. This appliance was specifically configured to use the deprecated driver component. A victim's Ivanti Secure Connect client, when instructed to connect to this rogue VPN server, would automatically invoke pulse_launcher.exe, which in turn would enable gmprtdi.sys on the victim's machine, making it vulnerable to exploitation. This demonstrated a critical attack path where a low-privileged user could effectively self-enable a kernel vulnerability.
The demonstration of the privilege escalation exploit was conducted using a Cobalt Strike interface. The initial state showed a beacon running with low privileges, specifically highlighting that the process had five privileges, but only one was enabled. This represented a typical user-level context.
The exploit, packaged as a Beacon Object File (BOF) named pulse_esque.bof, was then executed. The exploit first performed the necessary kernel pattern searching to locate the RtlWriteCharZero function. It then repeatedly invoked the IOCTL 2018 primitive (16 times in an automated fashion) to write specific bytes to the current process's privilege token in kernel memory. Since the exploit only provided a write primitive and lacked a read primitive, the strategy was to modify the current process's own token rather than attempting to locate and copy the system token. By writing specific bytes, the exploit enabled all possible privileges for the running process.
After the exploit completed, the whoami /priv command was re-run through Cobalt Strike. The output dramatically changed: all 20+ privileges were now listed as "Enabled," signifying full system privileges. This visual confirmation clearly demonstrated the successful transformation from a low-privileged user to a highly privileged context, showcasing the practical impact of the kernel exploit. The demo effectively tied together the technical deep dive with real-world attacker capabilities.
Defensive Implications
▶ Watch: Enabling the driver and live privilege escalation demo (30:10)
The "Elevate & Conquer" talk reveals several critical defensive implications for organizations using Ivanti Secure Connect and for general kernel driver security.
- Prompt Patching and Updates: The most immediate defensive action is to ensure that all Ivanti Secure Connect/Access clients are fully updated. While Ivanti has released a hotfix for this specific vulnerability, organizations must verify that this fix, and ideally the updated mainstream branch, is applied across their entire environment. Patch management for VPN clients, which often run with elevated privileges or interact with kernel components, should be a top priority.
- Rigorous Input Validation in Driver Development: The root cause of this vulnerability was a fundamental lack of input validation in
gmprtdi.sys. Driver developers must implement robust checks for all user-supplied data, especially pointers and buffer sizes, to prevent dereferencing invalid addresses or buffer overflows. This includes validatingIOCTLparameters and ensuring that kernel functions are never called with attacker-controlled arguments without thorough sanitization. - Principle of Least Privilege for Drivers and Utilities: The
pulse_launcher.exeutility's ability to enable a vulnerable kernel driver from a low-privileged user context is a significant security flaw. Applications should never allow low-privileged users to activate or modify the state of highly privileged kernel components. Drivers themselves should operate with the absolute minimum privileges necessary for their function, and their attack surface (e.g., exposedIOCTLs) should be minimized. - Attack Surface Reduction (Driver Management): Organizations should regularly audit and disable unnecessary kernel drivers. Legacy drivers, especially those that are no longer actively maintained or are part of deprecated functionalities, pose a disproportionate risk. If
gmprtdi.sysis not strictly required for current operations, it should be permanently disabled or removed. - Layered Security and Mitigation Awareness: While Control Flow Guard (CFG) is a powerful mitigation, this research demonstrates that it can be circumvented by chaining legitimate kernel functions. Defenders should not rely solely on a single mitigation but implement a layered security approach. This includes strong endpoint detection and response (EDR) solutions capable of detecting anomalous kernel activity, even if the execution flow adheres to CFG.
- Continuous Security Research and Auditing: The discovery of this vulnerability in a 10-year-old, widely deployed driver underscores the need for continuous security auditing of both third-party and custom-developed kernel components. Organizations should consider proactive vulnerability assessments, including static and dynamic analysis (fuzzing), of critical drivers in their ecosystem.
- Driver Signing and Integrity: While not directly exploited here, ensuring that only properly signed and verified drivers are loaded onto systems is a foundational security control. This helps prevent the introduction of malicious or tampered drivers.
By addressing these defensive implications, organizations can significantly reduce their exposure to similar kernel-level privilege escalation attacks and bolster their overall security posture against advanced threats.
Key Takeaways
- Legacy Code is a Critical Risk: Drivers like
gmprtdi.sys, maintained for years without significant updates, often harbor severe vulnerabilities due to outdated design patterns and a lack of modern security scrutiny. - Input Validation is Paramount: The core of this exploit chain began with a simple lack of input validation, allowing user-supplied
NULLpointers to be dereferenced in kernel space, leading to a denial-of-service. - Kernel Callbacks are a High-Value Target: Mechanisms like
IoCsqRemoveIrpthat accept attacker-controlled callback structures can be hijacked to achieve powerful arbitrary execution primitives within the kernel. - Modern Mitigations Can Be Chained Around: Even robust defenses like Control Flow Guard (CFG) can be circumvented by meticulously chaining legitimate kernel functions, demonstrating the need for layered security.
- Creative Activation is Key for Disabled Components: Attackers will find ingenious ways to activate disabled vulnerable components, as shown by the
pulse_launcher.exetrick, highlighting the importance of secure default configurations. - Limited Primitives Lead to Full Exploits: Even a seemingly limited primitive, such as a single-byte write to an arbitrary kernel address, can be leveraged to achieve full privilege escalation by manipulating critical kernel structures like process tokens.
About the Speaker(s)
Tijme Gommers is a Product Lead for Adversary Simulation at Northwave Cyber Security, a cyber security company based in the Netherlands. With approximately six years of experience as a red team operator, Tijme focuses extensively on security research, particularly in the realm of kernel driver vulnerabilities. His journey into hacking began at the age of 11, leading him through studies in software engineering and information security. He leverages his research findings to develop fully functional exploits for real-world red team operations, helping clients understand and mitigate advanced threats.
Alex, Tijme's colleague and co-researcher, is described as the "smart guy" behind much of the technical heavy lifting. Based in Japan, Alex brings a deep background as a former malware analyst, vulnerability researcher, and malware developer. His expertise was instrumental in navigating the complex technical challenges of kernel exploitation, including identifying the specific kernel functions and bypasses required to achieve the write-what-where primitive.
Reviews
Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT
This is what actual vulnerability research looks like. Gommers and Alex took a useless NULL pointer DoS in a fossilized Ivanti driver and chained it into a pristine CFG-bypassing write-what-where primitive. The technical execution is flawless, and the activation vector is the exact kind of real-world operational thinking I want to see on stage.
Heather Calloway (CISO) — STRONG ACCEPT
A masterclass in Windows kernel exploitation targeting a 10-year-old driver bundled inside the Ivanti VPN client. The exploit mechanics are for offensive researchers, but the business takeaway is unavoidable. We are inheriting massive technical debt from legacy vendor acquisitions, and it is living in our users' kernel space.