Rescue Rex::ConnectionError while finding the uri

bug/bundler_fix
jvazquez-r7 2014-07-21 12:00:24 -05:00
parent 30de4cdf8d
commit 436ac706e8
1 changed files with 17 additions and 9 deletions

View File

@ -55,20 +55,28 @@ class Metasploit3 < Msf::Auxiliary
end
paths.each do |path|
begin
res = send_request_cgi({
'uri' => path,
'method' => 'GET'
})
rescue ::Rex::ConnectionError
next
end
next unless res
if res.redirect? && res.headers['Location'] && res.headers['Location'] !~ /^http/
path = res.headers['Location']
vprint_status("#{rhost}:#{rport} - Following redirect: #{path}")
begin
res = send_request_cgi({
'uri' => path,
'method' => 'GET'
})
rescue ::Rex::ConnectionError
next
end
next unless res
end
@ -205,7 +213,7 @@ class Metasploit3 < Msf::Auxiliary
end
def determine_result(response)
return :abort unless response.kind_of? Rex::Proto::Http::Response
return :abort unless response.kind_of?(Rex::Proto::Http::Response)
return :abort unless response.code
if [200, 301, 302].include?(response.code)