Information GatheringPenetration TestingWeb Application Security

How To Scan And Hack WordPress Website Using WPScan And Metasploit

Let’s scan the WordPress website in order to find vulnerabilities to exploit using WPScan and Metasploit.

What things do you require?

  1. Wpscan
  2. Metasploit

If you’re using Kali Linux both of them are already installed, If you’re using another operating system you need to install them.

Let’s Get Started!

What is WPscan?

The WPScan software (henceforth referred to simply as “WPScan”) is dual-licensed – Copyright 2011-2016 WPScan Team.

Cases that include the commercialization of WPScan require a commercial, non-free license. Otherwise, WPScan can be used without charge under the terms set out below.

How to start Wpscan?

[email protected]:~# wpscan

WPScan Examples

Do ‘non-intrusive’ checks…

wpscan --url

Do word-list password brute force on enumerated users using 50 threads…

wpscan --url --wordlist darkc0de.lst --threads 50

Do word-list password brute force on enumerated users using STDIN as the word list…

crunch 5 13 -f charset.lst mixalpha | wpscan --url --wordlist -

Do word-list password brute force on the ‘admin’ username only…

wpscan --url --wordlist darkc0de.lst --username admin

Enumerate installed plugins…

wpscan --url --enumerate p

Run all enumeration tools…

wpscan --url --enumerate

Use a custom content directory…

wpscan -u --wp-content-dir custom-content

Update WPScan’s databases…

wpscan --update

Debug output…

wpscan --url --debug-output 2>debug.log


--update                            Update the database to the latest version.
--url       | -u <target url>       The WordPress URL/domain to scan.
--force     | -f                    Forces WPScan to not check if the remote site is running WordPress.
--enumerate | -e [option(s)]        Enumeration.
  option :
    u        usernames from id 1 to 10
    u[10-20] usernames from id 10 to 20 (you must write [] chars)
    p        plugins
    vp       only vulnerable plugins
    ap       all plugins (can take a long time)
    tt       timthumbs
    t        themes
    vt       only vulnerable themes
    at       all themes (can take a long time)
  Multiple values are allowed : "-e tt,p" will enumerate timthumbs and plugins
  If no option is supplied, the default is "vt,tt,u,vp"

--exclude-content-based "<regexp or string>"
                                    Used with the enumeration option, will exclude all occurrences based on the regexp or string supplied.
                                    You do not need to provide the regexp delimiters, but you must write the quotes (simple or double).
--config-file  | -c <config file>   Use the specified config file, see the example.conf.json.
--user-agent   | -a <User-Agent>    Use the specified User-Agent.
--cookie <string>                   String to read cookies from.
--random-agent | -r                 Use a random User-Agent.
--follow-redirection                If the target url has a redirection, it will be followed without asking if you wanted to do so or not
--batch                             Never ask for user input, use the default behaviour.
--no-color                          Do not use colors in the output.
--log [filename]                    Creates a log.txt file with WPScan's output if no filename is supplied. Otherwise the filename is used for logging.
--no-banner                         Prevents the WPScan banner from being displayed.
--disable-accept-header             Prevents WPScan sending the Accept HTTP header.
--disable-referer                   Prevents setting the Referer header.
--disable-tls-checks                Disables SSL/TLS certificate verification.
--wp-content-dir <wp content dir>   WPScan try to find the content directory (ie wp-content) by scanning the index page, however you can specify it.
                                    Subdirectories are allowed.
--wp-plugins-dir <wp plugins dir>   Same thing than --wp-content-dir but for the plugins directory.
                                    If not supplied, WPScan will use wp-content-dir/plugins. Subdirectories are allowed
