WPScan
What is WPScan?
WPScan is a free, for non-commercial use, black box WordPress vulnerability scanner written for security professionals and blog maintainers to test the security of their sites.
NOTE: You need to provide WPSan with an API Token so that it can look up vulnerabilities infos with https://wpvulndb.com. Without the token WPScan will only identify WordPress Core / Plugin / Theme versions but not if they are actually vulnerable. You can get a free API Token at by registering for an account at https://wpvulndb.com. Using the secureCodeBox WPScans you can specify the token via the
WPVULNDB_API_TOKEN
target attribute, see the example below.
To learn more about the WPScan scanner itself visit wpscan.org or wpscan.io.
Deployment
The wpscan chart can be deployed via helm:
# Install HelmChart (use -n to configure another namespace)
helm upgrade --install wpscan secureCodeBox/wpscan
Scanner Configuration
The following security scan configuration example are based on the WPScan Documentation, please take a look at the original documentation for more configuration examples.
- Scan all plugins with known vulnerabilities:
wpscan --url example.com -e vp --plugins-detection mixed --api-token WPVULNDB_API_TOKEN
- Scan all plugins in our database (could take a very long time):
wpscan --url example.com -e ap --plugins-detection mixed --api-token WPVULNDB_API_TOKEN
- Password brute force attack:
wpscan --url example.com -e u --passwords /path/to/password_file.txt
- WPScan keeps a local database of metadata that is used to output useful information, such as the latest version of a plugin. The local database can be updated with the following command:
wpscan --update
- When enumerating the WordPress version, installed plugins or installed themes, you can use three different "modes", which are:
- passive
- aggressive
- mixed
If you want the most results use the "mixed" mode. However, if you are worried that the server may not be able to handle many requests, use the "passive" mode. The default mode is "mixed", except plugin enumeration, which is "passive". You will need to manually override the plugin detection mode, if you want to use anything other than the default, with the
--plugins-detection
option.
- WPScan can enumerate various things from a remote WordPress application, such as plugins, themes, usernames, backed up files wp-config.php files, Timthumb files, database exports and more. To use WPScan's enumeration capabilities supply the
-e
option.
Available Choices:
vp | Vulnerable plugins
ap | All plugins
p | Plugins
vt | Vulnerable themes
at | All themes
t | Themes
tt | Timthumbs
cb | Config backups
dbe | Db exports
u | User IDs range. e.g: u1-5
Range separator to use: '-'
Value if no argument supplied: 1-10
m | Media IDs range. e.g m1-15
Note: Permalink setting must be set to "Plain" for those to be detected
Range separator to use: '-'
Value if no argument supplied: 1-100
Separator to use between the values: ','
Default: All Plugins, Config Backups
Value if no argument supplied: vp,vt,tt,cb,dbe,u,m
Incompatible choices (only one of each group/s can be used):
- vp, ap, p
- vt, at, t
Requirements
Kubernetes: >=v1.11.0-0
Values
Key | Type | Default | Description |
---|---|---|---|
cascadingRules.enabled | bool | false | Enables or disables the installation of the default cascading rules for this scanner |
imagePullSecrets | list | [] | Define imagePullSecrets when a private registry is used (see: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
parser.affinity | object | {} | Optional affinity settings that control how the parser job is scheduled (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |
parser.env | list | [] | Optional environment variables mapped into each parseJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) |
parser.image.pullPolicy | string | "IfNotPresent" | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images |
parser.image.repository | string | "docker.io/securecodebox/parser-wpscan" | Parser image repository |
parser.image.tag | string | defaults to the charts version | Parser image tag |
parser.resources | object | { requests: { cpu: "200m", memory: "100Mi" }, limits: { cpu: "400m", memory: "200Mi" } } | Optional resources lets you control resource limits and requests for the parser container. See https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
parser.scopeLimiterAliases | object | {} | Optional finding aliases to be used in the scopeLimiter. |
parser.tolerations | list | [] | Optional tolerations settings that control how the parser job is scheduled (see: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
parser.ttlSecondsAfterFinished | string | nil | seconds after which the Kubernetes job for the parser will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |
scanner.activeDeadlineSeconds | string | nil | There are situations where you want to fail a scan Job after some amount of time. To do so, set activeDeadlineSeconds to define an active deadline (in seconds) when considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#job-termination-and-cleanup) |
scanner.affinity | object | {} | Optional affinity settings that control how the scanner job is scheduled (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |
scanner.backoffLimit | int | 3 | There are situations where you want to fail a scan Job after some amount of retries due to a logical error in configuration etc. To do so, set backoffLimit to specify the number of retries before considering a scan Job as failed. (see: https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy) |
scanner.env | list | [] | Optional environment variables mapped into each scanJob (see: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) |
scanner.extraContainers | list | [] | Optional additional Containers started with each scanJob (see: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) |
scanner.extraVolumeMounts | list | [] | Optional VolumeMounts mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/) |
scanner.extraVolumes | list | [] | Optional Volumes mapped into each scanJob (see: https://kubernetes.io/docs/concepts/storage/volumes/) |
scanner.image.pullPolicy | string | "IfNotPresent" | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images |
scanner.image.repository | string | "docker.io/securecodebox/scanner-wpscan" | Container Image to run the scan |
scanner.image.tag | string | nil | defaults to the charts appVersion |
scanner.nameAppend | string | nil | append a string to the default scantype name. |
scanner.podSecurityContext | object | {} | Optional securityContext set on scanner pod (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
scanner.resources | object | {} | CPU/memory resource requests/limits (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/, https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/) |
scanner.securityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["all"]},"privileged":false,"readOnlyRootFilesystem":false,"runAsNonRoot":false} | Optional securityContext set on scanner container (see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) |
scanner.securityContext.allowPrivilegeEscalation | bool | false | Ensure that users privileges cannot be escalated |
scanner.securityContext.capabilities.drop[0] | string | "all" | This drops all linux privileges from the container. |
scanner.securityContext.privileged | bool | false | Ensures that the scanner container is not run in privileged mode |
scanner.securityContext.readOnlyRootFilesystem | bool | false | Prevents write access to the containers file system |
scanner.securityContext.runAsNonRoot | bool | false | Enforces that the scanner image is run as a non root user |
scanner.suspend | bool | false | if set to true the scan job will be suspended after creation. You can then resume the job using kubectl resume <jobname> or using a job scheduler like kueue |
scanner.tolerations | list | [] | Optional tolerations settings that control how the scanner job is scheduled (see: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) |
scanner.ttlSecondsAfterFinished | string | nil | seconds after which the Kubernetes job for the scanner will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |
License
Code of secureCodeBox is licensed under the Apache License 2.0.
CPU architectures
The scanner is currently supported for these CPU architectures:
- linux/amd64
- linux/arm64
Examples
example.com
This example is only meant as a guideline for configuring wpscan. The example scan will fail as it uses example.com as a target, which isn't a valid wpscan target.
- Scan
- Findings
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
name: "wpscan-www.example.com"
spec:
scanType: "wpscan"
parameters:
- "--url"
- https://www.example.com
- "-e"
- "vp"
- "--plugins-detection"
- "mixed"
- "--api-token"
- "AAAAABBBBBCCCCCDDDDEEEEEEE"
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
{
"banner":
{
"description": "WordPress Security Scanner by the WPScan Team",
"version": "3.8.1",
"authors": ["@_WPScan_", "@ethicalhack3r", "@erwan_lr", "@firefart"],
"sponsor": "Sponsored by Automattic - https://automattic.com/",
},
"start_time": 1591480247,
"start_memory": 41349120,
"target_url": "https://www.example.com/",
"target_ip": "192.168.200.100",
"effective_url": "https://www.example.com/",
"interesting_findings":
[
{
"url": "https://www.example.com/",
"to_s": "Headers",
"type": "headers",
"found_by": "Headers (Passive Detection)",
"confidence": 100,
"confirmed_by": {},
"references": {},
"interesting_entries": ["Server: Apache/2.4.29 (Ubuntu)"],
},
{
"url": "https://www.example.com/robots.txt",
"to_s": "https://www.example.com/robots.txt",
"type": "robots_txt",
"found_by": "Robots Txt (Aggressive Detection)",
"confidence": 100,
"confirmed_by": {},
"references": {},
"interesting_entries": ["/wp-admin/", "/wp-admin/admin-ajax.php"],
},
{
"url": "https://www.example.com/readme.html",
"to_s": "https://www.example.com/readme.html",
"type": "readme",
"found_by": "Direct Access (Aggressive Detection)",
"confidence": 100,
"confirmed_by": {},
"references": {},
"interesting_entries": [],
},
{
"url": "https://www.example.com/wp-content/mu-plugins/",
"to_s": "This site has 'Must Use Plugins': https://www.example.com/wp-content/mu-plugins/",
"type": "mu_plugins",
"found_by": "Direct Access (Aggressive Detection)",
"confidence": 80,
"confirmed_by": {},
"references": {"url": ["http://codex.wordpress.org/Must_Use_Plugins"]},
"interesting_entries": [],
},
{
"url": "https://www.example.com/wp-cron.php",
"to_s": "The external WP-Cron seems to be enabled: https://www.example.com/wp-cron.php",
"type": "wp_cron",
"found_by": "Direct Access (Aggressive Detection)",
"confidence": 60,
"confirmed_by": {},
"references":
{
"url":
[
"https://www.iplocation.net/defend-wordpress-from-ddos",
"https://github.com/wpscanteam/wpscan/issues/1299",
],
},
"interesting_entries": [],
},
],
"version":
{
"number": "5.3.3",
"release_date": "2020-04-29",
"status": "latest",
"found_by": "Rss Generator (Passive Detection)",
"confidence": 100,
"interesting_entries":
[
"https://www.example.com/feed/, <generator>https://wordpress.org/?v=5.3.3</generator>",
"https://www.example.com/comments/feed/, <generator>https://wordpress.org/?v=5.3.3</generator>",
],
"confirmed_by": {},
"vulnerabilities": [],
},
"main_theme":
{
"slug": "twentyseventeen",
"location": "https://www.example.com/wp-content/themes/twentyseventeen/",
"latest_version": "2.3",
"last_updated": "2020-03-31T00:00:00.000Z",
"outdated": true,
"readme_url": "https://www.example.com/wp-content/themes/twentyseventeen/README.txt",
"directory_listing": false,
"error_log_url": null,
"style_url": "https://www.example.com/wp-content/themes/twentyseventeen/style.css?ver=5.3.3",
"style_name": "Twenty Seventeen",
"style_uri": "https://wordpress.org/themes/twentyseventeen/",
"description": "Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.",
"author": "the WordPress team",
"author_uri": "https://wordpress.org/",
"template": null,
"license": "GNU General Public License v2 or later",
"license_uri": "http://www.gnu.org/licenses/gpl-2.0.html",
"tags": "one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready",
"text_domain": "twentyseventeen",
"found_by": "Css Style In Homepage (Passive Detection)",
"confidence": 100,
"interesting_entries": [],
"confirmed_by":
{
"Css Style In 404 Page (Passive Detection)":
{"confidence": 70, "interesting_entries": []},
},
"vulnerabilities": [],
"version":
{
"number": "2.2",
"confidence": 80,
"found_by": "Style (Passive Detection)",
"interesting_entries":
[
"https://www.example.com/wp-content/themes/twentyseventeen/style.css?ver=5.3.3, Match: 'Version: 2.2'",
],
"confirmed_by": {},
},
"parents": [],
},
"plugins":
{
"akismet":
{
"slug": "akismet",
"location": "https://www.example.com/wp-content/plugins/akismet/",
"latest_version": "4.1.6",
"last_updated": "2020-06-04T17:21:00.000Z",
"outdated": false,
"readme_url": false,
"directory_listing": false,
"error_log_url": null,
"found_by": "Known Locations (Aggressive Detection)",
"confidence": 80,
"interesting_entries":
[
"https://www.example.com/wp-content/plugins/akismet/, status: 403",
],
"confirmed_by": {},
"vulnerabilities":
[
{
"title": "Akismet 2.5.0-3.1.4 - Unauthenticated Stored Cross-Site Scripting (XSS)",
"fixed_in": "3.1.5",
"references":
{
"cve": ["2015-9357"],
"url":
[
"http://blog.akismet.com/2015/10/13/akismet-3-1-5-wordpress/",
"https://blog.sucuri.net/2015/10/security-advisory-stored-xss-in-akismet-wordpress-plugin.html",
],
"wpvulndb": ["8215"],
},
},
],
"version": null,
},
},
"vuln_api":
{"plan": "free", "requests_done_during_scan": 4, "requests_remaining": 18},
"stop_time": 1591480342,
"elapsed": 94,
"requests_done": 2335,
"cached_requests": 9,
"data_sent": 631774,
"data_sent_humanised": "616.967 KB",
"data_received": 1093069,
"data_received_humanised": "1.042 MB",
"used_memory": 272867328,
"used_memory_humanised": "260.227 MB",
}
old-wordpress
This example scan uses a demo wordpress 4.0 instance.
You can deploy it as a demo target into you cluster. The scan assumes that it is installed in the demo-targets
namespace.
See the installation guide.
- Scan
- Findings
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
name: "wpscan-old-wordpress-internal"
spec:
scanType: "wpscan"
parameters:
- "--url"
- old-wordpress.demo-targets.svc.cluster.local
- "-e"
- "vp"
- "--plugins-detection"
- "mixed"
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0
[
{
"name": "WordPress Service",
"description": "WordPress Service Information",
"category": "WordPress Service",
"location": "http://old-wordpress.demo-targets.svc.cluster.local/",
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
"reference": {},
"confidence": 100,
"attributes":
{
"ip_address": "10.99.82.140",
"wpscan_version": "3.8.7",
"wpscan_requests": 4777,
"wp_version": "4.0.31",
"wp_release_date": "2020-06-10",
"wp_release_status": "latest",
"wp_interesting_entries":
[
"http://old-wordpress.demo-targets.svc.cluster.local/, Match: 'WordPress 4.0.31'",
],
"wp_found_by": "Meta Generator (Passive Detection)",
"wp_confirmed_by":
{
"Atom Generator (Aggressive Detection)":
{
"confidence": 80,
"interesting_entries":
[
'http://old-wordpress.demo-targets.svc.cluster.local/?feed=atom, <generator uri="https://wordpress.org/" version="4.0.31">WordPress</generator>',
],
},
},
"wp_vulnerabilities": [],
},
"id": "35e61c23-d525-4509-a024-d1aef37a1623",
},
{
"name": "WordPress finding 'headers'",
"description": "Headers",
"category": "WordPress headers",
"location": "http://old-wordpress.demo-targets.svc.cluster.local/",
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
"confidence": 100,
"reference": {},
"attributes":
{
"wp_interesting_entries":
["Server: nginx/1.7.7", "X-Powered-By: PHP/5.4.34-0+deb7u1"],
"wp_found_by": "Headers (Passive Detection)",
"wp_confirmed_by": {},
},
"id": "ca074030-2e55-4a10-bf8f-039c1b8978d9",
},
{
"name": "WordPress finding 'xmlrpc'",
"description": "XML-RPC seems to be enabled: http://old-wordpress.demo-targets.svc.cluster.local/xmlrpc.php",
"category": "WordPress xmlrpc",
"location": "http://old-wordpress.demo-targets.svc.cluster.local/xmlrpc.php",
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
"confidence": 100,
"reference": {},
"attributes":
{
"wp_interesting_entries": [],
"wp_found_by": "Direct Access (Aggressive Detection)",
"wp_confirmed_by": {},
},
"id": "9b521d88-4018-4069-971d-7a020eebab51",
},
{
"name": "WordPress finding 'readme'",
"description": "WordPress readme found: http://old-wordpress.demo-targets.svc.cluster.local/readme.html",
"category": "WordPress readme",
"location": "http://old-wordpress.demo-targets.svc.cluster.local/readme.html",
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
"confidence": 100,
"reference": {},
"attributes":
{
"wp_interesting_entries": [],
"wp_found_by": "Direct Access (Aggressive Detection)",
"wp_confirmed_by": {},
},
"id": "7160e807-b6bb-4994-9477-22cac8e2f549",
},
{
"name": "WordPress finding 'wp_cron'",
"description": "The external WP-Cron seems to be enabled: http://old-wordpress.demo-targets.svc.cluster.local/wp-cron.php",
"category": "WordPress wp_cron",
"location": "http://old-wordpress.demo-targets.svc.cluster.local/wp-cron.php",
"osi_layer": "APPLICATION",
"severity": "INFORMATIONAL",
"confidence": 60,
"reference": {},
"attributes":
{
"wp_interesting_entries": [],
"wp_found_by": "Direct Access (Aggressive Detection)",
"wp_confirmed_by": {},
},
"id": "828bf907-da73-4076-994b-a46652b1f972",
},
]