diff --git a/modules/exploits/unix/webapp/wp_revslider_upload_execute.rb b/modules/exploits/unix/webapp/wp_revslider_upload_execute.rb index abeec39944..c00ec1071f 100644 --- a/modules/exploits/unix/webapp/wp_revslider_upload_execute.rb +++ b/modules/exploits/unix/webapp/wp_revslider_upload_execute.rb @@ -41,37 +41,8 @@ class Metasploit3 < Msf::Exploit::Remote end def check - fixed_version = '3.0.96' - - # RevSlider doesn't have a readme.txt, look elsewhere release_log_url = normalize_uri(wordpress_url_plugins, 'revslider', 'release_log.txt') - vprint_status("#{peer} - Checking #{release_log_url}") - res = send_request_cgi( - 'uri' => release_log_url, - 'method' => 'GET' - ) - - if res.nil? || res.code != 200 - # No release_log.txt present for plugin - return Msf::Exploit::CheckCode::Unknown - end - - if res.body - body = res.body.to_s - version = body[/(?:version)\s*([0-9a-z.-]+)/i, 1] - end - - # Could not identify version number - return Msf::Exploit::CheckCode::Detected if version.nil? - - vprint_status("#{peer} - Found version #{version}") - - # Check to see if version older than fixed version - if Gem::Version.new(version) < Gem::Version.new(fixed_version) - return Msf::Exploit::CheckCode::Appears - else - return Msf::Exploit::CheckCode::Safe - end + check_version_from_custom_file(release_log_url, /^\s*(?:version)\s*(\d{1,2}\.\d{1,2}(?:\.\d{1,2})?).*$/mi, '3.0.96') end def exploit