Use :abort for scanner mixin

unstable
Nathan Einwechter 2013-03-25 12:59:18 -04:00
parent 99fe2a33d7
commit 3f79b2fd3b
1 changed files with 6 additions and 13 deletions

View File

@ -56,18 +56,12 @@ class Metasploit3 < Msf::Auxiliary
def run_host(ip) def run_host(ip)
@users_found = {} @users_found = {}
results = ""
each_user_pass { |user,pass| each_user_pass { |user,pass|
results = do_login(user) do_login(user)
if results == "NetworkError"
break
end
} }
if results == "NetworkError" if(@users_found.empty?)
print_error("#{target_url} - UNREACHABLE")
elsif(@users_found.empty?)
print_status("#{target_url} - No users found.") print_status("#{target_url} - No users found.")
else else
print_good("#{target_url} - Users found: #{@users_found.keys.sort.join(", ")}") print_good("#{target_url} - Users found: #{@users_found.keys.sort.join(", ")}")
@ -105,10 +99,9 @@ class Metasploit3 < Msf::Auxiliary
return :abort return :abort
end end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE
return "NetworkError" print_error("#{target_url} - UNREACHABLE")
rescue ::Timeout::Error, ::Errno::EPIPE return :abort
return "NetworkError"
end end
end end