Only clean up handles if process started
parent
c2d15f2b31
commit
81fa509b50
|
@ -102,9 +102,8 @@ class Metasploit3 < Msf::Post
|
||||||
# execute command and get output with a poor mans pipe
|
# execute command and get output with a poor mans pipe
|
||||||
if priv_check
|
if priv_check
|
||||||
print_status("Executing CreateProcessAsUserA...we are SYSTEM")
|
print_status("Executing CreateProcessAsUserA...we are SYSTEM")
|
||||||
begin
|
|
||||||
pi = create_process_as_user(domain, user, password, nil, cmdstr)
|
pi = create_process_as_user(domain, user, password, nil, cmdstr)
|
||||||
ensure
|
if pi
|
||||||
session.railgun.kernel32.CloseHandle(pi[:process_handle])
|
session.railgun.kernel32.CloseHandle(pi[:process_handle])
|
||||||
session.railgun.kernel32.CloseHandle(pi[:thread_handle])
|
session.railgun.kernel32.CloseHandle(pi[:thread_handle])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue