WordPress Scan#
This is a method of detecting and managing vulnerabilities in WordPress (core, plugins, and themes) on a Linux server. The scanner installed on the server collects the WordPress configuration.
| Item | Description |
|---|---|
| Target | The core, plugins, and themes of WordPress set up on Linux |
| Prerequisites | The scanner for "Server OS Scan", a WPScan API Token, the wp command (WP-CLI) on the scan target server, and additional scanner and sudoers configuration (see "Configuration Method") |
| Registration destination | The server registered by the scanner |
| Update timing | The scanner updates it automatically once a day |
It utilizes the vulnerability database from "wpscan.com," which holds information on over 20,000 WordPress-related vulnerabilities. It is a non-destructive scan that does not perform simulated attacks.
Configuration Method#
Configure WordPress scanning in the following order.
- Obtaining a WPScan API Token and Registering it in FutureVuls
- Scanner Configuration
- Adding Configuration to sudoers on the Scan Target Server
- Executing the Scan
What you write in the scanner configuration (step 2) differs by purpose. scanModules is a setting that selects the processing the scanner runs, and if you omit it, all processing is enabled (see "Scanner Settings > Scan Modules"). It is a separate setting from scanMode, which specifies whether root privileges are used during a scan.
| Purpose | scanModules setting |
Number of server definitions | Example |
|---|---|---|---|
| Manage OS packages and WordPress as the same server | Omit it | 1 | Scanner Configuration |
| Manage only WordPress (OS packages are not scanned) | ["wordpress"] |
1 | Scanning Only WordPress |
| Manage multiple WordPress sites | ["wordpress"] |
1 per site | Scanning Multiple WordPress Sites |
| Manage OS packages and WordPress as separate servers | Omit it in the definition for the OS, and specify ["wordpress"] in the definition for WordPress |
2 (one for the OS and one for WordPress) | Managing OS Packages and WordPress as Separate Servers |
Each server definition ([servers.<name>]) is registered as one server in FutureVuls.
Obtaining a WPScan API Token and Registering it in FutureVuls#
-
Register an account on "wpscan.com" and obtain an API Token.
-
Open FutureVuls, go to the WordPress Vulnerability Database API card under
Group Settings > Advanced Settings > External Integration > External Integration, and register the API Token you just obtained.


