Module: Msf::Util::EXE::OSX::X64::ClassMethods

Included in:
Msf::Util::EXE::OSX::X64
Defined in:
lib/msf/util/exe/osx/x64.rb

Instance Method Summary collapse

Instance Method Details

#to_osx_x64_macho(framework, code, opts = {}) ⇒ String

Create an x86_64 OSX Mach-O containing the payload provided in code

self.to_osx_x64_macho

Parameters:

  • framework (Msf::Framework)

    The framework of you want to use

  • code (String)
  • opts (Hash) (defaults to: {})
  • [String] (Hash)

    a customizable set of options

Returns:

  • (String)


18
19
20
21
22
23
24
25
26
# File 'lib/msf/util/exe/osx/x64.rb', line 18

def to_osx_x64_macho(framework, code, opts = {})
  set_template_default(opts, "template_x64_darwin.bin")

  macho = self.get_file_contents(opts[:template])
  bin = self.find_payload_tag(macho,
          "Invalid Mac OS X x86_64 Mach-O template: missing \"PAYLOAD:\" tag")
  macho[bin, code.length] = code
  macho
end