--proxy <[protocol://]host:port>    Supply a proxy. HTTP, SOCKS4 SOCKS4A and SOCKS5 are supported.
                                    If no protocol is given (format host:port), HTTP will be used.
--proxy-auth <username:password>    Supply the proxy login credentials.
--basic-auth <username:password>    Set the HTTP Basic authentication.
--wordlist | -w <wordlist>          Supply a wordlist for the password brute forcer.
                                    If the "-" option is supplied, the wordlist is expected via STDIN.
--username | -U <username>          Only brute force the supplied username.
--usernames     <path-to-file>      Only brute force the usernames from the file.
--cache-dir       <cache-directory> Set the cache directory.
--cache-ttl       <cache-ttl>       Typhoeus cache TTL.
--request-timeout <request-timeout> Request Timeout.
--connect-timeout <connect-timeout> Connect Timeout.
--threads  | -t <number of threads> The number of threads to use when multi-threading requests.
--max-threads     <max-threads>     Maximum Threads.
--throttle        <milliseconds>    Milliseconds to wait before doing another web request. If used, the --threads should be set to 1.
--help     | -h                     This help screen.
--verbose  | -v                     Verbose output.
--version                           Output the current version and exit.

I have tested WPScan to show you how it gives us the output. I have tested on a public website and replaced the real domain with

wpscan --url --enumerate
        __          _______   _____                  
        \ \        / /  __ \ / ____|                 
         \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \ 
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team 
                       Version 2.9.2
          Sponsored by Sucuri -
   @_WPScan_, @ethicalhack3r, @erwan_lr, pvdl, @_FireFart_

[i] It seems like you have not updated the database for some time.
[?] Do you want to update now? [Y]es [N]o [A]bort, default: [N]Y
[i] Updating the Database ...
[i] Update completed.
[+] URL:
[+] Started: Sat Sep 16 09:10:55 2017

[+] robots.txt available under: ''
[+] Interesting entry from robots.txt:
[!] The WordPress '' file exists exposing a version number
[!] Full Path Disclosure (FPD) in '': 
[+] Interesting header: LINK: <>; rel="", <>; rel=shortlink
[+] Interesting header: SERVER: Apache

[+] WordPress version 4.7.5 (Released on 2017-05-16) identified from meta generator, links opml
[!] 1 vulnerability identified from the version number

[!] Title: WordPress 2.3-4.7.5 - Host Header Injection in Password Reset

[+] WordPress theme in use: bully3 - v3.0

[+] Name: bully3 - v3.0
 |  Location:
 |  Style URL:
 |  Theme Name: Bully's Game Calls v3
 |  Theme URI:
 |  Description: Based on a design submitted by Brian V
 |  Author: Justin Gruca

[+] Enumerating installed plugins (only ones with known vulnerabilities) ...

   Time: 00:06:52 <=========================================================> (1547 / 1547) 100.00% Time: 00:06:52

[+] We found 4 plugins:

[+] Name: akismet
 |  Latest version: 3.3.4 
 |  Location:

[!] We could not determine a version so all vulnerabilities are printed out

[!] Title: Akismet 2.5.0-3.1.4 - Unauthenticated Stored Cross-Site Scripting (XSS)
[i] Fixed in: 3.1.5

[+] Name: newsletter
 |  Latest version: 5.0.6 
 |  Location:

[!] We could not determine a version so all vulnerabilities are printed out

[!] Title: Newsletter <= 3.0.8 - SQL Injection
[i] Fixed in: 3.0.9

[!] Title: Newsletter <= 3.2.6 - Cross-Site Scripting (XSS)
[i] Fixed in: 3.2.7

[!] Title: Newsletter 3.7.0 - Open Redirect
[i] Fixed in: 3.8.3

[+] Name: tdo-mini-forms - v0.12.7
 |  Location:
 |  Readme:

[!] Title: TDO Mini Forms 0.13.9 - tdomf-upload-inline.php File Upload Remote Code Execution

[+] Name: wp-shopping-cart - v3.6.7
 |  Location:
 |  Readme:

[!] Title: e-Commerce <= 3.4 - Arbitrary File Upload Exploit

[+] Enumerating installed themes (only ones with known vulnerabilities) ...

   Time: 00:01:00 <===========================================================> (283 / 283) 100.00% Time: 00:01:00

[+] We found 1 themes:

[+] Name: more
 |  Location:
 |  Style URL:

[!] We could not determine a version so all vulnerabilities are printed out

[!] Title: Multiple Themes - PrettyPhoto DOM XSS

[+] Enumerating timthumb files ...

   Time: 00:09:09 <=========================================================> (2541 / 2541) 100.00% Time: 00:09:09

[+] No timthumb files found

[+] Enumerating usernames ...
[+] Identified the following 3 user/s:
    | Id | Login             | Name              |
    | 1  | admin             | admin             |
    | 5  | bullys            | Bullys            |
    | 6  | Contributer       | tdomf_71060       |
[!] Default first WordPress username 'admin' is still used

[+] Finished: Sat Sep 16 09:29:49 2017
[+] Requests Done: 4514
[+] Memory used: 102.609 MB
[+] Elapsed time: 00:18:53

Using WPScan we can find installed plugins and themes and search for exploits according to those plugins and themes. After that, we’re gonna start with Metasploit and try to exploit those vulnerabilities.

Let’s Start with Metasploit.

msf > search wordpress

How To Scan And Exploit WordPress Website Using WPScan And Metasploit

There are tons of exploits if you search in Metasploit, After searching for installed themes and plugins using WPScan you can search those in Metasploit and easily can exploit and get a shell.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button