Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:rapid7/metasploit-framework into …

…release/2012031401
  • Loading branch information...
commit 8afa25e3593b65c44637ad67136b1e94848077c1 2 parents b5fea8c + 1a364df
@hmoore-r7 hmoore-r7 authored
View
8 lib/msf/base/simple/exploit.rb
@@ -72,13 +72,16 @@ def self.exploit_simple(oexploit, opts)
"You must specify a payload.", caller
end
+ # Verify the options
+ exploit.options.validate(exploit.datastore)
+
# Start it up
driver = ExploitDriver.new(exploit.framework)
# Initialize the driver instance
driver.exploit = exploit
driver.payload = exploit.framework.modules.create(opts['Payload'])
-
+
# Set the force wait for session flag if the caller requested force
# blocking. This is so that passive exploits can be blocked on from
# things like the cli.
@@ -98,6 +101,9 @@ def self.exploit_simple(oexploit, opts)
# Force the payload to share the exploit's datastore
driver.payload.share_datastore(driver.exploit.datastore)
+ # Verify the payload options
+ driver.payload.options.validate(driver.payload.datastore)
+
# If we still have no target index, try to use the datastore's index
target_idx = opts['Target'] || exploit.default_target
View
6 lib/msf/core/encoded_payload.rb
@@ -144,6 +144,9 @@ def encode
'core', LEV_1)
next
end
+
+ # Import the datastore from payload (and likely exploit by proxy)
+ self.encoder.share_datastore(pinst.datastore)
# If we have any encoder options, import them into the datastore
# of the encoder.
@@ -270,6 +273,9 @@ def generate_sled
nops.each { |nopname, nopmod|
# Create an instance of the nop module
self.nop = nopmod.new
+
+ # Propagate options from the payload and possibly exploit
+ self.nop.share_datastore(pinst.datastore)
# The list of save registers
save_regs = (reqs['SaveRegisters'] || []) + (pinst.save_registers || [])
Please sign in to comment.
Something went wrong with that request. Please try again.