Skip to content

Commit

Permalink
Land #19252, improve error handling for unhandled errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 authored Jul 3, 2024
2 parents df8f281 + 4316d52 commit 4909a43
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/metasploit/framework/login_scanner/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,15 @@ def scan!
end
end
rescue => e
elog('Attempt may not yield a result', error: e)
if framework_module
prefix = framework_module.respond_to?(:peer) ? "#{framework_module.peer} - LOGIN FAILED:" : "LOGIN FAILED:"
framework_module.print_warning("#{prefix} #{credential.to_h} - Unhandled error - scan may not produce correct results: #{e.message} - #{e.backtrace}")
end
elog("Scan Error: #{e.message}", error: e)
consecutive_error_count += 1
total_error_count += 1
break if consecutive_error_count >= 3
break if total_error_count >= 10
end
nil
end
Expand Down

0 comments on commit 4909a43

Please sign in to comment.