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:

  1. WordPress Discovery & Enumeration - Target reconnaissance

  2. Valid user accounts identified - Username enumeration results

  3. Plugin versions documented - Vulnerability research completed

  4. 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:

  1. Privilege Escalation - Escalate from www-data to root

  2. Lateral Movement - Move to other systems

  3. Persistence - Maintain long-term access

  4. 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