Skip to content

Commit 4909a43

Browse files
authored
Land rapid7#19252, improve error handling for unhandled errors
2 parents df8f281 + 4316d52 commit 4909a43

File tree

1 file changed

+9
-1
lines changed
  • lib/metasploit/framework/login_scanner

1 file changed

+9
-1
lines changed

lib/metasploit/framework/login_scanner/base.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,15 @@ def scan!
252252
end
253253
end
254254
rescue => e
255-
elog('Attempt may not yield a result', error: e)
255+
if framework_module
256+
prefix = framework_module.respond_to?(:peer) ? "#{framework_module.peer} - LOGIN FAILED:" : "LOGIN FAILED:"
257+
framework_module.print_warning("#{prefix} #{credential.to_h} - Unhandled error - scan may not produce correct results: #{e.message} - #{e.backtrace}")
258+
end
259+
elog("Scan Error: #{e.message}", error: e)
260+
consecutive_error_count += 1
261+
total_error_count += 1
262+
break if consecutive_error_count >= 3
263+
break if total_error_count >= 10
256264
end
257265
nil
258266
end

0 commit comments

Comments
 (0)