person writing on notebook

Metasploit Tutorial for Beginners: Getting Started (2026)

Metasploit Tutorial for Beginners

This Metasploit tutorial for beginners is meant to be a starting guide on how to use Metasploit if you have never used it before. It assumes that you already have Metasploit installed and that it works, or that you are running Kali Linux or another penetration testing distribution (such as Parrot OS or BlackArch). All of the commands here apply to the free, open-source Metasploit Framework — everything you need to get started.

Metasploit History

Metasploit was created by H. D. Moore in 2003 as a portable network tool written in Perl. It quickly became the go-to framework for security researchers who needed a structured way to develop and test exploits.

Metasploit 3.0 began to include fuzzing tools used to discover software vulnerabilities, rather than just exploits for known bugs. This was demonstrated with the integration of the lorcon wireless (802.11) toolset in November 2006. By 2007, the entire framework had been rewritten in Ruby — the language it still uses today.

On October 21, 2009, the Metasploit Project announced it had been acquired by Rapid7, a security company that provides unified vulnerability management solutions. Rapid7 continues to maintain and develop the framework, releasing updates on a near-weekly basis.

Metasploit 4.0 was released in August 2011, and Metasploit 5.0 arrived in 2019 — introducing a JSON-RPC API, evasion modules, and database parallelisation that significantly improved performance. As of 2025, the framework contains over 2,300 exploit modules and receives regular additions every week. You can keep up with new modules and changes in the Rapid7 weekly wrap-up blog.

Metasploit Framework is open-source and you can view the code repository here: https://github.com/rapid7/metasploit-framework

Metasploit Module Types

Before you dive in, it helps to understand the building blocks of the framework. Metasploit organises everything into modules:

  • Exploits — Code that takes advantage of a specific vulnerability in a target system or application.
  • Payloads — What gets executed on the target after a successful exploit. The most powerful is Meterpreter (more on this below). Payloads come in three forms: Singles (self-contained), Stagers (establish a connection), and Stages (downloaded by stagers to provide advanced features).
  • Auxiliary — Non-exploit modules for scanning, enumeration, fuzzing, and service fingerprinting. Great for the reconnaissance phase.
  • Post — Post-exploitation modules that run after you have a session — things like privilege escalation, keylogging, or dumping credentials.
  • Encoders — Help payloads evade antivirus and IDS/IPS detection by modifying their signature.
  • Evasion — Introduced in Metasploit 5, these modules generate evasive payloads without needing external tools.
  • NOPs — No-operation generators used to pad memory buffers and improve exploit stability.

The Core Metasploit Workflow

The basic workflow you need to master is as follows:

  • Run msfconsole in your terminal
  • Identify a remote host and add it to the Metasploit database
  • Identify a vulnerability in the remote host that you wish to exploit
  • Select and configure the exploit and payload
  • Execute the payload against the remote host

Once you have practised and mastered this pattern, you can perform most tasks within Metasploit. As this is a Metasploit tutorial for beginners, I’ll walk you through each step.

If you enjoy this tutorial, please check out my metasploit tutorials below

Start the Database Service

In your terminal (I recommend Terminator on Kali), run the following command to start PostgreSQL. Metasploit uses this database to store all your results — hosts, services, vulnerabilities, credentials — so you can return to them later or share them with your team.

MetaSploit tutorial for beginners
sudo systemctl start postgresql

If this is the first time you are running Metasploit, you will need to initialise the database schema:

MetaSploit tutorial for beginners
sudo msfdb init

You can now start Metasploit using the msfconsole command:

MetaSploit tutorial for beginners
msfconsole

Or via the Kali Linux application menu under Exploitation Tools > Metasploit Framework:

MetaSploit tutorial for beginners
Starting Metasploit Video Clip

Once Metasploit has loaded, you will see a prompt in your terminal. The splash screen is randomised on each launch, so don’t worry if yours looks different:

MetaSploit tutorial for beginners
The msfconsole prompt

This is msfconsole — the primary command-line interface to Metasploit. From here you can launch exploits, set up listeners, configure payloads, manage sessions, and much more. The splash screen also shows you the total number of modules currently loaded (exploits, payloads, encoders, evasion modules, etc), which is a useful sanity check after an update.

Getting Help in Metasploit

Metasploit has excellent built-in documentation. Type help for a basic list of all available commands.

help show
MetaSploit tutorial for beginners

help show gives you the help section for the show command. You can then pass additional arguments, such as show exploits, show payloads, or show auxiliary.

Getting help inside MetaSploit Video Clip
help search
MetaSploit tutorial for beginners

help search shows you all the filters available for the search command. The search functionality is powerful — you can filter by module type, platform, CVE reference, OSVDB ID, and more. For example:

search type:exploit platform:windows smb
search cve:2021-44228
search name:eternalblue

To show a list of all available port scanners:

search portscan

There is also a way to search within msfconsole for various exploits:

MetaSploit tutorial for beginners
MetaSploit tutorial for beginners
Searching for WordPress exploits in Metasploit

See the Metasploit documentation and Metasploit Unleashed for more examples of the search command. Rapid7 also maintain a searchable exploit database at rapid7.com/db/modules.

Identify a Remote Host — Run an Nmap Scan Inside Metasploit

