——
LabLABS

Scan your own WordPress site safely with WPScan and OWASP ZAP

A controlled, evidence-led lab for checking a WordPress site you own: start passively, use WPScan without credential attacks, run a ZAP baseline scan, verify findings, fix, rescan and preserve proof.

A controlled, evidence-led lab for checking a WordPress site you own: start passively, use WPScan without credential attacks, run a ZAP baseline scan, verify findings, fix, rescan and preserve proof.

WordPressWPScanOWASP ZAPweb securityvulnerability management

Learning objectives

By the end of this lab you will have a dated, reproducible record of a site you own or are explicitly authorised to test; a low-impact WPScan inventory; a passive OWASP ZAP baseline report; and a small evidence pack showing what was found, fixed and retested. You will not attempt logins, password attacks, destructive actions or testing outside the written scope.

Tested examples: WPScan 3.8.28 (Ruby gem or official container) and OWASP ZAP 2.16.1 baseline container. Re-check the current release notes before substituting a newer version.

Scope, permission and safe boundaries

Write down the target before opening a scanner:

Item Record
Target https://www.example.com (your WordPress site)
Owner and approval Name, ticket or email; include the time window
Allowed hostnames Exact hostname(s), including or excluding www
Excluded paths Payment, checkout, account, admin and production APIs unless specifically approved
Stop conditions Elevated error rate, WAF alerts, resource pressure, customer impact
Rollback contact [hosting contact] and [WordPress administrator]

A DNS name resolving to your server is not permission to test every service behind it. ZAP documents that active scanning is an attack and must not be used against applications you do not own. This lab starts with passive checks and deliberately leaves ZAP active scanning out.

Before the lab, take a verified backup or confirm a recent restore point. That is not permission to “test the restore” on production: use a staging copy for restore tests. Tell the hosting or WAF operator the source IP and window so a protective control is not silently weakened.

Prepare an evidence directory

On an administrator workstation, create a directory with restrictive permissions:

mkdir -p wordpress-scan-2026-10-30/{raw,reports,notes}
chmod 700 wordpress-scan-2026-10-30
cd wordpress-scan-2026-10-30
date -u +%FT%TZ | tee notes/started-utc.txt

Expected result: three subdirectories and a UTC timestamp. Keep raw tool output separate from your conclusions; it makes a later rescan comparable.

Record the public URL, WordPress version reported by the dashboard, installed plugin/theme inventory, backup identifier and WAF/CDN status in notes/scope.txt. Do not put passwords, API tokens or customer data in the directory.

Check the target without scanning it

First confirm that the intended HTTPS endpoint is reachable and identify redirects:

curl -I --max-time 15 https://www.example.com/ | tee raw/home-headers.txt
curl -I --max-time 15 https://www.example.com/wp-login.php | tee raw/login-headers.txt

A normal result is an HTTP/2 200 or a deliberate 301/302 redirect to the canonical host. A 403 may be a WAF response, not evidence that WordPress is secure or inaccessible. A timeout, TLS error or unexpected hostname is a stop condition: fix the scope or service issue before proceeding.

Install from official sources and protect the WPScan token

WPScan’s project documents Ruby and curl prerequisites, the gem install wpscan installation route, and its official container image. Prefer a package manager or container on a disposable admin workstation; do not install development dependencies on the production web server just to run a scan.

For the Ruby route:

gem install wpscan
wpscan --version | tee notes/wpscan-version.txt

For a container route, pin the image digest in your internal runbook after obtaining it from the official image registry. Do not copy a random command or image from a blog.

A WPScan API token enriches vulnerability results. Store it in a local secret manager or protected environment variable, not in shell history, a ticket or this article:

read -rsp "WPScan API token: " WPSCAN_API_TOKEN; echo
export WPSCAN_API_TOKEN

Expected result: no token is printed. If you use a shared shell, unset it at the end with unset WPSCAN_API_TOKEN.

Run a low-impact WPScan inventory

Use the exact approved URL. The default scan performs version detection, theme detection and interesting-findings discovery; avoid user enumeration, password attacks and aggressive plugin enumeration in this production-safe lab.

wpscan --url https://www.example.com/ \
  --api-token "$WPSCAN_API_TOKEN" \
  --format json \
  --output raw/wpscan.json

Expected result: a JSON file containing the target URL, detected WordPress/core/theme information and any version-linked vulnerability references. The tool may report “unknown version” or no vulnerabilities. Neither proves the site is safe: a WAF, custom paths, disabled readme files and incomplete fingerprints can reduce detection.

For a human-readable record, retain the terminal output as well:

wpscan --url https://www.example.com/ \
  --api-token "$WPSCAN_API_TOKEN" | tee reports/wpscan.txt

Interpretation:

  • Good: a current, inventoried component with no matching advisory in the report. Confirm it against the WordPress dashboard or deployment manifest.
  • Needs work: a named plugin/theme version with a vendor or WPScan database reference. Verify the installed version before changing anything.
  • Unclear: “version not determined”, “not found” or an HTTP error. Treat it as a visibility limitation, not a clean result.

Do not turn on --enumerate u or brute-force options for this lab. They add account-discovery and authentication traffic without being required to establish patch posture.

Run an OWASP ZAP baseline scan first

