Capture a 0xC00000BB condition, plus some other fixes

unstable
sinn3r 2013-07-11 10:52:58 -05:00
parent 3e229fe236
commit a6ce629c3c
1 changed files with 15 additions and 9 deletions

View File

@ -170,14 +170,20 @@ class Metasploit3 < Msf::Auxiliary
def lanman_netshareenum(ip, rport, info)
shares = []
res = self.simple.client.trans(
"\\PIPE\\LANMAN",
(
[0x00].pack('v') +
"WrLeh\x00" +
"B13BWz\x00" +
[0x01, 65406].pack("vv")
))
begin
res = self.simple.client.trans(
"\\PIPE\\LANMAN",
(
[0x00].pack('v') +
"WrLeh\x00" +
"B13BWz\x00" +
[0x01, 65406].pack("vv")
))
rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e
if e.error_code == 0xC00000BB
return srvsvc_netshareenum(ip)
end
end
lerror, lconv, lentries, lcount = res['Payload'].to_s[
res['Payload'].v['ParamOffset'],
@ -325,13 +331,13 @@ class Metasploit3 < Msf::Auxiliary
datastore['SMBDirect'] = @smb_redirect
end
def run_host(ip)
@rport = datastore['RPORT']
@smb_redirect = datastore['SMBDirect']
shares = []
[[139, false], [445, true]].each do |info|
print_warning("Options modified: RPORT=#{info[0]}, SMBDirect=#{info[1]}")
datastore['RPORT'] = info[0]
datastore['SMBDirect'] = info[1]