Skip to content

Commit a511729

Browse files
committed
add explicit error handling to base login scanner
1 parent 9981a24 commit a511729

File tree

1 file changed

+7
-2
lines changed
  • lib/metasploit/framework/login_scanner

1 file changed

+7
-2
lines changed

lib/metasploit/framework/login_scanner/base.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,13 @@ def scan!
251251
break if total_error_count >= 10
252252
end
253253
end
254-
rescue => e
255-
elog('Attempt may not yield a result', error: e)
254+
rescue Rex::ConnectionRefused, Rex::SocketError, Rex::HostCommunicationError, Rex::ConnectionError, Rex::TimeoutError, OpenSSL::Cipher::CipherError, Rex::ConnectionProxyError, Errno::ECONNRESET, Errno::EINTR, Errno::EPIPE, ::SystemCallError, ::EOFError, Errno::ENOTCONN, ::Timeout::Error, Rex::Proto::Kerberos::Model::Error::KerberosEncryptionNotSupported, ::JSON::ParserError, Errno::ECONNRESET, OpenSSL::SSL::SSLError, Rex::StreamClosedError, ::Rex::Proto::Kerberos::Model::Error::KerberosError, Errno::ETIMEDOUT => e
255+
framework_module.print_error("Error, scan may not produce results: #{e.message}")
256+
elog("Scan Error: #{e.message}", error: e)
257+
consecutive_error_count += 1
258+
total_error_count += 1
259+
break if consecutive_error_count >= 3
260+
break if total_error_count >= 10
256261
end
257262
nil
258263
end

0 commit comments

Comments
 (0)