commands // YYYY-MM-DD // ID: REF-WordPress Command List

WordPress Command List


Welcome, aspiring cybersecurity professionals! Today, we embark on a journey to understand how attackers (and importantly, defenders!) explore and identify weaknesses in web applications, specifically those built on WordPress. We'll be using two powerful command-line tools: Nmap and WPScan. Our goal is to go from raw technical output to a clear, step-by-step educational walkthrough, so you can grasp the 'why' and 'how' behind each command.

Reconnaissance

Reconnaissance is the crucial first step in any cybersecurity engagement. It's like being a detective; we gather as much information as possible about our target before making any moves. For web applications, this often involves understanding what services are running and what technologies are being used.

Using Nmap for Initial Discovery

Nmap (Network Mapper) is a versatile tool for network discovery and security auditing. We'll start by using it to get a general sense of what's running on our target website.

nmap -sV --script http-wordpress-enum <target-url>

🧠 Beginner Analysis

Let's break down this command:

What this command tells us: We're launching Nmap, asking it to be thorough by checking service versions, and instructing it to use a script specifically designed to enumerate WordPress installations. This is a great way to quickly identify if a site is running WordPress and get an initial idea of its structure.


Sometimes, we want to focus our Nmap scans on specific services. For web servers, port 80 is the standard port for HTTP traffic.

nmap -p80 --script http-wordpress-users <target-url>

🧠 Beginner Analysis

What this command tells us: We're telling Nmap to focus its efforts on the standard web port (80) and to use a script that tries to discover the names of users who can log into this WordPress site. This is a targeted approach to gather specific information about user accounts.


When we have a list of potential usernames, we might want to try and guess their passwords. Nmap can assist with this using brute-force techniques.

nmap -p80 --script http-wordpress-brute --script-args 'userdb=users.txt,passdb=passwords.txt' <target>

🧠 Beginner Analysis

What this command tells us: We are instructing Nmap to try and guess passwords for users on the WordPress site using a brute-force approach. We are providing Nmap with our own lists of usernames and potential passwords to make this process more efficient. Important Note: Brute-forcing can be noisy and may trigger security alerts or get your IP address blocked. Always ensure you have explicit permission before performing such actions.


Nmap has a powerful scripting engine (NSE) with many built-in scripts. You can tell Nmap to run all scripts related to a specific application.

nmap -p80 --script "http-wordpress-*" <target>

🧠 Beginner Analysis

What this command tells us: This is a comprehensive command that tells Nmap to look for and run all available WordPress-related scripts. It's like saying, "Nmap, do everything you know about WordPress!" This can yield a lot of information but might also take longer and produce a lot of output.


Some WordPress scripts focus on identifying specific vulnerabilities or misconfigurations.

nmap -p80 --script http-wordpress-pingback <target>

🧠 Beginner Analysis

What this command tells us: We're using Nmap to specifically investigate the Pingback feature of the WordPress site. Understanding if this feature is enabled and how it's configured can reveal potential avenues for exploitation.


Beyond WordPress-specific enumeration, Nmap can also be used to find common sensitive files or directories that might have been left exposed.

nmap -p80 --script http-enum --script-args http-enum.basepath=/ <target>

🧠 Beginner Analysis

What this command tells us: We're using Nmap's http-enum script to actively scan the website for potentially sensitive files or directories that might be accidentally exposed. By starting from the root directory (/), we're ensuring a thorough search of the website's structure.


When using the broad http-wordpress-* script category, you might want to ensure you're getting the most comprehensive results possible.

nmap -sV --script http-wordpress-enum --script-args search-limit=all <target>

🧠 Beginner Analysis

What this command tells us: We're enhancing our WordPress enumeration by telling Nmap to go beyond the default checks and try to identify every single plugin and theme it can. This significantly increases the chances of finding less common or custom components, which might also harbor vulnerabilities.


Enumeration with WPScan

While Nmap is a general-purpose scanner, tools like WPScan are purpose-built for WordPress. They have a much deeper understanding of WordPress's unique structure and a more comprehensive database of vulnerabilities.

wpscan --url <target-url> --enumerate vp,vt,u --api-token <YOUR_TOKEN>

🧠 Beginner Analysis

What this command tells us: We're using WPScan to perform a detailed enumeration of the WordPress site. We're specifically asking it to find vulnerabilities in plugins and themes, and to list out valid user accounts. The --api-token ensures WPScan is using the most current vulnerability intelligence available.


When trying to discover plugins, sometimes they are not immediately obvious. WPScan has techniques to uncover them.

wpscan --url <target-url> --plugins-detection mixed --stealthy

🧠 Beginner Analysis

What this command tells us: We're instructing WPScan to be very thorough in its search for plugins, using multiple detection techniques. We're also telling it to be as discreet as possible to avoid alerting the website's security systems. This is a good approach when you suspect the target might have security measures in place.


A common attack vector against web applications is brute-forcing login credentials. WPScan can be used for this.

wpscan --url <target-url> -U admin -P /path/to/passwords.txt --throttle 1000

🧠 Beginner Analysis

What this command tells us: We're using WPScan to attempt to log in to the WordPress site by trying a specific username (admin) and a list of common passwords. The --throttle option ensures we're not being overly aggressive and potentially triggering security measures or disrupting the target server. Again, always ensure you have explicit permission before attempting brute-force attacks.


WPScan can also help discover different types of content beyond just plugins and themes.

wpscan --url <target-url> --enumerate cb,dbe

🧠 Beginner Analysis

What this command tells us: We're expanding our enumeration with WPScan to look for other interesting pieces of information, such as comments that might offer clues, and potential ways to access or export the site's database.


Comparing Nmap and WPScan

Feature Nmap WPScan
Speed Very Fast (excellent for initial port scanning and service discovery) Slower (more thorough and specialized for WordPress, can take longer for full scans)
Vulnerability Data General purpose, can use many NSE scripts. Specialized, leverages a dedicated WordPress vulnerability database (WPVulnDB).
Version Detection Guesses based on banner information and service responses. Highly Accurate, leverages specific WordPress versioning techniques.
Hidden Files/Dirs Basic capabilities with http-enum and similar scripts. Advanced capabilities, designed to find WordPress-specific backups and database files.

🧠 Beginner Analysis

Nmap is your general-purpose toolkit for network scanning. It's like a Swiss Army knife – useful for many tasks, especially in the initial phases of reconnaissance. WPScan, on the other hand, is a highly specialized tool, like a scalpel designed specifically for WordPress. It has a much deeper understanding of WordPress and its ecosystem, making it incredibly effective for finding WordPress-specific vulnerabilities and information that Nmap might miss. Often, you'll use Nmap for broad discovery and then switch to WPScan for a deep dive into WordPress.