Cyber Services / All lessons / CEH — Ethical Hacking / Web Scanning wpscan

Web Scanning wpscan

Module 18 of 130 · 8 min read · Free to read

MODULES ↓ Command blocks have a COPY button
Comprehensive WordPress Security Assessment Tool for Ethical Hackers
Vulnerability Detection WordPress Security Security Testing Practical Activities

WPScan: The WordPress Security Scanner

WordPress powers over 40% of the web, making it a prime target for attackers. WPScan is a specialized, open-source, black-box vulnerability scanner designed specifically for WordPress security assessments. It helps ethical hackers and security professionals identify misconfigurations, known vulnerabilities in the core software, plugins, and themes, enumerate users, and even attempt password cracking.

Why Focus on WordPress Security?
  • Massive install base makes it a high-value target for attackers
  • Extensibility via plugins and themes introduces a large potential attack surface
  • Misconfigurations and outdated components are common in real-world deployments
  • Compromised sites can be used for phishing, malware distribution, or pivoting into networks
Ethical Mandate: Authorization is Essential

WARNING: WPScan performs active scanning and vulnerability testing. You MUST have explicit, written permission from the website owner before scanning any WordPress site. Unauthorized scanning is illegal and unethical. Confine all usage to authorized tests or personal lab environments.

Vulnerability Detection

Identifies security issues in WordPress core, plugins, and themes using WPVulnDB

User Enumeration

Discovers WordPress users through various techniques including author ID enumeration

Password Attacks

Performs brute-force attacks against WordPress login mechanisms

Configuration Testing

Identifies backup files, database exports, and other security misconfigurations

Installation & Setup

Installation on Kali Linux

WPScan is typically pre-installed on Kali Linux. Always ensure you have the latest version and its database is updated.

# Verify installation and check version
wpscan --version
# Update WPScan (if needed)
sudo apt update && sudo apt install wpscan -y
# Update WPScan vulnerability database
wpscan --update

WPVulnDB API Key Setup

To get vulnerability information for WordPress core, plugins, and themes, WPScan relies on the WPVulnDB API. You must register for a free or paid API key at wpscan.com/api.

# One-time use with API token
wpscan --url http://target.com/ --api-token YOUR_API_TOKEN
# Save API token to configuration (recommended)
# Edit ~/.wpscan/scan.yml or /etc/wpscan/scan.yml and add:
# cli:
#   api_token: YOUR_API_TOKEN
Critical: API Key Required

Without a valid API key, WPScan cannot report specific vulnerabilities found in enumerated components. The API key is essential for comprehensive vulnerability assessment.

Enumeration Techniques

Basic Scan

A basic scan provides initial information about the target WordPress installation.

# Basic WPScan reconnaissance
wpscan --url http://target-domain.com/

This performs basic checks including:

  • HTTP Headers analysis
  • Server Information detection
  • Robots.txt presence and content
  • WordPress README file detection
  • WordPress version identification (if possible)
  • Main theme detection

Advanced Enumeration

Enumeration is key to identifying potentially vulnerable components or usernames for further attacks.

# Base enumeration syntax
wpscan --url http://target.com/ --enumerate option(s)

Common Enumeration Options

Option Description Intrusiveness
p Popular plugins Low
ap All plugins (more intensive) High
vp Vulnerable plugins (requires API key) Medium
t Popular themes Low
vt Vulnerable themes (requires API key) Medium
u Usernames (range 1-10 by default) Medium
tt Timthumbs (legacy file often vulnerable) Low
cb, dbe Config backups and database exports Low
# Comprehensive enumeration example
wpscan --url http://target.com/ --enumerate vp,vt,u1-30,cb,dbe --api-token YOUR_API_TOKEN

Detection Modes

You can influence how plugins and themes are detected to balance between speed and comprehensiveness.

# Use aggressive detection for comprehensive results
wpscan --url http://target.com/ --enumerate ap --plugins-detection aggressive
Detection Mode Options
  • --plugins-detection mixed (Default): Combines passive and aggressive methods
  • --plugins-detection passive: Only checks page sources (faster, less comprehensive)
  • --plugins-detection aggressive: Uses brute-force guessing (slower, more comprehensive)

Vulnerability Detection

WPVulnDB Integration

WPScan's most powerful feature is its integration with the WPVulnDB database, which contains detailed information about WordPress core, plugin, and theme vulnerabilities.

# Scan for vulnerable plugins and themes
wpscan --url http://target.com/ -e vp,vt --api-token YOUR_API_TOKEN
CEH Domain Relevance

WPScan's vulnerability detection directly supports the Vulnerability Analysis and Web Application Hacking domains of the CEH curriculum. Its ability to identify specific CVE-listed vulnerabilities in WordPress components aligns perfectly with the practical skills expected of a Certified Ethical Hacker.

Common WordPress Vulnerabilities

WPScan can detect a wide range of WordPress-specific vulnerabilities:

Vulnerability Type Examples Impact Level
SQL Injection Plugin SQLi allowing database access Critical
Cross-Site Scripting (XSS) Theme XSS in search functionality High
File Inclusion LFI/RFI in plugin file parameters High
Privilege Escalation Plugin flaws allowing admin access Critical
Authentication Bypass Weak authentication in custom code Critical
Information Disclosure Backup files, version disclosure Medium

Password Brute-Forcing

WordPress Authentication Attacks

WPScan can attempt to brute-force user passwords via the WordPress login mechanism (XML-RPC or wp-login.php).