ZAP’s passive scanner examines messages proxied or sent through ZAP. The Docker baseline scan is a practical way to collect passive findings without selecting active rules.

Create a short rules file so informational alerts are recorded but do not automatically fail the lab:

cat > zap-rules.tsv <<'EOF'
10020	IGNORE	(X-Frame-Options Header Not Set)
10021	IGNORE	(X-Content-Type-Options Header Missing)
EOF

docker run --rm -t \
  -v "$PWD":/zap/wrk:rw \
  ghcr.io/zaproxy/zaproxy:stable \
  zap-baseline.py -t https://www.example.com/ \
  -r reports/zap-baseline.html \
  -J reports/zap-baseline.json \
  -c /zap/wrk/zap-rules.tsv

Expected result: reports/zap-baseline.html and JSON evidence. Review the output before changing any ignore rule. The examples above are not a recommendation to suppress missing security headers permanently; they merely demonstrate that policy needs an explicit, reviewable decision. Remove an ignore after fixing a header and rerun the scan.

If Docker cannot reach the target, do not bypass a corporate proxy or WAF. Record the error, agree an approved route with the service owner, then rerun. If the baseline scan produces load, errors or user-visible impact, stop it, preserve the logs and notify the rollback contact.

Triage without mistaking a finding for exploitation

Create one row per finding:

Finding What it proves What it does not prove Next check
Detected plugin version The public site exposed a fingerprint The plugin is definitely installed, reachable or exploitable Confirm in WordPress admin and vendor advisory
Missing response header The sampled response lacked that header A practical vulnerability exists Check routes, CDN/WAF policy and application behaviour
Cookie flag alert A sampled cookie missed an attribute Every session is exposed Identify cookie purpose, origin and HTTPS behaviour
No alerts The configured scan did not flag a known issue The site has no vulnerabilities Review inventory, logs and change history

For any CVE or advisory, use the plugin/theme vendor’s advisory as the decision source. Compare affected and fixed versions with the locally installed version, check whether the vulnerable feature is enabled and whether the affected route is exposed. Do not try an exploit to settle the question.

Fix, contain and roll back safely

Prioritise confirmed, internet-exposed and actively used components. Use a maintenance window for updates that can change templates, payment flows or caching.

  1. Capture the pre-change plugin/theme list, backup ID and scan reports.
  2. Update in staging first where possible; test the homepage, login, contact form, checkout and scheduled jobs relevant to the site.
  3. Deploy the smallest approved change to production.
  4. If customer impact or error rates rise, stop further changes and restore the previous known-good release or host snapshot under [change owner]’s decision.
  5. Preserve logs and the failed deployment identifier before rollback; a rollback can erase useful evidence.

For a header finding, change the responsible layer—application, web server or CDN—rather than adding contradictory settings in all three. Validate on an authenticated and unauthenticated route where relevant.

Rescan and close the lab

Repeat the same WPScan and ZAP commands, but use new filenames and retain both runs:

wpscan --url https://www.example.com/ \
  --api-token "$WPSCAN_API_TOKEN" \
  --format json --output raw/wpscan-after.json

docker run --rm -t -v "$PWD":/zap/wrk:rw \
  ghcr.io/zaproxy/zaproxy:stable \
  zap-baseline.py -t https://www.example.com/ \
  -r reports/zap-baseline-after.html \
  -J reports/zap-baseline-after.json

Completion means: the approved target was scanned; results were reviewed against the live inventory; confirmed fixes were tested; unresolved findings have an owner and due date; and pre-/post-change evidence is stored in the approved location. Remove local copies from a shared workstation according to your retention policy, then unset the token:

unset WPSCAN_API_TOKEN

Troubleshooting

  • WPScan reports an unrecognised WordPress version: confirm the URL, canonical redirect and WAF behaviour; compare with the administrator dashboard rather than forcing a more aggressive scan.
  • ZAP baseline exits non-zero: open the HTML report and distinguish policy warnings from connectivity failures. Do not mark the run successful solely because a report file exists.
  • A suspected vulnerable plugin is inactive: record that status, but still apply the vendor’s supported update or remove it after a backup; inactive code can become active during recovery or migration.
  • The site becomes slow: stop the scan, check hosting and WAF logs, and resume only after the owner agrees a safer rate/window.

This lab complements the WordPress hardening work on admin access, updates, backups and logs. Use its evidence pack as input to a web-server compromise playbook: preserve logs before making broad cleanup changes, and involve the hosting provider early if compromise is suspected.

References

  1. WPScan, “WPScan CLI Scanner Install + User Guide”, accessed 2026-10-29: https://wpscan.com/wordpress-cli-scanner/
  2. WPScan project, installation, update and usage documentation, accessed 2026-10-29: https://github.com/wpscanteam/wpscan
  3. OWASP ZAP, “Active Scan” (scope and safety warning), accessed 2026-10-29: https://www.zaproxy.org/docs/desktop/start/features/ascan/
  4. OWASP ZAP, “Passive Scan”, accessed 2026-10-29: https://www.zaproxy.org/docs/desktop/start/features/pscan/
  5. OWASP ZAP, Docker baseline scan documentation, accessed 2026-10-29: https://www.zaproxy.org/docs/docker/baseline-scan/