Nmap http-wordpress-enum NSE Script


This page contains detailed information about how to use the http-wordpress-enum NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/http-wordpress-enum.nse
Script categories: discovery, intrusive
Target service / protocol: http, https
Target network port(s): 80, 443, 631, 7080, 8080, 8443, 8088, 5800, 3872, 8180, 8000
List of CVEs: -

Script Description


The http-wordpress-enum.nse script enumerates themes and plugins of Wordpress installations. The script can also detect outdated plugins by comparing version numbers with information pulled from api.wordpress.org.

The script works with two separate databases for themes (wp-themes.lst) and plugins (wp-plugins.lst). The databases are sorted by popularity and the script will search only the top 100 entries by default. The theme database has around 32,000 entries while the plugin database has around 14,000 entries.

The script determines the version number of a plugin by looking at the readme.txt file inside the plugin directory and it uses the file style.css inside a theme directory to determine the theme version. If the script argument check-latest is set to true, the script will query api.wordpress.org to obtain the latest version number available. This check is disabled by default since it queries an external service.

This script is a combination of http-wordpress-plugins.nse and http-wordpress-themes.nse originally submited by Ange Gutek and Peter Hill.

TODO:

  • Implement version checking for themes.

Http-wordpress-enum NSE Script Arguments


This is a full list of arguments supported by the http-wordpress-enum.nse script:

http-wordpress-enum.check-latest

Retrieves latest plugin version information from wordpress.org. Default:false.

http-wordpress-enum.root

Base path. By default the script will try to find a WP directory installation or fall back to '/'.

http-wordpress-enum.search-limit

Number of entries or the string "all". Default:100.

http-wordpress-enum.type

Search type. Available options:plugins, themes or all. Default:all.

smbdomain

The domain to log in with. If you aren't in a domain environment, then anything will (should?) be accepted by the server.

smbhash

A password hash to use when logging in. This is given as a single hex string (32 characters) or a pair of hex strings (both 32 characters, optionally separated by a single character). These hashes are the LanMan or NTLM hash of the user's password, and are stored on disk or in memory. They can be retrieved from memory using the fgdump or pwdump tools.

smbnoguest

Use to disable usage of the 'guest' account.

smbpassword

The password to connect with. Be cautious with this, since some servers will lock accounts if the incorrect password is given. Although it's rare that the Administrator account can be locked out, in the off chance that it can, you could get yourself in trouble. To use a blank password, leave this parameter off altogether.

smbtype

