Use :abort for scanner mixin
parent
99fe2a33d7
commit
3f79b2fd3b
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue