Skip to content

Commit eb19050

Browse files
committed
I bet having ip:rport will make more sense
1 parent 0a9c1bc commit eb19050

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/auxiliary/scanner/smb/smb_enumshares.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def lanman_netshareenum(ip, rport, info)
181181
))
182182
rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e
183183
if e.error_code == 0xC00000BB
184-
vprint_error("Got 0xC00000BB while enumerating shares, switching to srvsvc...")
184+
vprint_error("#{ip}:#{rport} - Got 0xC00000BB while enumerating shares, switching to srvsvc...")
185185
datastore['USE_SRVSVC_ONLY'] = true # Make sure the module is aware of this state
186186
return srvsvc_netshareenum(ip)
187187
end
@@ -384,15 +384,15 @@ def run_host(ip)
384384
raise $!
385385
rescue ::Rex::Proto::SMB::Exceptions::LoginError,
386386
::Rex::Proto::SMB::Exceptions::ErrorCode => e
387-
print_error(e.message)
387+
print_error("#{ip}:#{rport} - #{e.message}")
388388
return if e.message =~ /STATUS_ACCESS_DENIED/
389389
rescue Errno::ECONNRESET,
390390
::Rex::Proto::SMB::Exceptions::InvalidType,
391391
::Rex::Proto::SMB::Exceptions::ReadPacket,
392392
::Rex::Proto::SMB::Exceptions::InvalidCommand,
393393
::Rex::Proto::SMB::Exceptions::InvalidWordCount,
394394
::Rex::Proto::SMB::Exceptions::NoReply => e
395-
vprint_error(e.message)
395+
vprint_error("#{ip}:#{rport} - #{e.message}")
396396
next if not shares.empty? and rport == 139 # no results, try again
397397
rescue Errno::ENOPROTOOPT
398398
print_status("Wait 5 seconds before retrying...")
@@ -401,7 +401,7 @@ def run_host(ip)
401401
rescue ::Exception => e
402402
next if e.to_s =~ /execution expired/
403403
next if not shares.empty? and rport == 139
404-
print_error("Error: '#{ip}' '#{e.class}' '#{e.to_s}'")
404+
print_error("#{ip}:#{rport} - Error: '#{ip}' '#{e.class}' '#{e.to_s}'")
405405
ensure
406406
disconnect
407407
end

0 commit comments

Comments
 (0)