Skip to content

Commit 14a3d76

Browse files
committed
Land rapid7#2755 - Microsoft Windows ndproxy.sys Local Privilege Escalation
2 parents 7ab1369 + 83e448f commit 14a3d76

File tree

2 files changed

+447
-3
lines changed

2 files changed

+447
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ def execute_shellcode(shellcode, base_addr=nil, pid=nil)
2323
else
2424
shell_addr = host.memory.allocate(shellcode.length, nil, base_addr)
2525
end
26+
27+
host.memory.protect(shell_addr)
28+
2629
if host.memory.write(shell_addr, shellcode) < shellcode.length
2730
vprint_error("Failed to write shellcode")
2831
return false
2932
end
3033

3134
vprint_status("Creating the thread to execute in 0x#{shell_addr.to_s(16)} (pid=#{pid.to_s})")
32-
ret = session.railgun.kernel32.CreateThread(nil, 0, shell_addr, nil, 0, nil)
33-
if ret['return'] < 1
34-
vprint_error("Unable to CreateThread")
35+
thread = host.thread.create(shell_addr,0)
36+
unless thread.instance_of?(Rex::Post::Meterpreter::Extensions::Stdapi::Sys::Thread)
37+
vprint_error("Unable to create thread")
3538
return false
3639
end
3740

0 commit comments

Comments
 (0)