WordPress Attacks & Exploitation
π― Objective: Transform enumeration findings into actionable attacks, achieving code execution and system compromise through WordPress vulnerabilities and misconfigurations.
Overview
After completing WordPress enumeration, we move to the exploitation phase. WordPress presents multiple attack vectors including credential-based attacks, theme manipulation, plugin vulnerabilities, and core exploits. This section covers systematic approaches to gaining initial access and escalating privileges.
Attack Categories:
π Authentication Attacks - Brute force and credential compromise
π» Code Execution - Theme editor manipulation and file upload bypasses
π§ Automated Exploitation - Metasploit and framework-based attacks
π― Plugin Vulnerabilities - CVE exploitation and zero-day techniques
Prerequisites
Before proceeding with attacks, ensure completion of:
WordPress Discovery & Enumeration - Target reconnaissance
Valid user accounts identified - Username enumeration results
Plugin versions documented - Vulnerability research completed
WordPress version confirmed - Core exploit mapping
Authentication Attacks
Login Brute Force with WPScan
XML-RPC Method (Preferred)
Traditional wp-login Method
Targeted User Attack
Manual Brute Force Techniques
Custom Login Attack Scripts
Hydra Integration
Code Execution Techniques
Theme Editor Exploitation
Step 1: Administrative Access Required
Step 2: Theme Selection Strategy
Step 3: Web Shell Injection
Simple Command Execution:
Advanced PHP Web Shell:
Step 4: Web Shell Access
Reverse Shell Establishment
PHP Reverse Shell
Netcat Listener Setup
Metasploit Exploitation
wp_admin_shell_upload Module
Module Configuration
Module Options Verification
Exploitation Execution
Meterpreter Post-Exploitation
System Information Gathering
File System Exploration
Plugin Vulnerability Exploitation
mail-masta Plugin LFI
Vulnerability Analysis
Local File Inclusion Exploitation
WordPress Configuration Disclosure
Log Poisoning Attack
wpDiscuz Plugin RCE
Vulnerability Overview
Automated Exploitation
Manual Web Shell Access
Advanced Attack Techniques
WordPress Core Exploits
Version-Specific Attacks
XML-RPC Abuse
Database Access Exploitation
wp-config.php Credentials
WordPress Database Manipulation
Post-Exploitation Activities
Persistence Mechanisms
Web Shell Maintenance
User Account Creation
Data Extraction
Sensitive File Collection
WordPress-Specific Intelligence
HTB Academy Lab Solutions
Lab 1: User Enumeration
Question: "Perform user enumeration against http://blog.inlanefreight.local. Aside from admin, what is the other user present?"
Solution:
Lab 2: Password Brute Force
Question: "Perform a login bruteforcing attack against the discovered user. Submit the user's password as the answer."
Solution:
Lab 3: System User Discovery
Question: "Using the methods shown in this section, find another system user whose login shell is set to /bin/bash."
Solution:
Lab 4: Code Execution and Flag Retrieval
Question: "Following the steps in this section, obtain code execution on the host and submit the contents of the flag.txt file in the webroot."
Solution:
Security Cleanup & Artifacts
Post-Engagement Cleanup
Files to Remove
Log Evidence
Report Documentation
Testing Artifacts to Document
Defensive Recommendations
Immediate Actions
Security Hardening
Next Steps
After WordPress compromise:
Privilege Escalation - Escalate from www-data to root
Lateral Movement - Move to other systems
Persistence - Maintain long-term access
Data Exfiltration - Extract sensitive information
π‘ Key Takeaway: WordPress attacks often provide initial web application access. Combining enumeration findings with systematic exploitation techniques enables reliable compromise of vulnerable WordPress installations. Always document artifacts and clean up testing evidence during professional engagements.
Last updated