Skip to content

Commit 5ff4a55

Browse files
David MaloneyDavid Maloney
authored andcommitted
smb connection error not setting result properly
if the initial connection from the SMB LoginScanner fails it wouldn't set the target information on the result. this could cause smb_login to throw a stack trace when it calls invalidate_login
1 parent e5aa5c4 commit 5ff4a55

File tree

1 file changed

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

1 file changed

+10
-1
lines changed

lib/metasploit/framework/login_scanner/smb.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,16 @@ def attempt_login(credential)
149149
begin
150150
connect
151151
rescue ::Rex::ConnectionError => e
152-
return Result.new(credential:credential, status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e)
152+
result = Result.new(
153+
credential:credential,
154+
status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT,
155+
proof: e,
156+
host: host,
157+
port: port,
158+
protocol: 'tcp',
159+
service_name: 'smb'
160+
)
161+
return result
153162
end
154163
proof = nil
155164

0 commit comments

Comments
 (0)