Like msfconsole, Meterpreter also supports resource scripts, which allow us to automate the use of Meterpreter commands.
Meterpreter resource scripts
How to do it...
- Before we can use resource scripts in our Meterpreter session, we first need to create the directory structure where we will be placing the scripts, for which we will use the mkdir command with the -p option so that it will create all the parent directories:
root@kali:~# mkdir -p ~/.msf4/scripts/resource
/meterpreter/
- Now that we have the Meterpreter resource scripts directory created, we can start writing our Meterpreter resource scripts. For the first script, we will start with some basic commands to get system information. Use your favorite editor to create the following...