Commands / Attacking a web app

Attacking a web app

wpscan

Also wordpress scanner, cms enumeration, wordpress

Fingerprints a WordPress site and enumerates its version, users, themes and plugins against a known-vulnerability database.

WordPress is the same software on millions of sites, so a scanner that knows it can read a target's exact make-up. wpscan --url URL reads the version from the page's generator tag and readme, then --enumerate lists what is installed: u the user logins (from author archives and the wp-json REST API), p/vp/ap the plugins (popular / only-vulnerable / all), t the themes. Each find is matched against wpscan's local database of known issues. On an offline lab target that database is already baked in, so --no-update runs it without reaching the internet. --plugins-detection chooses how hard it looks: passive reads only what the home page reveals (fast, quiet), aggressive requests tens of thousands of known plugin paths (thorough, slow and loud) — reach for passive first. Knowing the version, the users and a weak plugin is the whole opening move against a known CMS.

wpscan command usage

wpscan --url URL [--no-update] [--enumerate u,p,vp,ap,t] [--plugins-detection passive|mixed|aggressive] [--random-user-agent] [--disable-tls-checks]
wpscan --help

Options

--url http://10.0.1.20/wordpress/
the WordPress site to scan (the trailing slash is its base path)
--no-update
use the database already on disk instead of fetching one: the lab target has no internet
--enumerate u
enumerate user logins, from author archives and the wp-json REST API
--enumerate p
enumerate plugins (p popular, vp only vulnerable, ap all; t for themes)
--plugins-detection passive
find plugins only from what the home page references: fast and quiet (aggressive probes thousands of paths)
--random-user-agent
vary the User-Agent so the scan is less obviously wpscan
--disable-tls-checks
accept any TLS certificate (for an https target)

wpscan examples

wpscan --url http://10.0.1.20/wordpress/ --no-update
Fingerprints the site: its WordPress version, from the generator tag and readme.
[+] WordPress version 5.8 identified (Insecure, released on 2021-07-20).
wpscan --url http://10.0.1.20/wordpress/ --no-update --enumerate u
Lists the user logins, from the author archives and the wp-json REST API.
[+] admin
[+] editor
[i] 3 user(s) Identified.
wpscan --url http://10.0.1.20/wordpress/ --no-update --enumerate p --plugins-detection passive
Names the plugins the home page references, without probing thousands of paths.
[+] wp-easy-contact-form
[i] 1 plugin(s) Identified.

Pitfalls

  • Scan Aborted: Update required means no database on disk; the lab's image has one baked in, so add --no-update.
  • --enumerate ap (all plugins, aggressive) sends tens of thousands of requests and takes minutes; --plugins-detection passive finds a referenced plugin in seconds.
  • wpscan reports a plugin's version only once it can read its readme (aggressive); a passive find names the plugin but may leave the version undetermined.

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start learning