Metasploit Section 8 of 10

Pro Tips

Expert advice for efficient and effective Metasploit usage.

Tip

Always verify target scope before running exploits. A single wrong RHOSTS can cause unintended damage.

Info

Use db_nmap to scan and automatically import results into Metasploit's database for easy target selection.

Tip

Set setg LHOST once at the start of your session so you never forget it in individual modules.

Warning

Never expose Metasploit listener ports to the public internet without proper firewall rules. Set LHOST to your VPN or internal IP.

Info

Use sessions -K to kill all active sessions and jobs -K to stop all background jobs when done.

Tip

Resource scripts (.rc files) let you automate repetitive exploit sequences. Run with msfconsole -r script.rc.

Info

Use setg for global settings and set for module-specific settings.

Tip

Test auxiliary modules first (like scanners) to confirm vulnerabilities before attempting exploits.

Warning

Always ensure you have written authorization before testing any system with Metasploit.