Class: Wpxf::Payloads::MeterpreterReverseTcp

Inherits:
Wpxf::Payload show all
Includes:
Wpxf, Options
Defined in:
lib/wpxf/payloads/meterpreter_reverse_tcp.rb

Overview

A Meterpreter reverse TCP payload generator.

Instance Attribute Summary

Attributes included from Options

#datastore, #options

Attributes inherited from Wpxf::Payload

#queued_commands

Instance Method Summary collapse

Methods included from Options

#all_options_valid?, #get_option, #get_option_value, #missing_options, #normalized_option_value, #option_valid?, #option_value?, #register_advanced_options, #register_evasion_options, #register_option, #register_options, #scoped_option_change, #set_option_value, #unregister_option, #unset_option

Methods included from Wpxf

app_path, build_module_list, change_stdout_sync, custom_modules_path, data_directory, databases_path, gemspec, home_directory, load_custom_modules, load_module, modules_path, payloads_path, version

Methods inherited from Wpxf::Payload

#check, #cleanup, #encoded, #enqueue_command, #escape_single_quotes, #generate_vars, #php_preamble, #post_exploit, #prepare, #random_var_name

Constructor Details

#initializeMeterpreterReverseTcp

Returns a new instance of MeterpreterReverseTcp.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/wpxf/payloads/meterpreter_reverse_tcp.rb', line 9

def initialize
  super

  register_options([
    StringOption.new(
      name: 'lhost',
      required: true,
      desc: 'The address of the host listening for a connection'
    ),
    PortOption.new(
      name: 'lport',
      required: true,
      default: 4444,
      desc: 'The port being used to listen for incoming connections'
    )
  ])
end

Instance Method Details

#constantsObject



39
40
41
42
43
44
# File 'lib/wpxf/payloads/meterpreter_reverse_tcp.rb', line 39

def constants
  {
    'ip'   => host,
    'port' => lport
  }
end

#hostObject



27
28
29
# File 'lib/wpxf/payloads/meterpreter_reverse_tcp.rb', line 27

def host
  escape_single_quotes(datastore['lhost'])
end

#lportObject



31
32
33
# File 'lib/wpxf/payloads/meterpreter_reverse_tcp.rb', line 31

def lport
  normalized_option_value('lport')
end

#obfuscated_variablesObject



46
47
48
# File 'lib/wpxf/payloads/meterpreter_reverse_tcp.rb', line 46

def obfuscated_variables
  super + %w[ip port f s_type s res len a b suhosin_bypass]
end

#rawObject



35
36
37
# File 'lib/wpxf/payloads/meterpreter_reverse_tcp.rb', line 35

def raw
  DataFile.new('php', 'meterpreter_reverse_tcp.php').php_content
end