parent
bc88732400
commit
91b748a701
|
@ -68,7 +68,7 @@ module Exploit::Remote::SMB::Psexec
|
|||
scm_handle = dcerpc.last_response.stub_data[0,20]
|
||||
end
|
||||
rescue ::Exception => e
|
||||
print_error("#{peer} - Error: #{e}")
|
||||
print_error("#{peer} - Error getting scm handle: #{e}")
|
||||
return false
|
||||
end
|
||||
servicename = Rex::Text.rand_text_alpha(11)
|
||||
|
@ -98,7 +98,7 @@ module Exploit::Remote::SMB::Psexec
|
|||
svc_status = dcerpc.last_response.stub_data[24,4]
|
||||
end
|
||||
rescue ::Exception => e
|
||||
print_error("#{peer} - Error: #{e}")
|
||||
print_error("#{peer} - Error creating service: #{e}")
|
||||
return false
|
||||
end
|
||||
vprint_status("#{peer} - Closing service handle...")
|
||||
|
@ -114,7 +114,7 @@ module Exploit::Remote::SMB::Psexec
|
|||
svc_handle = dcerpc.last_response.stub_data[0,20]
|
||||
end
|
||||
rescue ::Exception => e
|
||||
print_error("#{peer} - Error: #{e}")
|
||||
print_error("#{peer} - Error opening service: #{e}")
|
||||
return false
|
||||
end
|
||||
vprint_status("#{peer} - Starting the service...")
|
||||
|
@ -124,7 +124,7 @@ module Exploit::Remote::SMB::Psexec
|
|||
if dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil
|
||||
end
|
||||
rescue ::Exception => e
|
||||
print_error("#{peer} - Error: #{e}")
|
||||
print_error("#{peer} - Error starting service: #{e}")
|
||||
return false
|
||||
end
|
||||
vprint_status("#{peer} - Removing the service...")
|
||||
|
@ -134,13 +134,13 @@ module Exploit::Remote::SMB::Psexec
|
|||
if dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil
|
||||
end
|
||||
rescue ::Exception => e
|
||||
print_error("#{peer} - Error: #{e}")
|
||||
print_error("#{peer} - Error removing service: #{e}")
|
||||
end
|
||||
vprint_status("#{peer} - Closing service handle...")
|
||||
begin
|
||||
response = dcerpc.call(0x0, svc_handle)
|
||||
rescue ::Exception => e
|
||||
print_error("#{peer} - Error: #{e}")
|
||||
print_error("#{peer} - Error closing service handle: #{e}")
|
||||
end
|
||||
select(nil, nil, nil, 1.0)
|
||||
simple.disconnect("\\\\#{datastore['RHOST']}\\IPC$")
|
||||
|
|
Loading…
Reference in New Issue