Allow passing of servicename etc
parent
71818b59d1
commit
16a553937b
|
@ -53,7 +53,10 @@ module Exploit::Remote::SMB::Psexec
|
||||||
# @param command [String] Should be a valid windows command
|
# @param command [String] Should be a valid windows command
|
||||||
# @param disconnect [Boolean] Disconnect afterwards
|
# @param disconnect [Boolean] Disconnect afterwards
|
||||||
# @return [Boolean] Whether everything went well
|
# @return [Boolean] Whether everything went well
|
||||||
def psexec(command, disconnect=true)
|
def psexec(command, disconnect=true, servicename=nil, displayname=nil)
|
||||||
|
servicename ||= Rex::Text.rand_text_alpha(11)
|
||||||
|
displayname ||= Rex::Text.rand_text_alpha(16)
|
||||||
|
|
||||||
simple.connect("\\\\#{datastore['RHOST']}\\IPC$")
|
simple.connect("\\\\#{datastore['RHOST']}\\IPC$")
|
||||||
handle = dcerpc_handle('367abb81-9844-35f1-ad32-98f038001003', '2.0', 'ncacn_np', ["\\svcctl"])
|
handle = dcerpc_handle('367abb81-9844-35f1-ad32-98f038001003', '2.0', 'ncacn_np', ["\\svcctl"])
|
||||||
vprint_status("#{peer} - Binding to #{handle} ...")
|
vprint_status("#{peer} - Binding to #{handle} ...")
|
||||||
|
@ -71,8 +74,7 @@ module Exploit::Remote::SMB::Psexec
|
||||||
print_error("#{peer} - Error getting scm handle: #{e}")
|
print_error("#{peer} - Error getting scm handle: #{e}")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
servicename = Rex::Text.rand_text_alpha(11)
|
|
||||||
displayname = Rex::Text.rand_text_alpha(16)
|
|
||||||
svc_handle = nil
|
svc_handle = nil
|
||||||
svc_status = nil
|
svc_status = nil
|
||||||
stubdata =
|
stubdata =
|
||||||
|
|
Loading…
Reference in New Issue