From 08c7b49be09b6fba2690797e52e33266d89632f7 Mon Sep 17 00:00:00 2001 From: dummys Date: Thu, 19 Sep 2013 21:47:01 +0200 Subject: [PATCH] corrected too much if --- modules/exploits/multi/php/glpi_install_rce.rb | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/modules/exploits/multi/php/glpi_install_rce.rb b/modules/exploits/multi/php/glpi_install_rce.rb index 02abbd14b3..a2da3df864 100644 --- a/modules/exploits/multi/php/glpi_install_rce.rb +++ b/modules/exploits/multi/php/glpi_install_rce.rb @@ -57,24 +57,20 @@ class Metasploit3 < Msf::Exploit::Remote if res and res.code == 200 re='(version)(\\s+)(.*)(\\s+)(Copyright)' - m=Regexp.new(re,Regexp::IGNORECASE); matched = m.match(res.body) if matched - versiontab=matched[3].split('.'); - if versiontab.count >= 2 - if (versiontab[0].to_i == 0) and (versiontab[1].to_i <= 84) - if versiontab[2].nil? or (versiontab[2].to_i < 2) - print_good("Detected Version : #{matched[3]}") - return Exploit::CheckCode::Appears - end + if versiontab.count >= 2 and (versiontab[0].to_i == 0) and (versiontab[1].to_i <= 84) + if versiontab[2].nil? or (versiontab[2].to_i < 2) + print_good("Detected Version : #{matched[3]}") + return Exploit::CheckCode::Vulnerable end end - print_error("Detected Version : #{matched[3]}") - else - return Exploit::CheckCode::Unknown + print_error("Detected Version : #{matched[3]}") end + else + return Exploit::CheckCode::Detected end return Exploit::CheckCode::Safe end