Skip to content

Commit 9634248

Browse files
David MaloneyDavid Maloney
authored andcommitted
treat socket reads as a connection error
treat failures to read from the socket as a connection error
1 parent a597de5 commit 9634248

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

lib/metasploit/framework/login_scanner/smb.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ def attempt_login(credential)
127127
else
128128
status = Metasploit::Model::Login::Status::INCORRECT
129129
end
130-
rescue ::Rex::ConnectionError => e
130+
rescue ::Rex::ConnectionError, Errno::EINVAL => e
131131
status = Metasploit::Model::Login::Status::UNABLE_TO_CONNECT
132132
proof = e
133133
rescue RubySMB::Error::UnexpectedStatusCode => e
134134
status = Metasploit::Model::Login::Status::INCORRECT
135+
ensure
136+
client.disconnect!
135137
end
136138

137139
if status == Metasploit::Model::Login::Status::SUCCESSFUL && credential.public.empty?

0 commit comments

Comments
 (0)