OSMR
Debug
Intro to macOS
OS Architecture
High-Level OS Architecture XNU: Mach microkernel, Components from BSD, IOKit, Kernel Exte...
mach-O File
Universal Binaries Mach-O, a file format for various program files on all Apple platform. Ran...
Objective-C
Primary language for develeping macOS application. Objective-C extends the standard C programmi...
Binary Analysis Tools
Shellcode AMD64
AMD64 Shellcoding
Convention: RDI: arg1 RSI: arg2 RDX: arg3 RCX: arg4 R8: arg5 R9: arg6 Stack: Starti...
Command Execution
Use /bin/zsh, full command /bin/zsh -c <COMMAND> Need execve syscall RDI arg1: /bin/zsh R...
Bind Shell
C code for a bind shell: socket(2,1,0) reserve space for sockaddr_in: ...
Shellcode Apple Silicon
Dylib Injection
Mach Microkernel
Concept
Mach: One of the fundamental components of macOS. Limited to managing only the most basic tasks, ...
Injection via Mach Task Port
Remote Code Injection Get the SEND right of the task port of the process Allocate m...
Inject execve Shellcode
Use codesign to verify the code signature of the app and its entitlement. The entitlement...
Inject a Dylib
Prompt Mach Thread to POSIX Thread Threads are implemented in the Mach kernel, and each thread b...