# Basic brute-force syntax
wpscan --url http://target.com/ --passwords wordlist_file --usernames user_or_userlist_file
# Brute-force specific user
wpscan --url http://target.com/ -P /usr/share/wordlists/rockyou.txt -U admin
# Brute-force enumerated users
wpscan --url http://target.com/ -P /path/to/passwords.txt -U users.txt

Attack Configuration

Fine-tune your brute-force attacks for better efficiency and stealth.

# Use XML-RPC for faster attacks (if available)
wpscan --url http://target.com/ --passwords passwords.txt --usernames admin --password-attack xmlrpc
# Set request throttling to avoid detection
wpscan --url http://target.com/ --passwords passwords.txt --usernames users.txt --throttle 1000
Brute-Forcing Considerations
  • Can be very noisy and easily detected by security plugins or WAFs
  • May trigger account lockouts and alert site administrators
  • Can be slow depending on server response and list sizes
  • Requires knowledge of valid usernames (use --enumerate u first)

Advanced Options & Techniques

Stealth & Performance Options

Request Throttling
Control scanning speed to reduce detection risk and server load.
# Add delay between requests
wpscan --url http://target.com/ --throttle 500
User-Agent Manipulation
Modify request headers to avoid basic detection.
# Use random User-Agent strings
wpscan --url http://target.com/ --random-user-agent
# Set custom User-Agent
wpscan --url http://target.com/ --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
Timeout Configuration
Adjust connection and request timeouts for different network conditions.
# Set custom timeouts
wpscan --url http://target.com/ --request-timeout 30 --connect-timeout 15

Output & Reporting

Multiple Output Formats
Generate reports in various formats for different use cases.
# Save results in JSON format
wpscan --url http://target.com/ -e vp,vt,u -f json -o scan_results.json --api-token YOUR_API_TOKEN
Verbosity Control
Adjust the level of detail in scan output.
# Increase verbosity for detailed logging
wpscan --url http://target.com/ -v

Hands-On Activities

Activity 1: Comprehensive WordPress Assessment
Objective: Perform a complete security assessment of a test WordPress installation
  1. Set up a test environment with a vulnerable WordPress installation (DVWP, WPScan Vulnerable WordPress, etc.)
  2. Run a basic WPScan to discover the WordPress version and main theme
  3. Enumerate users, plugins, and themes with vulnerability checking
  4. Analyze findings and identify high-priority vulnerabilities
  5. Attempt password brute-forcing on discovered users
  6. Generate comprehensive reports in multiple formats
  7. Document findings with evidence and severity ratings
# Comprehensive assessment command
wpscan --url http://test-wp.local/ -e vp,vt,u,cb,dbe -f html,json -o comprehensive_scan --api-token YOUR_API_TOKEN
Activity 2: Stealthy WordPress Reconnaissance
Objective: Perform reconnaissance while minimizing detection risk
  1. Configure WPScan for stealth operation with throttling and custom User-Agent
  2. Use passive detection methods initially to avoid triggering security controls
  3. Gradually increase scan intensity based on initial findings
  4. Focus on high-value targets identified during reconnaissance
  5. Document techniques used to avoid detection
# Stealth reconnaissance command
wpscan --url http://target.com/ --enumerate p,t,u --plugins-detection passive --throttle 2000 --random-user-agent -o stealth_scan
Activity 3: Targeted Plugin Vulnerability Assessment
Objective: Focus on identifying and verifying plugin-specific vulnerabilities
  1. Enumerate all plugins on the target WordPress site
  2. Research identified plugins for known vulnerabilities
  3. Use WPScan to verify specific plugin vulnerabilities
  4. Manually verify critical findings where possible
  5. Document exploitability and potential impact
# Plugin-focused assessment
wpscan --url http://target.com/ --enumerate vp --plugins-detection aggressive --api-token YOUR_API_TOKEN -f json -o plugin_scan.json
Interpreting Results & Next Steps
  • Prioritize by Severity: Focus on high-impact findings like SQL Injection, privilege escalation, and authentication bypass first
  • Verify Findings: Always manually verify reported vulnerabilities to eliminate false positives
  • Understand Context: Analyze where vulnerabilities were found to determine exploitability
  • Leverage Detailed Info: Use version information and CVE details in reports for verification
  • Combine with Manual Testing: Use WPScan as a starting point for deeper manual security testing

Conclusion: WPScan in Your Security Toolkit

WPScan is an indispensable tool for any security professional working with WordPress environments. Its specialized focus on WordPress security, comprehensive vulnerability database integration, and flexible scanning options make it superior to generic web application scanners for WordPress assessments. By mastering its command-line interface and understanding how to tailor scans effectively, you can significantly improve your efficiency in identifying WordPress-specific security weaknesses.

Key Takeaways
  • WPScan provides specialized black-box WordPress security testing
  • WPVulnDB API integration is essential for comprehensive vulnerability detection
  • Flexible enumeration options allow targeted security assessments
  • Multiple output formats support integration with other tools and reporting
  • Stealth options help reduce detection during authorized testing
  • Always verify findings manually and operate within authorized scopes
Final Ethical Reminder

WordPress vulnerability scanners like WPScan are powerful tools that must be used responsibly. Always ensure you have explicit, written permission before scanning any WordPress installations. Unauthorized scanning is not only unethical but also illegal in many jurisdictions. Use these skills to improve security posture, not to compromise systems. Document your findings responsibly and follow proper disclosure procedures when vulnerabilities are identified.

Modules (130) ← CEH — Ethical Hacking