Skip to Content

Ethical Hacking: How Do You Automate and Save Metasploit Sessions Using Resource Scripts?

What Are Metasploit RC Files and How Do They Help Resume Your Work?

Learn to use Metasploit resource scripts (.rc files) to save command sequences, automate tasks, and effectively resume your progress in msfconsole. Understand why this is the correct method over log files or other options.

Question

Which msfconsole feature allows you to save your progress and resume later?

A. log file
B. Payload backup
C. Resource scripts (.rc files)
D. Exploit storage

Answer

C. Resource scripts (.rc files)

Explanation

Resource files save msfconsole commands that can be replayed later.

Resource scripts, which use the .rc file extension, are the primary feature in Metasploit for saving and automating command sequences. An .rc file is a plain text file where each line contains a msfconsole command. By executing this script, you can replay a series of commands automatically, which is essential for setting up listeners, configuring complex exploits, or running repetitive tasks without manual entry. You can create these files manually or by using the makerc command within msfconsole to save all commands from your current session to a file. To run a script upon startup, you use the -r flag (e.g., msfconsole -r my_script.rc).

The other options are incorrect:

A. log file: A log file, typically created with the spool command, records the console’s input and output for documentation or review. It is a passive record of what happened and cannot be executed to resume a session or replay commands.

B. Payload backup: This is not a recognized feature or term within the Metasploit Framework. It is a plausible-sounding but incorrect option.

D. Exploit storage: This term is ambiguous. While Metasploit stores its exploit modules in a directory structure, this is part of the framework’s architecture and not a user-facing feature for saving a session’s state.

Ethical Hacking with Metasploit, SQL & Crypto certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the Ethical Hacking with Metasploit, SQL & Crypto exam and earn Ethical Hacking with Metasploit, SQL & Crypto certificate.