Module: Msf::Payload::Java::PayloadOptions

Included in:
BindTcp, ReverseHttp, ReverseTcp
Defined in:
lib/msf/core/payload/java/payload_options.rb

Instance Method Summary collapse

Instance Method Details

#initialize(info = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/msf/core/payload/java/payload_options.rb', line 6

def initialize(info = {})
  super(info)
  register_advanced_options(
    [
      Msf::OptBool.new('JavaMeterpreterDebug', [ false, "Run the payload in debug mode, with logging enabled" ]),
      Msf::OptInt.new('Spawn', [true, "Number of subprocesses to spawn", 2])
    ]
  )
end

#stager_config(opts = {}) ⇒ Object

Generate default configuration that is to be included in the stager.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msf/core/payload/java/payload_options.rb', line 19

def stager_config(opts={})
  ds = opts[:datastore] || datastore
  spawn = ds["Spawn"] || 2
  c =  ""
  if ds["JavaMeterpreterDebug"]
    spawn = 0
    c << "StageParameters=NoRedirect\n"
  end
  c << "Spawn=#{spawn}\n"
  c
end