The type of SMB authentication to use. These are the possible options:

  • v1: Sends LMv1 and NTLMv1.
  • LMv1: Sends LMv1 only.
  • NTLMv1: Sends NTLMv1 only (default).
  • v2: Sends LMv2 and NTLMv2.
  • LMv2: Sends LMv2 only.
  • NTLMv2: Doesn't exist; the protocol doesn't support NTLMv2 alone. The default, NTLMv1, is a pretty decent compromise between security and compatibility. If you are paranoid, you might want to use v2 or lmv2 for this. (Actually, if you're paranoid, you should be avoiding this protocol altogether!). If you're using an extremely old system, you might need to set this to v1 or lm, which are less secure but more compatible. For information, see smbauth.lua.

smbusername

The SMB username to log in with. The forms "DOMAIN\username" and "username@DOMAIN" are not understood. To set a domain, use the smbdomain argument.

slaxml.debug

Debug level at which default callbacks will print detailed parsing info. Default: 3

http.host

The value to use in the Host header of all requests unless otherwise set. By default, the Host header uses the output of stdnse.get_hostname().

http.max-body-size

Limit the received body to specific number of bytes. An oversized body results in an error unless script argument http.truncated-ok or request option truncated_ok is set to true. The default is 2097152 (2MB). Use value -1 to disable the limit altogether. This argument can be overridden case-by-case with request option max_body_size.

http.max-cache-size

The maximum memory size (in bytes) of the cache.

http.max-pipeline

If set, it represents the number of outstanding HTTP requests that should be sent together in a single burst. Defaults to http.pipeline (if set), or to what function get_pipeline_limit returns.

http.pipeline

If set, it represents the number of HTTP requests that'll be sent on one connection. This can be set low to make debugging easier, or it can be set high to test how a server reacts (its chosen max is ignored).

http.truncated-ok

Do not treat oversized body as error. (Use response object flag truncated to check if the returned body has been truncated.) This argument can be overridden case-by-case with request option truncated_ok.

http.useragent

The value of the User-Agent header field sent with requests. By default it is "Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)". A value of the empty string disables sending the User-Agent header field.

- - -
To use these script arguments, add them to the Nmap command line using the --script-args arg1=value,[arg2=value,..] syntax. For example:

nmap --script=http-wordpress-enum --script-args http-wordpress-enum.check-latest=value,http-wordpress-enum.root=value <target>

Http-wordpress-enum NSE Script Example Usage


Here's an example of how to use the http-wordpress-enum.nse script:

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

nmap --script http-wordpress-enum --script-args check-latest=true,search-limit=10 <target>

nmap --script http-wordpress-enum --script-args type="themes" <target>

Http-wordpress-enum NSE Script Example Output


Here's a sample output from the http-wordpress-enum.nse script:

PORT   STATE SERVICE
80/tcp open  http
| http-wordpress-enum:
| Search limited to top 100 themes/plugins
|   plugins
|     akismet
|     contact-form-7 4.1 (latest version:4.1)
|     all-in-one-seo-pack  (latest version:2.2.5.1)
|     google-sitemap-generator 4.0.7.1 (latest version:4.0.8)
|     jetpack 3.3 (latest version:3.3)
|     wordfence 5.3.6 (latest version:5.3.6)
|     better-wp-security 4.6.4 (latest version:4.6.6)
|     google-analytics-for-wordpress 5.3 (latest version:5.3)
|   themes
|     twentytwelve
|_    twentyfourteen

Http-wordpress-enum NSE Script Example XML Output


Here's a sample XML output from the http-wordpress-enum.nse script produced by providing the -oX <file> Nmap option:

 <table key="google-analytics-for-wordpress">
 <elem key="installation_version">5.1</elem>
 <elem key="latest_version">5.3</elem>
 <elem key="name">google-analytics-for-wordpress</elem>
 <elem key="path">/wp-content/plugins/google-analytics-for-wordpress/</elem>
 <elem key="category">plugins</elem>
 </table>
 <table key="twentytwelve">
 <elem key="category">themes</elem>
 <elem key="path">/wp-content/themes/twentytwelve/</elem>
 <elem key="name">twentytwelve</elem>
 </table>
 <elem key="title">Search limited to top 100 themes/plugins</elem>

Authors


  • Ange Gutek
  • Peter Hill
  • Gyanendra Mishra
  • Paulino Calderon

References


See Also


Related NSE scripts to the http-wordpress-enum.nse script:

Visit Nmap NSE Library for more scripts.

The http-wordpress-enum.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

Couldn't find wp-themes.lst in /nselib/data/


Here is a relevant code snippet related to the "Couldn't find wp-themes.lst in /nselib/data/" error message:

161:	  local wp_plugins_file = nmap.fetchfile("nselib/data/wp-plugins.lst")
162:	
163:	  if operation_type_arg == "themes" or operation_type_arg == "all" then
164:	    local theme_db = existence_check_assign(wp_themes_file)
165:	    if not theme_db then
166:	      return false, "Couldn't find wp-themes.lst in /nselib/data/"
167:	    else
168:	      file['themes'] = theme_db
169:	    end
170:	  end
171:	  if operation_type_arg == "plugins" or operation_type_arg == "all" then

Couldn't find wp-plugins.lst in /nselib/data/


Here is a relevant code snippet related to the "Couldn't find wp-plugins.lst in /nselib/data/" error message:

169:	    end
170:	  end
171:	  if operation_type_arg == "plugins" or operation_type_arg == "all" then
172:	    local plugin_db = existence_check_assign(wp_plugins_file)
173:	    if not plugin_db then
174:	      return  false, "Couldn't find wp-plugins.lst in /nselib/data/"
175:	    else
176:	      file['plugins'] = plugin_db
177:	    end
178:	  end
179:	

WP root directory: wp_autoroot was unable to find a WP content dir (root page returns %d).


Here is a relevant code snippet related to the "WP root directory: wp_autoroot was unable to find a WP content dir (root page returns %d)." error message:

199:	      wp_autoroot = string.match(target_index.body, "http://[%w%-%.]-/([%w%-%./]-)wp%-content")
200:	      if wp_autoroot then
201:	        wp_autoroot = "/" .. wp_autoroot
202:	        stdnse.debug(1,"WP root directory: %s", wp_autoroot)
203:	      else
204:	        stdnse.debug(1,"WP root directory: wp_autoroot was unable to find a WP content dir (root page returns %d).", target_index.status)
205:	      end
206:	    end
207:	  end
208:	
209:	  --build a table of both directories to brute force and the corresponding WP resources' name

Version


This page has been created based on Nmap version 7.92.

Go back to menu.