Resource Files

Resource files are script files that automate commands within msfconsole. They contain a list of commands that are executed from msfconsole and run sequentially. Resource files can greatly reduce testing and development times, allowing you to automate many repetitive tasks, including exploitation.

Resource files can be loaded from msfconsole with the resource command, or they can be passed as a command-line argument with the -r switch.

The simple example shown next creates a resource file that displays our Metasploit version and then loads the sounds plug-in:

root@bt:/opt/framework3/msf3/ echo version > resource.rc  root@bt:/opt/framework3/msf3/ ...

Get Metasploit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.