Exploiting the NT Kernel in 24H2: New Bugs in Old Code & Side Channels Against KASLR
Two double-fetch bugs in the NT kernel let a local attacker corrupt kernel memory: one causes a stack buffer overflow, the other bypasses an address probe to give an arbitrary kernel write. The author also ports a prefetch timing side channel to Windows to defeat KASLR, then chains these into a token-swapping exploit that gains SYSTEM privileges.
exploits.forsale
Published on exploits.forsale
Source code: https://github.com/exploits-forsale/24h2-nt-exploit
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a broad change in 24H2 to treat user mode memory as volatile, which turned previously optimised single dereferences into two separate dereferences of attacker-controlled fields.
Impact
A local attacker could gain arbitrary kernel read and write and elevate to SYSTEM; the KASLR bypass was reliable on modern Intel CPUs but less consistent on AMD hardware.
What the attacker needed
Local code execution on the machine; Windows 11 24H2 kernel; modern Intel CPU for the KASLR bypass
How it was found
- Call NtCreateUserProcess with a PS_ATTRIBUTE_LIST containing a mitigation options attribute.
- Change the Size field of the attribute between the two fetches to overflow the stack buffer.
- Call NtQueryInformationThread with the ThreadTebInformation class and a kernel address as the destination.
- Set BytesToRead non-zero for the first fetch, then change it to zero before the second fetch so ProbeForWrite is skipped.
- Use the resulting arbitrary write to corrupt the ExpManufacturingInformation global and read kernel memory via NtQuerySystemInformation.
- Walk the process list, copy a privileged process token over the exploit process token, and spawn a SYSTEM shell.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The Windows kernel is the core of the operating system, and it normally checks every memory address a program hands it before using it. A double-fetch happens when the kernel reads the same value from the program's memory twice, and the program changes it in between, so the second read sees something different from what was checked. Here that trick lets an attacker write to kernel memory and eventually run commands as the system's most powerful account.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.