WPScan – A Black Box WordPress Vulnerability Scanner

[‘

n

WordPress is all over the web; it’s the most popular and most used content management system (CMS) out there. Is your website or blog is powered by WordPress? Did you know that malicious hackers are always attacking WordPress sites every minute? If you didn’t, now you know.

n

The first step towards securing your website or blog is to perform a vulnerability assessment. This is simply an operation to identify common security loopholes (known to the public), within your site or its underlying architecture.

n

Read Also: WPSeku – A Vulnerability Scanner to Find Security Issues in WordPress

n

In this article, we will show you how to install and use the WPScan, a free scanner created for security professionals and website maintainers to test the security of their websites.

n

How to Install WPScan in Linux Systems

n

The recommended way of installing and running WPScan is to use the official Docker image, this will help you do away with installation problems (typically dependency issues).

n

You should have Docker installed and running on your system, otherwise start by installing it using the following, which will use the cURL program to download and run a shell script that will add the Docker repository to your system and install the needed packages.

n

$ sudo curl -fsSL https://get.docker.com | shrn

n

Once the Docker is successfully installed, start the service, enable it to auto-start at system boot time and check if it’s up and running as follows.

n

# sudo systemctl start dockerrn# sudo systemctl enable dockerrn# sudo systemctl status dockerrn

n

Next, pull the WPScan Docker image using the following command.

n

$ docker pull wpscanteam/wpscanrn

n

Download WPScan Docker Image
Download WPScan Docker Image

n

Once WPScan Docker image downloaded, you can list the Docker images on your system using following command.

n

$ docker imagesrn

n

List Docker Images
List Docker Images

n

Looking at the output from the following screesnhot, the WPScan repository image is wpscanteam/wpscan which you will use in the next section.

n

How to Perform WordPress Vulnerability Scan Using WPScan

n

The simplest way of performing a vulnerability scan using WPScan is to provide your WordPress website’s URL as shown (replace www.example.com with your site’s URL).

n

$ docker run wpscanteam/wpscan --url www.example.comrn

n

WPScan will try to find interesting HTTP headers such as SERVER (web server type and version) and X-POWERED-BY (PHP version); it will also look for any exposed APIs, RSS feed link and users.

n

Then it will go on to enumerate the WordPress version and checks if it is up to date or if there are any vulnerabilities associated with the detected version number. In addition, it will try to detect the theme as well as installed plugins to find it they are up to date.

n

Scan WordPress for Vulnerabilities
Scan WordPress for Vulnerabilities

n

You can perform a wordlist password brute force on enumerated users using 30 threads using the followin command. The --wordlist and --threads flags to specify the wordlist and set the number of threads receptively.

n

$ docker run wpscanteam/wpscan --url www.example.com --wordlist wordlist_file.txt --threads 30rn

n

To carry out a wordlist password brute force on the “admin” username only, run the following command.

n

$ docker run wpscanteam/wpscan --url www.example.com --wordlist wordlist_file.txt --username adminrn

n

Alternatively, you can mount a local wordlist on your system to the docker container and start a bruteforce attack for user admin.

n

$ docker run -it --rm -v ~/wordlists:/wordlists wpscanteam/wpscan --url www.example.com --wordlist /wordlists/wordlist_file.txt --username adminrn

n

To enumerate installed plugins, run the following command.

n

$ docker run wpscanteam/wpscan --url www.example.com --enumerate prn

n

If enumerating installed plugins is not be enough, you can run all enumeration tools as shown.

n

$ docker run wpscanteam/wpscan --url www.example.com --enumeratern

n

To enable output debugging, use the --debug-ouput flag, and redirect the output into a file for later analysis.

n

$ docker run wpscanteam/wpscan --url www.example.com --debug-output 2>debug.logrn

n

Last but not least, you can update WPScan’s database to the latest version by executing the following command.

n

$ docker run wpscanteam/wpscan --updatern

n

You can view the Docker and WPScan help messages with these commands.

n

$ docker -h  rn$ docker run wpscanteam/wpscan -hrn

n

WPScan Github repository: https://github.com/wpscanteam/wpscan

n

That’s all for now! WPScan is a powerful black box WordPress vulnerability scanner that you should have in your arsenal of web security tools. In this guide, we showed how to install and use WPScan with some basic examples. Ask any questions or share your thoughts with us in the comments.

n

‘]