WPScan Security Lab 1.0 — Part 1
Every time I look at technology news lately, there’s another security problem.
Someone’s database has been compromised. Another company discovers attackers have been poking around its systems for months. AI is making some attacks easier to automate, and software vulnerabilities keep turning up in applications that businesses depend on every day.
Meanwhile, the average small-business owner just wants their website to work.
They don’t want to become cybersecurity experts. They want their contact forms to deliver messages, their online stores to accept orders, and their websites to stay online.
Unfortunately, the bad guys don’t particularly care how small your business is.
And WordPress, being one of the world’s most widely used website platforms, attracts plenty of unwanted attention.
Yet Another Business Aggravation
I’ve spent a fair amount of time building and maintaining WordPress websites. Between plugins, themes, PHP versions, hosting configurations, and the occasional mysterious error message, there’s already plenty to keep track of.
Security adds another layer to the aggravation.
You install security software. You update plugins. You put Cloudflare in front of your website. You keep backups.
But how do you know what your website is actually exposing to the outside world?
And how do you investigate it without causing an entirely new set of problems?
I certainly don’t want to point an aggressive security scanner at a production website and have my hosting provider wondering why I’m apparently attacking my own account.
So I decided to build a laboratory.
A local WordPress installation running on my Linux workstation, where I can inspect the website, experiment with security tools, and eventually test copies of real websites without hammering the production servers.
We’re calling it WPScan Security Lab 1.0.
And because this is the Business Aggravations series, I’m going to document how to build it.
What We’re Building
The first version is deliberately simple.
We’re using Docker to run a clean WordPress installation with a MariaDB database. Then we’re running WPScan, a WordPress security scanner, in another temporary Docker container.
Our setup uses Linux Mint as the host operating system, Docker Compose to manage the containers, WordPress with PHP 8.4 and Apache, MariaDB 11.4 for storage, and WPScan for security inspection.
We’re starting with a fresh WordPress installation, not a clone of a production site. That will come later.
Our WordPress instance will be available at:
http://127.0.0.1:8092
That address is important. It refers to the local computer, not a public website.
The lab will be accessible from the host machine, but its web port won’t be published to the local network or the Internet.
This particular setup is intended for a Linux machine with Docker Engine and the Docker Compose plugin already installed.
Step 1: Create the Project Directory
My primary development workstation is named Proteus. I’ve been using it for local WordPress development, so Docker is already available.
I created a dedicated project directory:
mkdir -p ~/Workspace/WPScanLab/reports
cd ~/Workspace/WPScanLab
That gives us a place to keep our Docker configuration and the reports produced by our scans.
On my machine, the complete project path is:
/home/john/Workspace/WPScanLab
Nothing fancy here. I want the project to be easy to understand, back up, and recreate.
Step 2: Create the Docker Compose Configuration
Inside our project directory, create a file named compose.yaml.
nano compose.yaml
Here is our starting configuration:
name: wpscan-lab
services:
db:
image: mariadb:11.4
environment:
MARIADB_ROOT_PASSWORD: local-lab-root-only
MARIADB_DATABASE: wordpress
MARIADB_USER: wordpress
MARIADB_PASSWORD: local-lab-only
volumes:
- db_data:/var/lib/mysql
wordpress:
image: wordpress:php8.4-apache
depends_on:
- db
ports:
- "127.0.0.1:8092:80"
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: local-lab-only
WORDPRESS_DB_NAME: wordpress
WORDPRESS_CONFIG_EXTRA: |
define('DISABLE_WP_CRON', true);
define('DISALLOW_FILE_EDIT', true);
volumes:
- wp_data:/var/www/html
volumes:
db_data:
wp_data:
A few things are worth pointing out.
The MariaDB database and WordPress files are stored in persistent Docker volumes. Restarting the containers won’t automatically erase our installation.
WordPress connects to the database using Docker’s internal networking, so there is no need to publish the database port to the host.
We’re also disabling WordPress’s built-in file editor and automatic WP-Cron execution for this lab.
The most important line is:
- "127.0.0.1:8092:80"
This binds the WordPress web server to the host’s loopback interface instead of exposing it on every network interface.
The passwords in this example are disposable laboratory credentials. They are intentionally simple because this is a local, non-production installation. Do not reuse them on an Internet-accessible system, and don’t put sensitive customer data into this lab.
Step 3: Start WordPress
Before starting the containers, check the configuration:
sudo docker compose config --quiet
If Docker finds a configuration problem, it should tell us. Otherwise, no news is good news.
Now start the lab:
sudo docker compose up -d
Docker downloads the required images if they aren’t already installed, creates the necessary network and storage volumes, and starts the containers.
To check their status:
sudo docker compose ps
On Proteus, our two services came up successfully:
wpscan-lab-db-1
wpscan-lab-wordpress-1
Our WordPress container was mapped to 127.0.0.1:8092.
We’re in business.
Step 4: Install WordPress
Open a browser and visit:
http://127.0.0.1:8092
You should see the familiar WordPress installation screen.
Choose your language, give the installation a name such as WPScan Lab 1.0, and create an administrator account.
I used labadmin as the suggested account name, along with a unique test password and a non-deliverable email address:
admin@wpscanlab.invalid
Because we’re using this installation for security testing, there’s no reason to connect it to real customer email accounts or business services.
Once WordPress finishes installing, log in and make sure the dashboard loads.
At this point, we have a working, clean WordPress installation running locally.
Now comes the interesting part.
Step 5: Get WPScan Running
WPScan is a command-line tool designed to examine WordPress installations for security-relevant information.
It can discover WordPress versions, identify installed plugins and themes, and look for exposed backup or configuration files.
With access to its vulnerability database API, it can also associate discovered software versions with publicly reported vulnerabilities.
Rather than installing WPScan and its dependencies directly onto my Linux workstation, I’m running the official Docker image.
Here’s how we checked it:
sudo docker run --rm \
wpscanteam/wpscan:latest \
--version
The first execution downloads the WPScan image.
That takes a little longer than subsequent runs, especially if several image layers need to be transferred.
Once the version command runs, WPScan is ready.
No additional Ruby setup on the host. No collection of dependencies to maintain.
One more aggravation avoided.
Step 6: Run Our First Security Scan
Now we’re ready to scan the local WordPress installation.
From our project directory:
cd ~/Workspace/WPScanLab
Run:
sudo docker run --rm \
--network host \
--mount type=bind,source="$PWD/reports",target=/reports \
wpscanteam/wpscan:latest \
--url http://127.0.0.1:8092 \
--enumerate ap,at,cb,dbe \
--plugins-detection mixed \
--format json \
--output /reports/baseline.json
That’s a rather impressive-looking command, so here’s what it’s doing.
--network host allows the WPScan container to use the Linux host’s network, making our local WordPress installation reachable at 127.0.0.1:8092. This command is specifically for Docker Engine on Linux.
The --mount option makes our local reports directory available inside the scanner container. Without that, the report could disappear when the temporary container is removed.
The --url option identifies the WordPress website we’re examining.
The --enumerate options tell WPScan what to investigate:
ap— Installed pluginsat— Installed themescb— Configuration backup filesdbe— Database export files
The --plugins-detection mixed setting enables more thorough plugin discovery than passive detection alone.
Finally, --format json and --output tell WPScan to produce a machine-readable report.
Our intended report location is:
~/Workspace/WPScanLab/reports/baseline.json
This is our first baseline scan. It isn’t a password-cracking exercise or an attempt to exploit anything.
We’re simply asking the scanner to inspect our own local WordPress installation and report what it discovers.
Is It Still Running?
This particular scan may take a while.
Enumerating all plugins using mixed detection can generate substantial numbers of checks, even on a relatively simple installation.
Also, because we’re writing JSON output to a file, don’t assume a quiet terminal means the scanner has stopped.
If you’re curious about what Docker is doing, open another terminal and run:
sudo docker ps
And to examine current container resource usage:
sudo docker stats --no-stream
When the scan finishes, check the report directory:
ls -lh reports/
A completed baseline.json should contain the scan’s findings. We’ll save interpreting those findings for Part 2.
One important limitation: WPScan can perform discovery without an API token, but it requires access to the WPScan vulnerability API to display associated vulnerability records. A scan that reports no vulnerabilities without an API token is not proof that the website is secure.
What Have We Accomplished?
We’ve gone from an empty project directory to a working local WordPress website and launched our first security scan.
The web application runs inside Docker. Its database isn’t publicly exposed. The web server listens only on our local machine. And the scanner has somewhere to save its findings for later analysis.
We haven’t cloned a production website, configured the vulnerability API, or tried any aggressive security experiments yet.
That’s intentional.
I want to understand what the tools are doing before adding more complexity.
Our first objective is simply to build a reliable, repeatable environment where we can investigate WordPress security without disrupting a working business website.
And now we have one.
Coming Up: What Did WPScan Find?
In Part 2, we’ll examine the first scan report.
We’ll look at what WPScan discovers, what its warnings actually mean, and how to tell the difference between something that’s merely interesting and something that needs to be fixed.
Eventually, we’ll bring a sanitized copy of a real WordPress website into the lab and see how it holds up.
Because I’d rather discover a security problem myself, on my own equipment, than have someone on the other side of the world discover it for me.
Software should eliminate work, not manufacture more of it.
Security testing ought to follow that rule, too.
Part of the Business Aggravations series at johnbmcdonald.com.
References: WPScan documentation · WPScan on GitHub · Docker networking and published ports