diff --git a/lib/msf/base/simple/auxiliary.rb b/lib/msf/base/simple/auxiliary.rb index 776210d4f0..dbaa6643da 100644 --- a/lib/msf/base/simple/auxiliary.rb +++ b/lib/msf/base/simple/auxiliary.rb @@ -42,6 +42,9 @@ module Auxiliary # def self.run_simple(mod, opts = {}) + # Clone the module to prevent changes to the original instance + mod = mod.replicant + # Import options from the OptionStr or Option hash. mod._import_extra_options(opts) diff --git a/lib/msf/base/simple/exploit.rb b/lib/msf/base/simple/exploit.rb index db70f24e7a..6cd132aacb 100644 --- a/lib/msf/base/simple/exploit.rb +++ b/lib/msf/base/simple/exploit.rb @@ -58,6 +58,9 @@ module Exploit # Trap and print errors here (makes them UI-independent) begin + # Clone the module to prevent changes to the original instance + exploit = exploit.replicant + # Import options from the OptionStr or Option hash. exploit._import_extra_options(opts) diff --git a/lib/msf/base/simple/payload.rb b/lib/msf/base/simple/payload.rb index b93c7af81b..c0968d464a 100644 --- a/lib/msf/base/simple/payload.rb +++ b/lib/msf/base/simple/payload.rb @@ -42,6 +42,9 @@ module Payload # def self.generate_simple(payload, opts) + # Clone the module to prevent changes to the original instance + payload = payload.replicant + # Import any options we may need payload._import_extra_options(opts) framework = payload.framework diff --git a/lib/msf/base/simple/post.rb b/lib/msf/base/simple/post.rb index 52a01166e5..83688d2b43 100644 --- a/lib/msf/base/simple/post.rb +++ b/lib/msf/base/simple/post.rb @@ -38,6 +38,9 @@ module Post # def self.run_simple(mod, opts = {}) + # Clone the module to prevent changes to the original instance + mod = mod.replicant + # Import options from the OptionStr or Option hash. mod._import_extra_options(opts)