macOS endpoint detection and response¶
macOS endpoint protection combines Apple’s built-in security frameworks (Endpoint Security API, XProtect, MRT) with third-party tooling. Detection focuses on ESF events (process executions, file operations, mount events), notarisation and Gatekeeper decisions, and suspicious entitlement usage. Common attack vectors include abuse of AppleScript, JXA (JavaScript for Automation), and persistence through launch agents and TCC database manipulation.
Process monitoring¶
Technique |
Description |
Tools/Commands |
|---|---|---|
ESF (Endpoint Security Framework) |
Apple’s official API for real-time process/event monitoring |
|
XPC service analysis |
Detect suspicious inter-process communication |
|
Mach-O binary inspection |
Check for unsigned or hooked binaries |
|
Memory protection¶
Technique |
Description |
Implementation |
|---|---|---|
System Integrity Protection (SIP) |
Prevents root from modifying protected directories |
|
Library validation |
Blocks injection of unsigned libraries |
Entitlements: |
Kernel Extensions (KEXT) blocking |
Monitor unauthorised kext loading |
|
Behavioural detection¶
Technique |
Example |
Detection method |
|---|---|---|
Persistence mechanisms |
LaunchAgents, cron jobs |
|
Fileless attacks |
Python/Ruby in-memory execution |
Monitor |
API hook detection |
|
|
Network monitoring¶
sudo lsof -i -P -n | grep ESTABLISHED
sudo nettop -P -m route