Better error handling in two web app modules
parent
10db74d480
commit
b133428bc1
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue