Skip to content

Commit 90c6764

Browse files
committed
init_module_paths once in msfconsole
MSP-11672 Pass `'DeferModuleLoads' => false` to `Msf::Simple::Framework.create` so that `framework.modules.init_module_paths` is only called once (directly in `Msf::Ui::Console::Driver#initialize`) instead of twice (in `Msf::Simple::Framework.create` and `Msf::Ui::Console::Driver#initialize).
1 parent 653c71e commit 90c6764

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/msf/ui/console/driver.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def initialize(prompt = DefaultPrompt, prompt_char = DefaultPromptChar, opts = {
5959
histfile = opts['HistFile'] || Msf::Config.history_file
6060

6161
# Initialize attributes
62-
self.framework = opts['Framework'] || Msf::Simple::Framework.create(opts)
62+
63+
# Defer loading of modules until paths from opts can be added below
64+
framework_create_options = {'DeferModuleLoads' => true}.merge(opts)
65+
self.framework = opts['Framework'] || Msf::Simple::Framework.create(framework_create_options)
6366

6467
if self.framework.datastore['Prompt']
6568
prompt = self.framework.datastore['Prompt']

0 commit comments

Comments
 (0)