Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1310 CNY

100%

CVE-2023-23638 PoC — Apache Dubbo Deserialization Vulnerability Gadgets Bypass

Source
Associated Vulnerability
Title:Apache Dubbo Deserialization Vulnerability Gadgets Bypass (CVE-2023-23638)
Description:A deserialization vulnerability existed when dubbo generic invoke, which could lead to malicious code execution. This issue affects Apache Dubbo 2.7.x version 2.7.21 and prior versions; Apache Dubbo 3.0.x version 3.0.13 and prior versions; Apache Dubbo 3.1.x version 3.1.5 and prior versions.
Description
Apache Dubbo (CVE-2023-23638)漏洞利用的工程化实践
Readme
# 更全面的Dubbo漏洞扫描工具见我的另一个项目:https://github.com/YYHYlh/Dubbo-Scan

# Apache-Dubbo-CVE-2023-23638-exp
Apache Dubbo (CVE-2023-23638)漏洞利用的工程化实践,覆盖Dubbo 3.x 从服务发现到漏洞利用及回显的过程。本工具仅供研究和学习,欢迎各位师傅前来探讨和提出宝贵的建议。

# 工具说明

本工具支持CVE-2023-23638在Dubbo 3.x的完整利用,覆盖服务发现到漏洞利用及回显。在Dubbo 2.x版本也可以利用,需要自行传入服务名、方法名等。针对这个漏洞我写了两篇分析文章:
1. [漏洞利用](https://yyhylh.github.io/2023/04/08/Apache%20dubbo%20%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%BC%8F%E6%B4%9E%EF%BC%88CVE-2023-23638%EF%BC%89%E5%88%86%E6%9E%90%E5%8F%8A%E5%88%A9%E7%94%A8%E6%8E%A2%E7%B4%A2/)
2. [漏洞回显](https://yyhylh.github.io/2023/05/11/Apache%20Dubbo%20%EF%BC%88CVE-2023-23638%EF%BC%89%E5%AE%8C%E6%95%B4%E5%88%A9%E7%94%A8%E5%8F%8A%E5%B7%A5%E7%A8%8B%E5%8C%96%E5%AE%9E%E8%B7%B5/)

本工具仅作学习使用,未考虑诸多实战中的问题,例如:
1. 自定义服务名、方法名利用
2. ~~字节码java编译的版本问题~~

~~后续会继续更新~~

本项目不会再更新,关于Dubbo更全面的扫描和利用后续会在另一个项目中开源,敬请期待!

感谢y4tacker师傅分享的fastjson原生反序列化思路

# 命令行

单URL漏洞利用
```
java -jar CVE-2023-23638.jar TARGET_IP TARGET_PORT COMMAND CHARSET(default UTF-8)
e.g.:
  java -jar CVE-2023-23638.jar 127.0.0.1 20880 whoami
```

单URL漏洞无损检测
```
java -jar CVE-2023-23638.jar -s TARGET_IP TARGET_PORT
e.g.:
  java -jar CVE-2023-23638.jar -s 127.0.0.1 20880
```

批量检测
```
1.txt:
127.0.0.1:20880
192.168.1.1:20880


java -jar CVE-2023-23638.jar -f FILE_PATH
e.g.:
  java -jar CVE-2023-23638.jar -f 1.txt
```

# GUI
1. 注入字节码
  ![image](https://github.com/YYHYlh/YYHYlh.github.io/blob/main/source/img/CVE-2023-23638/image_3cwuAHt8rp.png)
  
2. 命令执行
  ![image](https://github.com/YYHYlh/YYHYlh.github.io/blob/main/source/img/CVE-2023-23638/image_JssjAyeoi2.png)


# 免责声明
本工具仅漏洞研究和学习,如您需要测试本工具的可用性,请自行搭建靶机环境。
在使用本工具进行检测时,您应确保该行为符合当地的法律法规,并且已经取得了足够的授权。请勿对非授权目标进行扫描。
如您在使用本工具的过程中存在任何非法行为,您需自行承担相应后果,我们将不承担任何法律及连带责任。

# 参考文档

1. https://y4tacker.github.io/2023/03/20/year/2023/3/FastJson%E4%B8%8E%E5%8E%9F%E7%94%9F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/
2. https://y4tacker.github.io/2023/04/26/year/2023/4/FastJson%E4%B8%8E%E5%8E%9F%E7%94%9F%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96-%E4%BA%8C/
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →