Metasploit
Set Different Defaults for Modules
Avoid the defaults, when they might be IOCs. Worst example: listening on port 4444, the “well-known Metasploit port”
Consider using an rc file to establish your defaults:
echo "setg LHOST $(curl -s ident.me)" > msf.rc # gets public IP. Won't work for internals
echo "setg LPORT 8443" >> msf.rc
msfconsole -r msf.rc…with that, LHOST defaults to your public IP and LPORT defaults to 8443 for any module that uses those variables.
Enable Logging to a File
So you get a copy of everything you see and do in the console, run these (in the console, or add them with setg as above to an msf.rc file before starting msfconsole)
set ConsoleLogging True
set SessionLogging True
spool msf.log