- If you check "Include Inactive Plugins," vulnerabilities in plugins and themes that are deactivated in WordPress will also be detected.
- If unchecked, deactivated plugins and themes are excluded from detection (the WordPress core is always included).
- To change the "Include Inactive Plugins" setting after registration, delete the wpscan configuration and then re-register it.
- FutureVuls consumes 1 API call per WordPress core, plugin, or theme scanned.
- The API limit varies depending on the type of wpscan.com plan.
- If you exceed the wpscan.com API limit, a separate paid contract with wpscan.com is required.
- FutureVuls does not act as a reseller for wpscan.com. Please purchase a plan directly from wpscan.com.
Scanner Configuration#
Edit the scanner configuration file /opt/vuls-saas/config.toml. Add the four lines of [servers.<name>.wordpress] to the existing server definition created at installation ([servers.dev] in the example below; for the dev part, use the name written in your existing configuration file as is). Do not change the existing content from [servers.dev] through [servers.dev.uuids].
With this configuration, both OS packages and WordPress will be scanned.
[servers]
[servers.dev]
user = "vuls-saas"
host = "localhost"
port = "local"
scanMode = ["fast-root"]
[servers.dev.uuids]
dev = "xxxx-xxxx-xxxx-xxxx"
[servers.dev.wordpress]
cmdPath = "/usr/local/bin/wp"
osUser = "wordpress"
docRoot = "/home/kusanagi/wp/DocumentRoot/"
- For
cmdPath, specify the absolute path to thewpcommand.- Command to check the absolute path:
which wp
- Command to check the absolute path:
- For
osUser, specify a user who can execute thewpcommand. - For
docRoot, specify the DocumentRoot of WordPress (the directory where WordPress is installed). The scanner passes this value to--pathof thewpcommand.
Adding Configuration to sudoers on the Scan Target Server#
On the scan target server, the scanner switches from the user who runs the scan to osUser with sudo -u <osUser> -i and runs the wp command. For this reason, the user who runs the scan must be able to run sudo without a password.
The following two users are involved.
| Configuration location | User to specify | Role | Value in the configuration example above |
|---|---|---|---|
user in [servers.<name>] of config.toml, and the beginning of the sudoers line (<scan-user>) |
The user who runs the scan | The side that runs sudo. The target to which sudoers grants permission |
vuls-saas |
osUser in [servers.<name>.wordpress] of config.toml |
A user who can run the wp command |
The user that sudo -u switches to. The wp command is run as this user |
wordpress |
Add the following configuration to /etc/sudoers.d/vuls-saas on the scan target server where WordPress is running. Replace <scan-user> at the beginning of the line with the user who runs the scan (vuls-saas in the configuration example above). Replace only the <osUser> in ALL=(<osUser>) with the user specified in osUser (wordpress in the configuration example above), and keep the parentheses (for example, ALL=(wordpress)).
If you set the target user to (ALL), the user who runs the scan can run commands as any user, including root. Always restrict it to osUser.
If the path of the wp command differs from /usr/local/bin/wp, modify it to match your environment.
<scan-user> ALL=(<osUser>) NOPASSWD:SETENV: /bin/bash -c /usr/local/bin/wp cli *, /bin/bash -c /usr/local/bin/wp core *, /bin/bash -c /usr/local/bin/wp theme *, /bin/bash -c /usr/local/bin/wp plugin *
When the Vuls scanner is updated, /etc/sudoers.d/vuls-saas may be overwritten, which could cause an error on the next scan. Please be aware that you will need to edit /etc/sudoers.d/vuls-saas again after updating the Vuls scanner.
Executing the Scan#
To apply the settings immediately, run the scanner manually by following "Scanner Execution and Scheduling > Linux".
Scanning Only WordPress#
Edit /opt/vuls-saas/config.toml and specify scanModules = ["wordpress"].
With this configuration, OS packages will not be scanned.
[servers]
[servers.dev]
user = "vuls-saas"
host = "localhost"
port = "local"
scanModules = ["wordpress"]
[servers.dev.uuids]
dev = "xxxx-xxxx-xxxx-xxxx"
[servers.dev.wordpress]
cmdPath = "/usr/local/bin/wp"
osUser = "wordpress"
docRoot = "/home/kusanagi/wp/DocumentRoot/"
Scanning Multiple WordPress Sites#
Edit /opt/vuls-saas/config.toml as follows and add a server definition for each site. Each site is registered as a separate server in FutureVuls. In the example below, every definition has scanModules = ["wordpress"], so OS packages are not scanned. To also scan OS packages, keep a separate server definition for the OS that omits scanModules, as in "Managing OS Packages and WordPress as Separate Servers". Generate the UUID of each server definition you add with a command such as uuidgen.
[servers]
[servers.dev]
user = "vuls-saas"
host = "localhost"
port = "local"
scanModules = ["wordpress"]
[servers.dev.uuids]
dev = "xxxx-xxxx-xxxx-xxxx"
[servers.dev.wordpress]
cmdPath = "/usr/local/bin/wp"
osUser = "wordpress"
docRoot = "/home/kusanagi/wp/DocumentRoot/"
## Assign a unique name within config.toml (here we use YYYY)
[servers.YYYY]
user = "vuls-saas"
host = "localhost"
port = "local"
scanModules = ["wordpress"]
## Change the UUID to ensure it is unique
[servers.YYYY.uuids]
YYYY = "yyyy-yyyy-yyy-yyyy"
## Change to the name assigned above (YYYY)
[servers.YYYY.wordpress]
cmdPath = "/usr/local/bin/wp"
osUser = "wordpress"
docRoot = "/home/kusanagi/wp/DocumentRoot2/"
Managing OS Packages and WordPress as Separate Servers#
To manage them as "separate servers" on the FutureVuls screen, edit /opt/vuls-saas/config.toml as follows to split the server definitions.
[servers]
# dev is for managing OS package vulnerabilities on FutureVuls
[servers.dev]
user = "vuls-saas"
host = "localhost"
port = "local"
[servers.dev.uuids]
dev = "xxxx-xxxx-xxxx-xxxx"
# ZZZZ is for WordPress
[servers.ZZZZ]
user = "vuls-saas"
host = "localhost"
port = "local"
scanModules = ["wordpress"]
[servers.ZZZZ.uuids]
ZZZZ = "zzzz-zzzz-zzzz-zzzz"
[servers.ZZZZ.wordpress]
cmdPath = "/usr/local/bin/wp"
osUser = "wordpress"
docRoot = "/home/kusanagi/wp/DocumentRoot/"
Troubleshooting#
Check the common causes and fixes on the following pages.