From 0627f708a20df27f4be823dc4b1bf712285e00ec Mon Sep 17 00:00:00 2001 From: Jon Hart Date: Thu, 11 Dec 2014 16:51:41 -0800 Subject: [PATCH] Better handling of failed requests --- modules/auxiliary/gather/bmc_trackit_passwd_reset.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/auxiliary/gather/bmc_trackit_passwd_reset.rb b/modules/auxiliary/gather/bmc_trackit_passwd_reset.rb index 0fbc05303e..65d68ab4d5 100644 --- a/modules/auxiliary/gather/bmc_trackit_passwd_reset.rb +++ b/modules/auxiliary/gather/bmc_trackit_passwd_reset.rb @@ -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