zoukankan      html  css  js  c++  java
  • Nginx %00空字节执行php漏洞

    Nginx如下版本:
    0.5.*, 0.6.*, 0.7 <= 0.7.65, 0.8 <= 0.8.37
    在使用PHP-FastCGI执行php的时候,URL里面在遇到%00空字节时与FastCGI处理不一致,导致可在非php文件中嵌入php代码,通过访问url+%00.php来执行其中的php代码。如:http://local/robots.txt%00.php会把robots.txt文件当作php来执行。

    nginx %00

    目前还有许多nginx的低版本服务器存在此漏洞,要养成禁止上传文件目录下执行php的好习惯。

    nginx %00 漏洞 

    nginx %00

    临时解决办法,在nginx虚拟机配置或者fcgi.conf配置加如下代码:

    if ($request_filename ~* (.*).php) {
        set $php_url $1;
    }
    if (!-e $php_url.php) {
        return 403;
    }

    当然升级到最新版本的nginx可以很好解决问题。

  • 相关阅读:
    毕业论文格式
    2018.12.14
    关于百度搜索引擎的优缺点
    2018.12.13
    2018.12.12
    2018.12.11
    2108.12.10
    2018.12.9
    2018.12.8
    2018.12.7
  • 原文地址:https://www.cnblogs.com/qmfsun/p/6170175.html
Copyright © 2011-2022 走看看