Contents
This tool can also be used for attacks. Use it only on systems you own or have written permission to test.
Metasploit Framework collects code that tests vulnerabilities, and code that runs after a test succeeds, into “modules.” You call them all from one console, msfconsole. The official README describes it as an open-source tool, and Kali Linux ships with it preinstalled.
This review is for people who know basic networking and the Linux command line. You must not use this tool on anything you have no permission to test, so practice only in an isolated environment you built yourself. After reading it, you can do the following:
- Explain the module types and the basic flow in
msfconsole - Set up the database (msfdb) and keep your results in one place
- Decide how to build a safe test environment
What Metasploit Framework does
Modules are split by role. The official documentation lists four main types.
| Type | Role |
|---|---|
| Auxiliary | Collects data or does admin tasks without exploiting a target |
| Exploit | Uses a vulnerability to run code on the target |
| Payload | Code that runs on the target, for example to create a user or open a session |
| Post | Gathers or examines data from a session after a machine is compromised |
- Find and configure modules: Use
searchto find one,useto select it,show optionsto see what you need to set, andrunto execute it. The docs say that since Metasploit 6 you can pass options directly torun. - Database integration: It records the hosts and services you found, credentials you obtained, and sessions you opened.
workspacekeeps the data for each engagement apart. - Payload generation: The bundled
msfvenomoutputs payloads in file and other formats. - Nmap integration: The results of an Nmap run through
db_nmapgo into the database as hosts and services.
How Framework differs from Metasploit Pro
There is a free Framework and a paid Metasploit Pro, and they share a name.
- Framework: Open source, centered on the command line (
msfconsole). This review covers this one. - Metasploit Pro: Rapid7’s commercial edition. Rapid7’s product page lists matching exploits to vulnerabilities automatically after you import assets, and wizards for phishing and USB drop campaigns. According to the official docs, reports built from the database are restricted to Pro users.
The docs home page says the official installers give you the Framework plus a free trial of Pro. Whether to use the trial is up to you. This review does not cover Pro.
Network traffic
| When | What goes over the network |
|---|---|
| Installing | On Linux and macOS, the official script downloads from Rapid7’s package servers (apt.metasploit.com for Debian-based systems, rpm.metasploit.com for Red Hat-based systems). Windows uses the .msi from windows.metasploit.com |
| Updating | Run the msfupdate command or use your package manager. Packages from the official installers update this way |
| Running modules | Sends traffic over the network to the target hosts you configure. This is the main traffic |
| Database | The database created by msfdb init lives in ~/.msf4/db. In the official example, the web service runs at https://localhost:5443 |
I could not confirm in the official documentation whether Metasploit sends usage data on its own. If this matters to you, watch the outbound traffic of your test machine with a tool such as Wireshark.
The database also holds sensitive data, such as credentials you obtained (creds). When a test is over, clean up the database and the contents of ~/.msf4.
Try it safely: study the structure in an isolated lab
Exploit modules need a vulnerable target. The official docs also recommend building your own test environment in a virtual machine or Docker, and name Metasploitable2 and Metasploitable3 as vulnerable practice environments.
-
Build a lab. On an internal network with no outside connection, put the machine that runs Metasploit and a virtual machine to be examined (How to set up a safe test lab). OWASP Juice Shop works as a practice web app.
-
Install Metasploit on the test machine. Use the official installer (see “Installing” below).
-
Set up the database. The following command creates the database and the web service. It asks for a password and similar values, so use values meant for the lab.
msfdb init -
Start
msfconsoleand look around. Usesearchandinfoto see the module types and their descriptions. Run nothing at this stage. -
Start with the examining side. Run
db_nmapagainst your own test VM and confirm that the results appear inhostsandservices. -
If you try an exploit, aim it only at the test VM. Check before every run that the target setting (
RHOSTS) is your lab VM.
Installing
According to the official installer page, installers are built nightly for macOS, Windows (64-bit), and Linux, and they include dependencies such as Ruby and PostgreSQL.
- Linux / macOS: Run the official script. It imports Rapid7’s signing key and sets up the package. The script must run as root or with sudo. Read the script yourself before you run it.
- Linux (manual):
.debpackages (i386, amd64, armhf, arm64) and.rpmpackages (64-bit x86) are built nightly. - macOS (manual): Use the
.pkgfrom the official site. - Windows: Run the
.msiby right-clicking it and choosing “Run as Administrator.”
After installation, msfconsole is at /opt/metasploit-framework/bin/msfconsole. The prompts on first start help you set up the database and add it to your PATH.
Common uses
| Goal | Command |
|---|---|
| Find a module | search <keyword> (narrow by type with type:auxiliary) |
| Select a module | use <module name> |
| See the settings | show options |
| Set a value | set <option> <value> |
| Run it | run (exploit does the same) |
| See the records | hosts, services, creds, vulns, loot, sessions |
| Separate engagements | workspace |
How it differs from Nmap and Nuclei
| Metasploit | Nmap | Nuclei | |
|---|---|---|---|
| Main goal | Check that a weakness can really be exploited | Find open ports and services | Find known weaknesses with templates |
| Saving results | Database (msfdb) | File output | File output |
A common split is to examine the target with Nmap, load the results into Metasploit’s database, and organize them there.
Cautions
- Don’t use it on anything you have no permission to test. The text of Japan’s Unauthorized Computer Access Law, published by the Ministry of Internal Affairs and Communications, prohibits entering another person’s identification code, or information or commands that get around access restrictions, to make a system usable. Acts with the access administrator’s consent are excluded. So using it without permission can be illegal. Use it only in your own lab or on targets you have written permission to test. For work, agree the targets and the period in writing before you start.
- Antivirus software flags it. The official docs explain that Metasploit’s tools are identical or very similar to real malware, so antivirus programs often flag and automatically remove them. The docs tell you to exclude
c:\metasploit-frameworkbefore installing. Set exclusions only on a machine used just for testing, and ideally don’t install it on your everyday computer. - Don’t install it on your everyday computer. Besides the flagged files, the database collects credentials and other sensitive data.
- For work, tell people beforehand. Test traffic looks like an attack. Tell the people who monitor the network the targets and the period in advance.
- Mind the license scope. The Framework itself is BSD-3-Clause. According to the LICENSE file, though, some bundled files carry other licenses, such as the GPL.
Read next
Sources
- Official repository README (rapid7/metasploit-framework)github.com/rapid7/metasploit-framework/blob/master/README.md
- License (LICENSE)github.com/rapid7/metasploit-framework/blob/master/LICENSE
- Docs: Nightly Installersdocs.metasploit.com/docs/using-metasploit/getting-started/nightly-installers.html
- Docs: Running modulesdocs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
- Docs: Database Support (msfdb)docs.metasploit.com/docs/using-metasploit/intermediate/metasploit-database-support.html
- Docs: Home (Framework and Pro)docs.metasploit.com
- Docs: How to use msfvenomdocs.metasploit.com/docs/using-metasploit/basics/how-to-use-msfvenom.html
- Rapid7: Metasploit Pro product pagewww.rapid7.com/products/metasploit/
- MIC (Japan): Unauthorized Computer Access Lawwww.soumu.go.jp/main_sosiki/cybersecurity/kokumin/basic/legal/09/
- Install script (msfupdate.erb in metasploit-omnibus)github.com/rapid7/metasploit-omnibus/blob/master/config/templates/metasploit-framework-wrappers/msfupdate.erb
Checked on 2026-10-27
Similar tools
OWASP Juice Shop
Impact Local onlyAn intentionally vulnerable online shop for practice. Run it on your own computer to learn how web vulnerabilities work and to try out security testing tools.
- Purpose
- Learning
- Type
- Practice lab
- Difficulty
- Beginner
- License
- PermissiveMIT
- Category
- Learning and practice labs / Web security
Nmap
Impact Reaches othersThe standard scanner for finding hosts on a network, the ports they have open, and the services running on them.
- Purpose
- Audit
- Type
- Command line
- Difficulty
- Intermediate
- License
- Check termsNmap Public Source License
- Category
- Network / Reconnaissance
Nuclei
Impact Can harm othersA command-line scanner that sends requests following steps written in YAML templates and checks the responses for known vulnerabilities and misconfigurations.
- Purpose
- Audit
- Type
- Command line
- Difficulty
- Intermediate
- License
- PermissiveMIT
- Category
- Vulnerability scanning / Web security
Wireshark
Impact Reaches othersA packet analyzer that records network traffic and breaks each packet down by protocol so you can read it.
- Purpose
- Learning
- Type
- Desktop app
- Difficulty
- Beginner
- License
- CopyleftGPL-2.0
- Category
- Network / Forensics