Fix a stack trace when the SMBUser isn't set

For some reason an invalid user/pass don't seem to trigger
STATUS_ACCESS_DENIED responses, but an empty user does.
This commit is contained in:
James Lee 2012-04-30 17:48:19 -06:00
parent d68d832c9d
commit 6ab66dc59e
1 changed files with 10 additions and 5 deletions

View File

@ -108,11 +108,16 @@ class Metasploit3 < Msf::Auxiliary
simple.connect("IPC$")
handle = dcerpc_handle('4b324fc8-1670-01d3-1278-5a47bf6ee188', '3.0', 'ncacn_np', ["\\srvsvc"])
dcerpc_bind(handle)
begin
dcerpc_bind(handle)
rescue Rex::Proto::SMB::Exceptions::ErrorCode => e
print_error("#{rhost} : #{e.message}")
return
end
stubdata =
NDR.uwstring("\\\\#{rhost}") +
NDR.long(1) #level
NDR.long(1) #level
ref_id = stubdata[0,4].unpack("V")[0]
ctr = [1, ref_id + 4 , 0, 0].pack("VVVV")