Module: Msf::Payload::Android::MeterpreterLoader

Includes:
Msf::Payload::Android, UUID::Options, Sessions::MeterpreterOptions
Defined in:
lib/msf/core/payload/android/meterpreter_loader.rb

Overview

Common loader for Android payloads that make use of Meterpreter.

Constant Summary

Constants included from Sessions::MeterpreterOptions

Sessions::MeterpreterOptions::TIMEOUT_COMMS, Sessions::MeterpreterOptions::TIMEOUT_RETRY_TOTAL, Sessions::MeterpreterOptions::TIMEOUT_RETRY_WAIT, Sessions::MeterpreterOptions::TIMEOUT_SESSION

Constants included from Rex::Payloads::Meterpreter::UriChecksum

Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_CONN, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_CONN_MAX_LEN, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_INITJ, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_INITN, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_INITP, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_INITW, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_INIT_CONN, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_MIN_LEN, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_MODES, Rex::Payloads::Meterpreter::UriChecksum::URI_CHECKSUM_UUID_MIN_LEN

Instance Method Summary collapse

Methods included from Sessions::MeterpreterOptions

#meterpreter_logging_config, #mettle_logging_config

Methods included from UUID::Options

#generate_payload_uuid, #generate_uri_uuid_mode, #record_payload_uuid, #record_payload_uuid_url

Methods included from Rex::Payloads::Meterpreter::UriChecksum

#generate_uri_checksum, #generate_uri_uuid, #process_uri_resource, #uri_checksum_lookup

Methods included from Msf::Payload::Android

#fix_dex_header, #generate, #generate_config, #generate_default_stage, #generate_jar, #generate_stage, #java_string, #sign_jar, #signing_key

Methods included from TransportConfig

#transport_config_bind_named_pipe, #transport_config_bind_tcp, #transport_config_reverse_http, #transport_config_reverse_https, #transport_config_reverse_ipv6_tcp, #transport_config_reverse_named_pipe, #transport_config_reverse_tcp, #transport_config_reverse_udp, #transport_uri_components

Instance Method Details

#initialize(info = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/msf/core/payload/android/meterpreter_loader.rb', line 18

def initialize(info={})
  super(update_info(info,
    'Name'          => 'Android Meterpreter & Configuration',
    'Description'   => 'Android-specific meterpreter generation',
    'Author'        => ['OJ Reeves'],
    'Platform'      => 'android',
    'Arch'          => ARCH_DALVIK,
    'PayloadCompat' => {'Convention' => 'http https'},
    'Stage'         => {'Payload' => ''}
  ))
end

#stage_meterpreter(opts = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/msf/core/payload/android/meterpreter_loader.rb', line 34

def stage_meterpreter(opts={})
  clazz = 'androidpayload.stage.Meterpreter'
  metstage = MetasploitPayloads.read("android", "metstage.jar")
  met = MetasploitPayloads.read("android", "meterpreter.jar")

  # Name of the class to load from the stage, the actual jar to load
  # it from, and then finally the meterpreter stage
  blocks = [
    java_string(clazz),
    java_string(metstage),
    java_string(met),
    java_string(generate_config(opts))
  ]

  (blocks + [blocks.length]).pack('A*' * blocks.length + 'N')
end

#stage_payload(opts = {}) ⇒ Object



30
31
32
# File 'lib/msf/core/payload/android/meterpreter_loader.rb', line 30

def stage_payload(opts={})
  stage_meterpreter(opts)
end