Wordpress Penetration Testing Using Wpscan and Metasploit
Wordpress Penetration Testing Using Wpscan and Metasploit
In this tutorial, I will show you how to use WPScan and Metasploit to hack a WordPress website
easily. You will learn how to scan WordPress sites for potential vulnerabilities, take advantage of
vulnerabilities to own the victim, enumerate WordPress users, brute force WordPress accounts,
and upload the infamous meterpreter shell on the target’s system using Metasploit Framework.
Open WPScan
You can open up a terminal and type in wpscan or go to Applications > Web Application
Analysis > WPScan
Page |3
The first thing to do before is ensuring that your WPScan’s vulnerabilities database is up-to-date.
wpscan --update
Type the subsequent command into terminal to scan the target’s website for potentially
exploitable vulnerabilities:
As we can see, WPScan has discovered various facts about the target’s website including and not
limited to:
The Red ! sign refers to a specific component of a site being vulnerable to exploitation.
Page |9
Vulnerable Contact Form with a Security Bypass, File Upload RCE Available
(References: WPVulnDB, SecurityFocus, CVE MITRE, PacketStormSecurity)
Vulnerable LAyerSlider with a Style Editing CSRF, Remote Path Traversal File
Access, CSRF / Authenticated Stored XSS & SQL Injection Available (References:
WPVulnDB,PacketStormSecurity, secunia, wphutte)
It’s important to note that even when WPScan cannot determine a version of a specific plugin, it
will print out a list of all potential vulnerabilities. It is beneficial to take the time to review, visit
the reference sites individually, and execute these exploits to determine whether the target site is
vulnerable to them or not. Just because a plugin version cannot be determined does not mean the
site is not vulnerable.
P a g e | 10
It is beneficial to take the time to review vulnerabilities, visit the reference sites individually, and
execute these exploits to determine whether the target site is vulnerable to them or not. Just
because a plugin version cannot be determined does not mean the site is not vulnerable.
Reference Sites You Should Use To Conduct Research For Potential Vulnerabilities
https://wpvulndb.com
https://packetstormsecurity.com
https://www.exploit-db.com
https://cve.mitre.org
http://www.securityfocus.com
http://cxsecurity.com
An interesting example
For example, we can use the Slider Revolution Upload Execute Exploit via Metasploit.
Metasploit already has this exploit ready to use for your pleasure.
One more thing before we proceed with the Metasploit Framework Tutorial:
The WordPress user/account enumeration tool integrated into WPScan is deployed to obtain a
list of registered WordPress users from the target’s website.
User enumeration is imperative when a hacker needs to obtain access to a particular target via
brute forcing the target’s WordPress administrator account.
The WPScan user enumeration tool will scan the target’s site for WordPress authors and
usernames.
Two user accounts, particularly the most important: admin (Default admin name left
unchanged)
admin is still used.
Second account may possess admin privileges, can brute force both simultaneously if required.
Type the subsequent command into terminal to brute force the password for user admin:
For a clean version without those annoying brackets I just used, here is the command:
Eventually, you could see the password listed in terminal beside the login ID.
P a g e | 13
FYI, even though this RevSlider plugin vulnerability has been patched, many WordPress
websites out there still haven’t updated their RevSlider plugin, which makes them susceptible to
getting owned by 1337 hax0rs.
search revslider
use exploit/unix/webapp/wp_revslider_upload_execute
show options
P a g e | 14
You need to set your target’s website URL using the subsequent command:
AND
You need to set your target’s URI base path to their WordPress application using the subsequent
command:
set targeturi /wordpress (Replace /wordpress with individual directory path if WordPress is not
installed in /)
Use A Payload
We need to set a payload. In our demonstration, we use the notorious meterpreter payload to pwn
our target.
Make sure that rhost for both module and payload options are filled with your target’s site IP
address/URL.
You could check/confirm if the target is vulnerable by typing in “check” command into the
terminal.
You would get the response message: “The target appears to be vulnerable.” We already know
that, but just to check again.
Now to get the meterpreter shell on the target’s system, simply type in “exploit” command into
the terminal.
“Deleted ../revslider.zip“
Instagram.com/Behrouz_mansoori