nginx 配置错误而导致目录遍历漏洞

漏洞版本:
nginx(Tested at 1.1.10)
漏洞描述:
nginx是一款高性能的web服务器,使用非常广泛,其不仅经常被用作反向代理

在nginx中开启autoindex,配置不规范而造成目录遍历漏洞

配置如下:
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;
}
}

注意 这里/home/wwwroot/paper/; 有个/

当你浏览http://sebug.net/paper/,正常情况应该遍历/home/wwwroot/paper/这个目录,但是如果访问http://sebug.net/paper../, 这个的话就会遍历/home/wwwroot/这个目录了
<* 参考

http://luoq.net/ais/1191/

*>
安全建议:
sebug建议:

使用如下配置
location /paper {
alias /home/wwwroot/paper;

location /paper/ {
alias /home/wwwroot/paper/;

你可能感兴趣的:(Nginx,安全测试,nginx,web服务,server)