Security operations

What Is Metasploit? The Penetration Testing Framework Explained

Metasploit is the most widely used penetration testing framework: a library of exploit modules, payloads and scanners driven from the msfconsole command line.

Cysoro Security TeamPublished · 7 min read
msfconsolemsf6 > search eternalblueuse exploit/windows/smb/ ms17_010_eternalbluemsf6 > set RHOSTS 10.0.0.5msf6 > set PAYLOAD windows/meterpreter/reverse_tcpmsf6 > run SECURITY OPERATIONS Metasploit The pen-testing framework, explained
Quick answer

Metasploit is an open-source penetration testing framework maintained by Rapid7. It bundles exploit modules, scanners, post-exploitation modules and payloads such as Meterpreter in one console, msfconsole, so security professionals can test whether a vulnerability is actually exploitable. It was created by H. D. Moore in 2003, rewritten in Ruby in 2007, and acquired by Rapid7 in 2009. The Framework is free; Metasploit Pro is the commercial edition with a web interface.

Key takeaways

  • Metasploit is a modular framework: pick an exploit module, pick a payload, set the target, and run it from msfconsole.
  • Its most famous payload is Meterpreter, an advanced agent that runs in memory and gives the tester control of a compromised machine.
  • Metasploit is dual-use: defenders use it to validate vulnerabilities, and attackers use the same free tooling in real intrusions.

A vulnerability scanner can tell you a system might be exploitable. Metasploit answers the harder question: can an attacker actually exploit it? That is why it is the most widely used penetration testing framework in the world — and why attackers use it too.

What is Metasploit?

Metasploit is an open-source penetration testing framework maintained by Rapid7. It bundles exploit modules, scanners, post-exploitation modules and payloads such as Meterpreter in one console.

Rapid7 describes it as a Ruby-based, modular penetration testing platform that lets you write, test and execute exploit code. The main interface is msfconsole, a command shell from which a tester picks a module, sets a target and launches it.

The project lives on GitHub as rapid7/metasploit-framework and is released under a BSD-style license. The Framework is free; Metasploit Pro is the commercial edition with a web interface.

Rapid7's installation guide explains how to install the Framework on Linux, Windows and macOS, in Rapid7's Metasploit installation documentation.

Who created Metasploit, and when?

Metasploit was created by H. D. Moore in 2003 as a portable network tool written in Perl. By 2007 the Framework had been completely rewritten in Ruby, which is still its language today.

On 21 October 2009, the Metasploit Project announced that it had been acquired by Rapid7, a Boston-based security company. Rapid7 has maintained the project since, adding the commercial Metasploit Pro edition alongside the free Framework.

Metasploit's position as the standard exploit development framework led to a pattern that still holds: software vulnerability advisories are often accompanied by a Metasploit exploit module that shows the bug is genuinely exploitable.

How does Metasploit work?

Metasploit follows a simple workflow: search for a module, configure it, choose a payload, and run it. The modular design — any exploit combined with any payload — is its main advantage.

The Metasploit workflow in five steps1Check targetscan, fingerprint,confirm version2Choose exploitmodule for thevulnerability3Choose payloadshell, Meterpreteror other code4Encode itevade detectionby filters5Run itexploit runs,session opensOnly ever run this against systems you own or have written permission to test.
The five steps of a Metasploit exploit, from target check to session. Illustration by Cysoro.
  1. Check whether the target is vulnerable. Scan it, fingerprint the service, and confirm the version matches the exploit.
  2. Choose and configure an exploit. This is code that enters the target by taking advantage of a specific bug.
  3. Choose and configure a payload. This is the code that runs on the target after entry, such as a remote shell.
  4. Choose an encoding technique. Encoding helps the payload avoid detection by intrusion prevention systems.
  5. Execute the exploit. If it works, a session opens and the tester can run post-exploitation modules.

Metasploit runs on Linux, macOS and Windows, and it comes preinstalled on Kali Linux, the penetration testing distribution many testers use as their base system.

For the full history and module counts, see the Metasploit article on Wikipedia, which records the 2003 creation, the 2007 Ruby rewrite and the 2009 Rapid7 acquisition.

What are Metasploit modules?

