Better handling of failed requests

bug/bundler_fix
Jon Hart 2014-12-11 16:51:41 -08:00
parent f2bda05d42
commit 0627f708a2
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 8 additions and 3 deletions

View File

@ -44,7 +44,13 @@ class Metasploit4 < Msf::Auxiliary
end
def password_reset
send_request_cgi('uri' => normalize_uri(target_uri.path, 'PasswordReset'))
begin
uri = normalize_uri(target_uri.path, 'PasswordReset')
send_request_cgi('uri' => uri)
rescue => e
vprint_error("#{peer}: unable to request #{uri}: #{e}")
nil
end
end
def track_it?(res)
@ -59,7 +65,7 @@ class Metasploit4 < Msf::Auxiliary
vprint_status("#{peer}: retrieving PasswordReset page to extract Track-It! version")
unless (res = password_reset)
print_error("#{peer}: Could not contact server")
return
end
if track_it?(res)
@ -100,7 +106,6 @@ class Metasploit4 < Msf::Auxiliary
end
unless (res = password_reset)
print_error("#{peer}: Could not contact server")
return
end