Class: MetasploitPayloads::Mettle

Inherits:
Object
  • Object
show all
Defined in:
lib/metasploit_payloads/mettle.rb,
lib/metasploit_payloads/mettle/error.rb,
lib/metasploit_payloads/mettle/version.rb

Defined Under Namespace

Classes: Error, NotFoundError

Constant Summary collapse

CMDLINE_MAX =
2000
CMDLINE_SIG =
'DEFAULT_OPTS'.freeze
VERSION =
'1.0.36'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(triple, config = {}) ⇒ Mettle

Returns a new instance of Mettle.



28
29
30
31
# File 'lib/metasploit_payloads/mettle.rb', line 28

def initialize(triple, config={})
  @platform = triple.clone
  @config = config.clone
end

Instance Attribute Details

#configObject

Config is a hash. Valid keys are:

:uri to connect to
:uuid of the payload
:debug to enable
:log_file to log to places other than stderr


26
27
28
# File 'lib/metasploit_payloads/mettle.rb', line 26

def config
  @config
end

Class Method Details

.versionObject



6
7
8
# File 'lib/metasploit_payloads/mettle/version.rb', line 6

def self.version
  VERSION
end

Instance Method Details

#to_binary(format = :process_image) ⇒ Object

Available formats are :process_image, :dylib, :dylib_sha1 and :exec



36
37
38
39
40
41
42
43
# File 'lib/metasploit_payloads/mettle.rb', line 36

def to_binary(format=:process_image)
  bin = self.class.read(@platform, format)
  unless @config.empty?
    params = generate_argv
    bin = add_args(bin, params)
  end
  bin
end