kayl22/cve-2025-8110-GOGS-RCE
GitHub: kayl22/cve-2025-8110-GOGS-RCE
该脚本自动化利用 GOGS 的 CVE-2025-8110 漏洞,通过符号链接与 sshCommand 实现远程代码执行。
Stars: 1 | Forks: 0
# GOGS RCE cve-2025-8110
Gogs 是一个轻量级且自托管的 Git 服务,类似于 GitHub 的私有版本,旨在让低资源服务器能够轻松运行。CVE-2025-8110 漏洞是一个严重的安全缺陷,允许攻击者通过使用符号链接绕过路径限制。通过上传指向 `.api/config` 的恶意链接,攻击者可以利用 Gogs API 嵌入包含 `sshCommand` 参数的恶意配置文件,并在目标服务器上实现 RCE。
## 用法
1. 将此仓库克隆到本地机器:
```
git clone https://github.com/kayl22/cve-2025-8110-GOGS-RCE
cd ./cve-2025-8110-GOGS-RCE
```
2. 安装所有依赖项:
```
pip3 install -r ./requirements.txt
```
3. 运行脚本:
```
# 打印帮助
python3 ./cve-2025-8110.py --help
# 执行带有注册步骤的攻击链
python3 ./cve-2025-8110.py --url http:// -lh -lp
# 执行跳过注册的攻击链 | 当注册函数返回错误语句时有用
python3 ./cve-2025-8110.py --url http:// -lh -lp -U -P
```
## 工作原理
此脚本遵循一个包含以下步骤的攻击链:
```
1. Register & authenticate a throwaway account (Register skipped if creds are provided with -U and -P flags)
2. Obtain an API bearer token
3. Create an auto-initialised repository
4. Clone the repo locally and push a relative symlink malicious_link -> .git/config
5. PUT the malicious git config (with sshCommand) through the symlink via the PutContents API
6. Trigger the sshCommand by cloning the repo over SSH
```
## 致谢
此脚本由 zAbuQasem(https://github.com/zAbuQasem)制作 poc
标签:API攻击, CVE-2025-8110, DNS解析, DNS 解析, Git服务, Git配置污染, Gogs, Go语言工具, HTTP工具, RCE, SSH命令注入, Symlink攻击, 仓库创建, 代码执行, 内存分配, 开源项目, 权限绕过, 符号链接, 网络安全研究, 自动化攻击链, 路径遍历, 远程命令执行, 逆向工具