Default simplify_module to not load_saved_config and update all references

This commit is contained in:
dwelch-r7
2021-08-19 13:04:26 +01:00
parent d53cc717ba
commit 8f51663545
8 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ module Auxiliary
# Clone the module to prevent changes to the original instance
mod = omod.replicant
Msf::Simple::Framework.simplify_module( mod, false )
Msf::Simple::Framework.simplify_module(mod)
yield(mod) if block_given?
# Import options from the OptionStr or Option hash.
@@ -109,7 +109,7 @@ module Auxiliary
# The local output through which data can be displayed.
#
def self.check_simple(mod, opts, job_listener: Msf::Simple::NoopJobListener.instance)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod._import_extra_options(opts)
if opts['LocalInput']
+1 -1
View File
@@ -13,7 +13,7 @@ module Evasion
begin
# Clone the module to prevent changes to the original instance
Msf::Simple::Framework.simplify_module( evasion, false )
Msf::Simple::Framework.simplify_module(evasion)
yield(evasion) if block_given?
# Import options from the OptionStr or Option hash.
+2 -2
View File
@@ -60,7 +60,7 @@ module Exploit
begin
# Clone the module to prevent changes to the original instance
Msf::Simple::Framework.simplify_module( exploit, false )
Msf::Simple::Framework.simplify_module(exploit)
yield(exploit) if block_given?
# Import options from the OptionStr or Option hash.
@@ -181,7 +181,7 @@ module Exploit
# The local output through which data can be displayed.
#
def self.check_simple(mod, opts, job_listener: Msf::Simple::NoopJobListener.instance)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod._import_extra_options(opts)
if opts['LocalInput']
+2 -2
View File
@@ -47,7 +47,7 @@ module Framework
# Simplifies module instances when they're created.
#
def on_module_created(instance)
Msf::Simple::Framework.simplify_module(instance)
Msf::Simple::Framework.simplify_module(instance, load_saved_config: true)
end
ModuleSimplifiers =
@@ -131,7 +131,7 @@ module Framework
# Simplifies a module instance if the type is supported by extending it
# with the simplified module interface.
#
def self.simplify_module(instance, load_saved_config = true)
def self.simplify_module(instance, load_saved_config: false)
if ((ModuleSimplifiers[instance.type]) and
(instance.class.include?(ModuleSimplifiers[instance.type]) == false))
instance.extend(ModuleSimplifiers[instance.type])
+1 -1
View File
@@ -41,7 +41,7 @@ module Post
# Clone the module to prevent changes to the original instance
mod = omod.replicant
Msf::Simple::Framework.simplify_module( mod, false )
Msf::Simple::Framework.simplify_module(mod)
yield(mod) if block_given?
# Import options from the OptionStr or Option hash.
@@ -87,7 +87,7 @@ module ModuleCommandDispatcher
nmod = mod.replicant
nmod.datastore['RHOST'] = thr_host[:address].dup
nmod.datastore['VHOST'] = thr_host[:hostname].dup if nmod.options.include?('VHOST') && nmod.datastore['VHOST'].blank?
Msf::Simple::Framework.simplify_module(nmod, false)
Msf::Simple::Framework.simplify_module(nmod)
check_simple(nmod)
}
end
@@ -43,7 +43,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Auxiliary do
allow(mod).to receive(:framework).and_return(framework)
allow(mod).to receive(:datastore).and_return(datastore)
datastore.import_options(mod.options)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod
end
@@ -90,7 +90,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Auxiliary do
allow(mod).to receive(:framework).and_return(framework)
allow(mod).to receive(:datastore).and_return(datastore)
datastore.import_options(mod.options)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod
end
@@ -141,7 +141,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Auxiliary do
allow(mod).to receive(:framework).and_return(framework)
allow(mod).to receive(:datastore).and_return(datastore)
datastore.import_options(mod.options)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod
end
@@ -49,7 +49,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Exploit do
allow(mod).to receive(:framework).and_return(framework)
allow(mod).to receive(:datastore).and_return(datastore)
datastore.import_options(mod.options)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod
end
@@ -90,7 +90,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Exploit do
allow(mod).to receive(:framework).and_return(framework)
allow(mod).to receive(:datastore).and_return(datastore)
datastore.import_options(mod.options)
Msf::Simple::Framework.simplify_module(mod, false)
Msf::Simple::Framework.simplify_module(mod)
mod
end