From 5ff4a55cd29669db9d05d20e4d0aa1c1605e7e22 Mon Sep 17 00:00:00 2001 From: David Maloney Date: Tue, 16 Sep 2014 15:24:14 -0500 Subject: [PATCH] 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 --- lib/metasploit/framework/login_scanner/smb.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/metasploit/framework/login_scanner/smb.rb b/lib/metasploit/framework/login_scanner/smb.rb index 43a05955aa..ad87714954 100644 --- a/lib/metasploit/framework/login_scanner/smb.rb +++ b/lib/metasploit/framework/login_scanner/smb.rb @@ -149,7 +149,16 @@ module Metasploit begin connect rescue ::Rex::ConnectionError => e - return Result.new(credential:credential, status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e) + result = Result.new( + credential:credential, + status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, + proof: e, + host: host, + port: port, + protocol: 'tcp', + service_name: 'smb' + ) + return result end proof = nil