Skip to content

Commit b1eed8e

Browse files
committed
Add sonicwall login connection error handling
1 parent 30d071e commit b1eed8e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/metasploit/framework/login_scanner/sonicwall.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ def do_login(username, password, depth)
9595
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Waiting too long in lockout' } if depth >= 2
9696

9797
#-- get authentication details from first request
98-
res = get_auth_details(username, password)
98+
begin
99+
res = get_auth_details(username, password)
100+
rescue ::Rex::ConnectionError, ::Rex::ConnectionProxyError, ::Errno::ECONNRESET, ::Errno::EINTR, ::Rex::TimeoutError, ::Timeout::Error, ::EOFError => e
101+
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e }
102+
end
99103

100104
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Invalid response' } unless res
101105
return { status: ::Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: 'Failed to receive a authentication details' } unless res&.headers && res.headers.key?('X-SNWL-Authenticate')

0 commit comments

Comments
 (0)