If Nmap
Created by H.D. Moore in 2003 and now maintained by Rapid7, Metasploit transforms complex exploitation into a few simple commands. It's both loved (by pentesters) and feared (by defenders) because it makes attacking accessible to anyone.
Metasploit Editions
Metasploit Architecture
- Exploits: Code that takes advantage of vulnerabilities
- Payloads: Code that runs after successful exploitation
- Encoders: Obfuscate payloads to evade detection
- Auxiliaries: Supporting modules (scanners, fuzzers, etc.)
- Post: Post-exploitation modules
- Nops: No-operation instructions for exploit stability
Think Like a Recipe
Getting Started
Essential Commands
Understanding Payloads
Payload Types
- Singles: Self-contained, one-shot payloads
- Stagers: Small payloads that download the main payload
- Stages: Downloaded by stagers, provides full functionality
Common Payloads
Reverse vs Bind
Bind: You connect to victim (often blocked by firewalls)
Meterpreter
Meterpreter is Metasploit's advanced payload. It runs entirely in memory (no files on disk), has encrypted communications, and provides powerful post-exploitation capabilities.
Migrate for Stability
Listeners and Handlers
Auxiliary Modules
Auxiliary modules do everything that isn't direct exploitation: scanning, brute forcing, sniffing, and more.
Common Exploits
EternalBlue (MS17-010)
Tomcat Manager Upload
Drupalgeddon
Know What You're Running
Using the Database
Metasploit Methodology
Metasploit Exploitation Flow
Knowledge Check
Challenges
Key Takeaways
- Metasploit Framework is free and contains thousands of exploits
- Exploits + Payloads + Handlers = successful compromise
- Meterpreter is the preferred payload - runs in memory
- Reverse shells are preferred over bind shells for firewall bypass
- Always migrate meterpreter to a stable process
- Use auxiliary modules for scanning and brute forcing
- The database feature integrates Nmap scans for organization