Making use of resource scripts
Metasploit offers automation through resource scripts. The resource scripts eliminate the task of setting the options manually and set up everything automatically, thus saving the time that is required to set up the options of a module and the payload.
There are two ways to create a resource script, which are creating the script manually or using the makerc
command. I personally recommend the makerc
command over manual scripting, since it eliminates typing errors. The makerc
command saves all the previously issued commands in a file, which can be used with the resource
command. Let's see an example:
We can see in the preceding screenshot that we launched an exploit handler module by setting up its associated payload and options such as LHOST
and LPORT
. Issuing the makerc
command will save all these commands in a systematic way into a file of our choice, which is multi_hand
in this case. We can see that makerc
successfully saved last six commands into the multi_hand...