Better error handling in two web app modules

unstable
HD Moore 2012-07-15 21:56:00 -05:00
parent 10db74d480
commit b133428bc1
2 changed files with 5 additions and 6 deletions

View File

@ -85,8 +85,8 @@ class Metasploit3 < Msf::Exploit::Remote
}
}) #default timeout, we don't care about the response
if (res)
print_status("The server returned: #{res.code} #{res.message}")
if not res
fail_with(Exploit::Failure::NotFound, 'The server did not respond to our request')
end
resp = res.body.split(key)

View File

@ -63,9 +63,8 @@ class Metasploit3 < Msf::Exploit::Remote
'method' => 'GET',
}, 10)
if not res.headers['set-cookie']
print_error('Could Not Obtain A Session ID')
return
if not (res and res.headers['set-cookie'])
fail_with(Exploit::Failure::NotFound, 'Could not obtain a Session ID')
end
sessionid = 'PHPSESSID=' << res.headers['set-cookie'].split('PHPSESSID=')[1].split('; ')[0]
@ -93,7 +92,7 @@ class Metasploit3 < Msf::Exploit::Remote
}, 10)
if not res
print_error('Could Not Validate The Session ID')
fail_with(Exploit::Failure::NotFound, 'Could not validate the Session ID')
return
end