You can run an nmap scan directly from inside msfconsole using db_nmap. This runs nmap and automatically saves all discovered hosts and services into the Metasploit database, ready for use in later steps.

db_nmap -v -sV host_or_network_to_scan [eg 192.168.0.0/24]
Running an Nmap Scan Inside Metasploit Video Clip

This is a handy way to get an initial list of remote hosts on your network. I have some other tips in this Linux commands for networking article.

To list all remote hosts found by your nmap scan:

MetaSploit tutorial for beginners
hosts

To add all discovered hosts to your list of active targets:

hosts -R

You can also import results from external scanners. Nessus scan results, for example, can be imported directly into Metasploit, giving you a rich vulnerability dataset to work from without duplicating effort.

Pick a Vulnerability and Select an Exploit

Once you have identified your target’s operating system and the services it is running (using nmap, Nessus, OpenVAS, wpscan, etc), you can pick an exploit. Use the search command inside msfconsole, or browse Rapid7’s module database online.

MetaSploit tutorial for beginners

Once you have found a suitable exploit, load it with the use command:

use exploit/path/to/exploit_name

For example: use exploit/unix/webapp/php_wordpress_total_cache

From this point on, the available options change based on the exploit you are using. View the compatible payloads with:

show payloads
MetaSploit tutorial for beginners
Selecting a payload in Metasploit

For a list of the available targets the exploit supports:

show targets

Meterpreter — The Payload You’ll Use Most

When you select a payload, you’ll quickly encounter Meterpreter. It is Metasploit’s advanced, interactive shell and by far the most capable payload available. Unlike a standard shell, Meterpreter runs entirely in memory using reflective DLL injection, meaning it leaves no files on disk and is significantly harder to detect with traditional antivirus scanning.

Once you have a Meterpreter session, you have access to a rich set of post-exploitation commands:

sysinfo          # Get system information
getuid           # Show current user
getsystem        # Attempt privilege escalation
hashdump         # Dump local password hashes
shell            # Drop into a native OS shell
upload / download # Transfer files
keyscan_start    # Start a keylogger
run post/...     # Run post-exploitation modules

Meterpreter also supports multiple transport protocols including TCP, HTTP, HTTPS, and DNS tunnelling — making it flexible for different network environments. Use help inside a Meterpreter session to see the full list of available commands.

Configure the Exploit

Each exploit has a set of options you need to configure before running it. Use show options to see what is required:

show options

You need to set all options that have yes in the Required column. Use set OPTION value for each one:

MetaSploit tutorial for beginners showing options

If you previously ran hosts -R, the RHOSTS parameter will already be populated from your database. This is one of the great time-savers of working within msfconsole rather than running exploits manually.

Execute the Exploit Against the Remote Host

run

or

exploit

If Metasploit successfully exploits the vulnerability, it will open a session — most commonly a Meterpreter shell. If it doesn’t work, don’t panic. You may need to try a different exploit for the same vulnerability, double-check the version of the target service, or adjust your payload. Getting better reconnaissance data first will improve your success rate significantly.

Once you have an active session, you can list all open sessions with sessions -l and interact with one using sessions -i <id>. This is especially useful when you have multiple targets or have backgrounded a session with Ctrl+Z.

Keeping Metasploit Up to Date

Metasploit receives weekly updates from Rapid7 adding new exploit modules, payload improvements, and bug fixes. Keeping your installation current is important — new CVEs are often added to the framework within days of disclosure.

If you installed Metasploit on Kali Linux via apt, update it the same way you would any other package:

sudo apt update && sudo apt install metasploit-framework

If you installed it as a standalone framework, use the built-in updater:

sudo msfupdate

After updating, restart msfconsole and you will see the updated module count on the splash screen. The Rapid7 weekly wrap-up posts are worth bookmarking to keep track of what has been added. Full documentation is available at docs.metasploit.com.

That’s the basics of Metasploit covered! I hope this beginner’s tutorial has been useful — follow the links below to go deeper.

If you enjoy this tutorial, please check out my metasploit tutorials below

References used to make this guide:
Metasploit Documentation
Metasploit Unleashed — msfconsole commands
Metasploit Unleashed — using exploits
Rapid7 Module Database


10 responses to “Metasploit Tutorial for Beginners: Getting Started (2026)”

  1. nutesh Avatar
    nutesh

    what if no hosts are detected???

    1. 312. Avatar
      312.

      Then nobody to run anything against to.

  2. siddhesh jadhav Avatar
    siddhesh jadhav

    hey i am using kali 2.0 , I would like to use msf over wan or public domain . will you please suggest or make good article on it . thanks in advance

  3. Anthony Avatar
    Anthony

    ok thank you so much for the help i just have one question how do i find the rports

  4. Rio Avatar
    Rio

    how do i know which exploit to grab?

  5. NE0 Avatar
    NE0

    typo on database start command, should be

    service postgresql start

    1. jonathan Avatar
      1. bon Avatar
        bon

        no, it’s not

        1. jonathan Avatar

          I had restored a previous revision and it reinstated the typo :)
          It should be good for now

  6. Mas Baz Avatar
    Mas Baz

    for how to install metasploit in the windows check here how to install metasploit on windows OS for how to install metasploit in the windows check here https://www.fhxploit.com/2018/05/cara-memasang-metasploitframework-di.html

Leave a Reply