Home > Networking > Use metasploit to perform quick scan for your wordpress

Use metasploit to perform quick scan for your wordpress

If you’re looking to enhance your cybersecurity skills or test the security of your WordPress site, Kali Linux and Metasploit are powerful tools to have in your arsenal. Metasploit, a penetration testing framework pre-installed in Kali Linux, can indeed be used to scan WordPress websites for vulnerabilities. In this guide, I’ll walk you through the process of using Kali Linux Metasploit to scan WordPress, perfect for beginners and seasoned pentesters alike.

What is Kali Linux Metasploit?

Kali Linux is a specialized Linux distribution designed for security researchers and penetration testers. It comes packed with tools like Metasploit, an open-source framework that allows you to scan, enumerate, and exploit vulnerabilities in systems, networks, and web applications—including WordPress. WordPress, being the most popular content management system (CMS), is a common target for attackers, making it essential to understand how to test its security.

Can Metasploit Scan WordPress?

Yes, Metasploit can scan WordPress websites! It includes specific modules tailored for WordPress, such as scanners to detect versions, plugins, themes, and even login vulnerabilities. These scans help identify weaknesses that could be exploited, allowing you to secure your site before attackers take advantage.

Before diving in, ensure you have the following:

  1. Kali Linux Installed: Download and install Kali Linux on your machine or run it via a virtual machine (e.g., VirtualBox or VMware).
  2. Metasploit Framework: It’s pre-installed in Kali Linux, but ensure it’s updated by running sudo apt update && sudo apt upgrade.
  3. Target WordPress Site: You must have permission to scan the site (e.g., your own site or a test environment). Unauthorized scanning is illegal.
  4. Basic Terminal Knowledge: Familiarity with Linux commands will make this easier.

Step-by-Step Guide: Scanning WordPress with Metasploit

Follow these steps to scan a WordPress site using Metasploit in Kali Linux. This tutorial focuses on the wordpress_scanner module, which is ideal for reconnaissance.

Step 1: Launch Metasploit

Open a terminal in Kali Linux and start the Metasploit console by typing:

bash

msfconsole

This will load the Metasploit Framework. It might take a moment to initialize.

Step 2: Select the WordPress Scanner Module

Once Metasploit is running, select the WordPress scanner module by entering:

bash

use auxiliary/scanner/http/wordpress_scanner

This module scans for WordPress version details, installed plugins, themes, and more.

Step 3: Configure the Scanner Options

Check the required options for the module by typing:

bash

show options

You’ll see a list of settings. The key ones to configure are:

  • RHOSTS: The target WordPress site’s IP address or domain (e.g., 192.168.1.100 or example.com).
  • RPORT: The port (usually 80 for HTTP or 443 for HTTPS).
  • TARGETURI: The base path of the WordPress installation (e.g., / or /wordpress/ if installed in a subdirectory).

Set these options like this:

bash

set RHOSTS example.com
set RPORT 80
set TARGETURI /

If the site uses HTTPS, set RPORT to 443 and enable SSL with:

bash

set SSL true

Step 4: Run the Scan

Once configured, launch the scan by typing:

bash

run

Metasploit will now probe the WordPress site and display results, such as:

  • The WordPress version (e.g., 6.4.3).
  • Detected plugins and themes, including their versions.
  • Potential vulnerabilities based on its database.

Step 5: Analyze the Results

The output will look something like this:

[*] Detecting WordPress version...
[+] example.com - Detected WordPress 6.4.3
[*] Enumerating plugins...
[+] example.com - Detected plugin: all-in-one-wp-migration version 7.81
[*] Enumerating themes...
[+] example.com - Detected theme: twenty-twenty-four

Use this information to check for outdated software or known vulnerabilities. You can cross-reference findings with online databases like CVE Details or Exploit-DB.

Bonus: Brute-Forcing WordPress Logins with Metasploit

If you want to test login security, Metasploit has a module for that too! Use the wordpress_login_enum module:

bash

use auxiliary/scanner/http/wordpress_login_enum
set RHOSTS example.com
set TARGETURI /wp-login.php
set USER_FILE /path/to/usernames.txt
set PASS_FILE /path/to/passwords.txt
run
  • USER_FILE: A text file with potential usernames (e.g., admin, user1).
  • PASS_FILE: A wordlist like /usr/share/wordlists/rockyou.txt in Kali Linux.

This will attempt to brute-force login credentials. Be cautious—this can lock you out if the site has security measures like login attempt limits.

Best Practices and Legal Considerations

  • Permission is Key: Only scan sites you own or have explicit permission to test. Unauthorized scanning violates laws like the Computer Fraud and Abuse Act (CFAA).
  • Update Metasploit: Run msfupdate to keep your exploit database current.
  • Secure Your Site: Use scan results to patch vulnerabilities, update plugins/themes, and enforce strong passwords

Conclusion

Using Kali Linux Metasploit to scan WordPress is a straightforward yet powerful way to identify security weaknesses. By following this guide, you can detect outdated versions, vulnerable plugins, and more, helping you secure your site or sharpen your pentesting skills.

Leave a Comment