From a889c8ae99271c1bb039db3b92c89c6e8a3aa4cb Mon Sep 17 00:00:00 2001 From: Royce Davis Date: Fri, 9 Nov 2012 08:33:05 -0600 Subject: [PATCH] error handling adjustments on loggedin_users.rb --- modules/auxiliary/scanner/smb/loggedin_users.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/auxiliary/scanner/smb/loggedin_users.rb b/modules/auxiliary/scanner/smb/loggedin_users.rb index 6b74aadcd7..ff93de9071 100644 --- a/modules/auxiliary/scanner/smb/loggedin_users.rb +++ b/modules/auxiliary/scanner/smb/loggedin_users.rb @@ -53,15 +53,9 @@ class Metasploit3 < Msf::Auxiliary text = "\\WINDOWS\\Temp\\#{Rex::Text.rand_text_alpha(16)}.txt" smbshare = datastore['SMBSHARE'] - #Try and Connect to the target - begin - connect() - rescue - return - end - #Try and authenticate with given credentials begin + connect() smb_login() rescue StandardError => autherror print_error("#{ip} - #{autherror}") @@ -77,6 +71,7 @@ class Metasploit3 < Msf::Auxiliary check_hku_entry(key, ip, smbshare, cmd, text, bat) end cleanup_after(smbshare, ip, cmd, text, bat) + disconnect() end