Modules are the building blocks of Metasploit. Each module does one job, and the tester combines them. Rapid7's documentation covers three main kinds, plus auxiliary and post modules.

Module typeWhat it doesExample
ExploitTakes advantage of a vulnerability to gain code executionExploit for a specific service bug
AuxiliaryScanning, fingerprinting and other tasks that do not exploitPort scanner, login checker
PayloadCode that runs on the target after entryMeterpreter, remote shell
PostRuns after a session is openCredential harvesting, privilege escalation
EncoderRe-encodes a payload to avoid detectionShikata Ga Nai encoder
NOPKeeps payload alignment stableNOP sled generator

Guides published in 2025 report more than 2,300 exploit modules, more than 1,200 auxiliary modules and more than 400 post-exploitation modules in the Framework. The count grows with every release, so check the current number in msfconsole.

What is msfconsole, and how do you use it?

msfconsole is the most commonly used interface to the Metasploit Framework. Rapid7's documentation calls it an all-in-one centralized console that gives you access to virtually all of the Framework's options.

From the msfconsole prompt, the usual commands are search to find a module, use to select it, show options to see what it needs, set to fill in values such as the target address, and run or exploit to launch it.

The console has tab completion, command history and database integration, so you can manage scan data, sessions and credentials across a complex engagement from one place.

Rapid7 provides open-source installers for Linux, Windows and macOS. The installer ships with all dependencies, including msfconsole and associated tools such as Nmap, and you need administrator privileges to install it. Disable antivirus before installing, as Rapid7 advises, because security software often flags Metasploit components.

What is Meterpreter?

Meterpreter is Metasploit's advanced payload, and it has been part of Metasploit since 2004. It is the payload testers reach for when a simple shell is not enough.

Meterpreter uses reflective DLL injection, so its DLL can run as shellcode in memory without writing a file to disk. That makes it harder for antivirus and forensic tools to spot.

  • Remote shell and file access: run commands, upload and download files, and browse the target's filesystem.
  • Credential access: dump password hashes and tokens from memory, subject to the target's protections.
  • Pivoting: use the compromised machine as a stepping stone to reach other machines on its network.
  • Extensibility: load extensions for screenshots, keylogging, webcam access and more, all in memory.

Because Meterpreter runs in memory, it disappears when the process ends or the machine reboots — unless the tester establishes persistence, which is a separate post-exploitation step.

Metasploit Framework vs Metasploit Pro: what is the difference?

The Framework is the free, open-source, command-line edition. Metasploit Pro is Rapid7's commercial edition, which its documentation calls an exploitation and vulnerability validation tool that splits the penetration testing workflow into manageable sections.

Metasploit FrameworkMetasploit Pro
PriceFree, open sourceCommercial, free trial
Interfacemsfconsole command lineWeb interface plus console
ReportingManual, from console outputBuilt-in reports and task chains
AutomationResource scriptsGuided workflows and automation
Best forLearning, labs, individual testersProfessional teams and clients

Most learners should start with the Framework. It contains the same exploit and payload library, and the skills transfer directly to Pro if a team later buys it.

Metasploit itself is legal software, and learning it is a normal part of a security career. Using it against systems you do not own, or do not have written permission to test, is illegal in most countries.

The safe way to learn is in a lab: install Metasploit on your own machine or a virtual machine, and test it against an intentionally vulnerable target such as Metasploitable, the deliberately insecure virtual machine built for this purpose.

Get written permission firstNever test a real system — even your employer's — without written authorization that names the systems, the dates and the techniques allowed. A verbal okay is not enough.

Metasploit is also core material for penetration testing certifications, including OSCP (Offensive Security Certified Professional) and CEH (Certified Ethical Hacker), and for Rapid7's own Metasploit Pro Certified Specialist certification.

How do defenders detect Metasploit?

Metasploit is dual-use, and MITRE ATT&CK documents threat actors obtaining Metasploit for malicious campaigns under technique T1588.002, Obtain Capabilities: Tool. Defenders should therefore know what it looks like on their network.

