Verify response is non-nil.

bug/bundler_fix
Jeff Jarmoc 2013-02-12 13:41:21 -06:00
parent 9e1f106a87
commit c7719bf4cb
1 changed files with 9 additions and 0 deletions

View File

@ -68,6 +68,11 @@ class Metasploit3 < Msf::Auxiliary
'data' => postdata, 'data' => postdata,
}) })
unless (res)
print_error("No response from server")
return false
end
if res.code == 200 if res.code == 200
error_text = res.body[/<div id=\"error_explanation\">\n\s+(.*?)<\/div>/m, 1] error_text = res.body[/<div id=\"error_explanation\">\n\s+(.*?)<\/div>/m, 1]
print_error("Server returned an error:") print_error("Server returned an error:")
@ -107,6 +112,10 @@ class Metasploit3 < Msf::Auxiliary
'ctype' => 'application/xml', 'ctype' => 'application/xml',
'data' => xml, 'data' => xml,
}) })
unless (res)
print_error("No response from server")
return false
end
case res.code case res.code
when 200 when 200