Skip to main content

WordPress Core Version Enumeration

You can use several manual methods to discover the installed WordPress version. The fastest starting point is reviewing page source in the browser with View page source (CTRL + U). Then search for the generator meta tag (CTRL + F) or pull the page from CLI and filter with curl and grep.

WP Version - Source Code

Aside from version information, source code may also expose useful comments. CSS and JavaScript asset links can also reveal version hints.

WP Version - CSS

WP Version - JS

For older WordPress versions, another common source of version information is the readme.html file in the WordPress root directory.

Plugins and Themes Enumeration

You can find information about installed plugins by reviewing the page source manually or filtering with curl and command-line utilities.

Plugins - Passive Enumeration

Themes - Passive Enumeration

Response headers may also contain version numbers for specific plugins. Not all installed plugins and themes are discoverable passively. To enumerate them actively, send GET requests directly to plugin or theme paths on the server. A 301 redirect confirms the path exists; a 404 means it doesn’t.

Plugins - Active Enumeration

The same applies to installed themes. To speed up enumeration, use a bash script or a tool such as wfuzz or WPScan to automate the process.

Directory Indexing

Active plugins should not be the only area of focus when assessing a WordPress website. Even if a plugin is deactivated, it may still be accessible, and you can still reach its associated scripts and functions. Deactivating a vulnerable plugin does not improve the security of the WordPress site — it is best practice to either remove or keep up-to-date any unused plugins. The following example shows a disabled plugin. Disabled plugin in WordPress admin Browsing to the plugins directory shows the Mail Masta plugin is still accessible despite being disabled. Mail Masta plugin directory accessible You can also view the directory listing using curl and convert the HTML output into a readable format with html2text.
This type of access is called Directory Indexing. It allows you to navigate the folder and access files that may contain sensitive information or vulnerable code. It is best practice to disable directory indexing on web servers so an attacker cannot gain direct access to files or folders beyond those required for the website to function.

User Enumeration

There are two methods for performing manual username enumeration.

First Method

Review posts to uncover the user ID and username. Hovering over the post author link reveals the user’s profile URL in the browser’s status bar. Post author link showing admin user The admin user is usually assigned user ID 1. Confirm this by specifying the user ID in the author parameter:
You can also do this from the command line with curl. The Location header in the response confirms which username belongs to that ID.
If the user ID does not correspond to an existing user, you receive a 404 Not Found response.

Second Method

The second method queries the JSON endpoint to retrieve a list of users. From WordPress 4.7.1 onwards, this endpoint only shows whether a user is configured. Before that release, all users who had published a post were returned by default.

Login

Once we are armed with a list of valid users, we can mount a password brute-forcing attack to attempt to gain access to the WordPress backend. This attack can be performed via the login page or the xmlrpc.php page. If our POST request against xmlrpc.php contains valid credentials, we will receive the following output:
cURL - POST Request
If the credentials are not valid, we will receive a 403 faultCode error.
Invalid Credentials - 403 Forbidden
These last few sections introduced several methods for performing manual enumeration against a WordPress instance. It is essential to understand manual methods before attempting to use automated tools. While automated tools greatly speed up the penetration testing process, it is our responsibility to understand their impact on the systems we are assessing. A solid understanding of manual enumeration methods will also assist with troubleshooting should any automated tools not function properly or provide unexpected output.

WPScan

WPScan is an automated WordPress scanner and enumeration tool. It determines if the various themes and plugins used by a WordPress site are outdated or vulnerable. It is installed by default on Parrot OS but can also be installed manually with gem.
We can issue wpscan --hh to verify the installation. This command will show us the usage menu with all of the available command-line switches.
There are various enumeration options that can be specified, such as vulnerable plugins, all plugins, user enumeration, and more. It is important to understand all of the options available to us and fine-tune the scanner depending on the goal (i.e., are we just interested to see if the WordPress site is using any vulnerable plugins, do we need to perform a full audit of all aspects of the site or are we just interested in creating a user list to use in a brute force password guessing attack?). WPScan can pull in vulnerability information from external sources to enhance our scans. We can obtain an API token from WPVulnDB, which is used by WPScan to scan for vulnerability and exploit proof of concepts (POC) and reports. The free plan allows up to 50 requests per day. To use the WPVulnDB database, just create an account and copy the API token from the users page. This token can then be supplied to WPScan using the --api-token parameter.

Enumerating a Website with WPScan

The --enumerate flag is used to enumerate various components of the WordPress application such as plugins, themes, and users. By default, WPScan enumerates vulnerable plugins, themes, users, media, and backups. However, specific arguments can be supplied to restrict enumeration to specific components. For example, all plugins can be enumerated using the arguments --enumerate ap.
The default number of threads used is 5, however, this value can be changed using the -t flag.
WPScan Enumeration
WPScan uses various passive and active methods to determine versions and vulnerabilities, as shown in the scan output above.