"Mad Gadget"(反序列化)漏洞Java例子?

"Mad Gadget" (de-serialisation) vulnerability Java example?

A​​pache Commons 声明 (link to statement):

By combining the readObject() methods of various classes which are available on the classpath of the vulnerable application an attacker can execute functions (including calling Runtime.exec() to execute local OS commands).

谁能给出一个具体的 Java 例子 攻击者 execute/inject 本地 OS 如何发出命令?

ysoserial 项目是一个完全武器化的漏洞利用工具包,演示了攻击者如何执行 OS 命令。
对于使用 java 序列化的常见软件,它具有 payloads for common vulnerable libraries as well as exploit implementations

攻击者只需要确定一段在其路径上存在漏洞 class 的软件,并对不受信任的数据执行反序列化。
然后他们需要做的就是将有效负载发送到反序列化器和 boom,执行命令。

此工具利用自 2013 年以来的序列化错误:https://github.com/joaomatosf/jexboss

最近我使用 "Mad gadget"(该工具自动生成 mad-gadget/commons-collection 有效载荷)针对许多 JSF 应用程序成功地对其进行了测试。

我按照这个视频中的步骤操作:https://www.youtube.com/watch?v=VaLSYzEWgVE