@@ -181,7 +181,7 @@ def lanman_netshareenum(ip, rport, info)
181
181
) )
182
182
rescue ::Rex ::Proto ::SMB ::Exceptions ::ErrorCode => e
183
183
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..." )
185
185
datastore [ 'USE_SRVSVC_ONLY' ] = true # Make sure the module is aware of this state
186
186
return srvsvc_netshareenum ( ip )
187
187
end
@@ -384,15 +384,15 @@ def run_host(ip)
384
384
raise $!
385
385
rescue ::Rex ::Proto ::SMB ::Exceptions ::LoginError ,
386
386
::Rex ::Proto ::SMB ::Exceptions ::ErrorCode => e
387
- print_error ( e . message )
387
+ print_error ( " #{ ip } : #{ rport } - #{ e . message } " )
388
388
return if e . message =~ /STATUS_ACCESS_DENIED/
389
389
rescue Errno ::ECONNRESET ,
390
390
::Rex ::Proto ::SMB ::Exceptions ::InvalidType ,
391
391
::Rex ::Proto ::SMB ::Exceptions ::ReadPacket ,
392
392
::Rex ::Proto ::SMB ::Exceptions ::InvalidCommand ,
393
393
::Rex ::Proto ::SMB ::Exceptions ::InvalidWordCount ,
394
394
::Rex ::Proto ::SMB ::Exceptions ::NoReply => e
395
- vprint_error ( e . message )
395
+ vprint_error ( " #{ ip } : #{ rport } - #{ e . message } " )
396
396
next if not shares . empty? and rport == 139 # no results, try again
397
397
rescue Errno ::ENOPROTOOPT
398
398
print_status ( "Wait 5 seconds before retrying..." )
@@ -401,7 +401,7 @@ def run_host(ip)
401
401
rescue ::Exception => e
402
402
next if e . to_s =~ /execution expired/
403
403
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 } '" )
405
405
ensure
406
406
disconnect
407
407
end
0 commit comments