Detecting Metasploit on your networkEndpoint alertsMemory injection, reflective DLLloading, suspicious processesNetwork trafficReverse shell callbacks to anunusual external addressProcess behaviourA trusted process spawning ashell, or dumping credentialsCredential useStolen hashes used to movesideways to other machines
Four places where Metasploit activity shows up. Illustration by Cysoro.
  • Endpoint detection: modern EDR tools flag reflective DLL injection, in-memory payloads and process hollowing, which are Meterpreter's hallmarks.
  • Network monitoring: reverse shell callbacks to an external address, especially on unusual ports, stand out in firewall and proxy logs.
  • Credential monitoring: hash dumping and pass-the-hash logins are strong indicators of post-exploitation activity.
  • Patching: the simplest defense is to patch the vulnerabilities Metasploit exploits, so the exploit module fails in the first place.

For a wider view of how attackers operate, see our guide to what spear phishing is — the usual way an attacker gets the first foothold that Metasploit then exploits.

What are the alternatives to Metasploit?

Metasploit is the standard, but it is not the only penetration testing framework. The right alternative depends on what you are testing.

  • Nmap: the standard network scanner, often used before Metasploit to find open ports and services. Metasploit can import Nmap results.
  • Burp Suite: the standard tool for web application testing, where Metasploit's network exploits are less useful.
  • Cobalt Strike: a commercial adversary simulation platform, popular with red teams but far more expensive than Metasploit Pro.
  • PowerShell Empire and similar: post-exploitation frameworks focused on Windows environments.

Most testers use several of these together: Nmap to find targets, Metasploit to validate exploits, and Burp Suite for web applications.

The bottom line

Metasploit is the standard tool for answering whether a vulnerability is actually exploitable. Learn it in a lab, on Metasploitable, with written permission for any real target — and learn to detect it, because attackers use the same free tooling.

Start by patching the vulnerabilities Metasploit exploits, and check your own website's exposure with the free security headers checker.

Also check your certificates with the free SSL checker.

Frequently asked questions

What is Metasploit used for?

Metasploit is used for authorized penetration testing and vulnerability validation. Security professionals use it to check whether a vulnerability can actually be exploited, to test defenses, and to train. Attackers use the same tooling, which is why defenders must know how to detect it.

Is Metasploit free?

Yes, the Metasploit Framework is free and open source, released under a BSD-style license. Metasploit Pro is Rapid7's commercial edition with a web interface and extra automation, offered with a free trial.

Is Metasploit legal?

Metasploit itself is legal software. Using it against systems you do not own or do not have written permission to test is illegal in most countries, and can be prosecuted as computer intrusion. Always get written authorization first and test only in a lab or on approved targets.

What is Meterpreter?

Meterpreter is Metasploit's advanced payload. It runs in memory using reflective DLL injection, so it does not write a file to disk, and it gives the tester a shell, file access, screenshot and credential tools on the target machine.

What is msfconsole?

msfconsole is the main command-line interface to the Metasploit Framework. From its prompt you search for modules, set options such as the target address, choose a payload, and run the exploit.

How many exploits does Metasploit have?

Counts change with every release. Guides published in 2025 report more than 2,300 exploit modules, plus more than 1,200 auxiliary modules and 400 post-exploitation modules. Check the current module count in msfconsole rather than relying on a fixed number.

What is the difference between Metasploit Framework and Metasploit Pro?

The Framework is the free, open-source, command-line edition. Metasploit Pro is the commercial edition with a web interface, reporting, automation and vulnerability validation workflows, aimed at professional penetration testing teams.

Do I need to learn Metasploit for a security career?

It helps a lot. Metasploit is core material for penetration testing certifications such as OSCP and CEH, and it is the standard tool for exploit validation in many security teams. Learn it in a lab, on intentionally vulnerable machines such as Metasploitable.

Sources

  1. Rapid7 — Metasploit Framework on GitHub
  2. Rapid7 — Installing the Metasploit Framework
  3. Wikipedia — Metasploit
  4. Vectra AI — What is Metasploit? Framework, Meterpreter, and detection guide
  5. Brandefense — Metasploit Explained: Framework, Meterpreter, Detection
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Rapid7's Metasploit documentation and the Metasploit project history, plus MITRE ATT&CK technique T1588.002.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free