nginx是一款高性能的web服务器,使用非常广泛,其不仅经常被用作反向代理
在nginx中开启autoindex,配置不规范而造成目录遍历漏洞
配置如下:
<code>server {
    listen    80;
    server_name sebug.net;
    index index.htm index.html;
    root  /home/wwwroot/www;
    access_log off;
    location /paper {
           alias /home/wwwroot/paper/;
           autoindex on;
       }
}</code>
注意 这里/home/wwwroot/paper/;  有个/
当你浏览http://sebug.net/paper/,正常情况应该遍历/home/wwwroot/paper/这个目录,但是如果访问http://sebug.net/paper../, 这个的话就会遍历/home/wwwroot/这个目录了
nginx是一款高性能的web服务器,使用非常广泛,其不仅经常被用作反向代理
在nginx中开启autoindex,配置不规范而造成目录遍历漏洞
配置如下:
<pre class="prettyprint linenums">server {
    listen    80;
    server_name sebug.net;
    index index.htm index.html;
    root  /home/wwwroot/www;
    access_log off;
    location /paper {
           alias /home/wwwroot/paper/;
           autoindex on;
       }
}</pre>
注意 这里/home/wwwroot/paper/;  有个/
当你浏览http://sebug.net/paper/,正常情况应该遍历/home/wwwroot/paper/这个目录,但是如果访问http://sebug.net/paper../, 这个的话就会遍历/home/wwwroot/这个目录了
nginx(Tested at 1.1.10)
sebug建议:
使用如下配置
location /paper {
    alias /home/wwwroot/paper;
或
location /paper/ {
    alias /home/wwwroot/paper/;
                       
                       
        
          
暂无评论