Always clone modules before running them via the simplified wrappers.

This prevents changes to the datastore or instance variables from
being carried over into a second run
unstable
HD Moore 2012-02-29 01:34:29 -06:00
parent d9788db7bb
commit 9975d5a220
4 changed files with 12 additions and 0 deletions

View File

@ -42,6 +42,9 @@ module Auxiliary
# #
def self.run_simple(mod, opts = {}) 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. # Import options from the OptionStr or Option hash.
mod._import_extra_options(opts) mod._import_extra_options(opts)

View File

@ -58,6 +58,9 @@ module Exploit
# Trap and print errors here (makes them UI-independent) # Trap and print errors here (makes them UI-independent)
begin begin
# Clone the module to prevent changes to the original instance
exploit = exploit.replicant
# Import options from the OptionStr or Option hash. # Import options from the OptionStr or Option hash.
exploit._import_extra_options(opts) exploit._import_extra_options(opts)

View File

@ -42,6 +42,9 @@ module Payload
# #
def self.generate_simple(payload, opts) 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 # Import any options we may need
payload._import_extra_options(opts) payload._import_extra_options(opts)
framework = payload.framework framework = payload.framework

View File

@ -38,6 +38,9 @@ module Post
# #
def self.run_simple(mod, opts = {}) 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. # Import options from the OptionStr or Option hash.
mod._import_extra_options(opts) mod._import_extra_options(opts)