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

漏洞版本:nginx(Tested at 1.1.10)

漏洞描述:nginx是一款高性能的web服务器,使用非常广泛,其不仅经常被用作反向代理,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。

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

配置如下:

  1. server {
  2. listen 80;
  3. server_name sebug.net;
  4. index index.htm index.html;
  5. root /home/wwwroot/www;
  6. access_log off;
  7. location /paper {
  8. alias /home/wwwroot/paper/;
  9. autoindex on;
  10. }
  11. }

注意 这里/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/;

【编辑推荐】

20个Nginx Web服务器最佳安全实践
nginx爆0day漏洞 上传图片可入侵100万服务器
nginx文件类型错误解析漏洞

发表新评论