Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 1.78 KB

T1152.md

File metadata and controls

36 lines (21 loc) · 1.78 KB

T1152 - Launchctl

Launchctl controls the macOS launchd process which handles things like launch agents and launch daemons, but can execute other commands or programs itself. Launchctl supports taking subcommands on the command-line, interactively, or even redirected from standard input. By loading or reloading launch agents or launch daemons, adversaries can install persistence or execute changes they made (Citation: Sofacy Komplex Trojan). Running a command from launchctl is as simple as launchctl submit -l -- /Path/to/thing/to/execute "arg" "arg" "arg". Loading, unloading, or reloading launch agents or launch daemons can require elevated privileges.

Adversaries can abuse this functionality to execute code or even bypass whitelisting if launchctl is an allowed process.

Detection: Knock Knock can be used to detect persistent programs such as those installed via launchctl as launch agents or launch daemons. Additionally, every launch agent or launch daemon must have a corresponding plist file on disk somewhere which can be monitored. Monitor process execution from launchctl/launchd for unusual or unknown processes.

Platforms: macOS

Data Sources: File monitoring, Process Monitoring, Process command-line parameters

Defense Bypassed: Application whitelisting, Process whitelisting, Whitelisting by file name or path

Permissions Required: User, Administrator

Remote Support: No

Atomic Tests


Atomic Test #1 - Launchctl

Utilize launchctl

Supported Platforms: macOS

Run it with sh!

launchctl submit -l evil -- /Applications/Calculator.app/Contents/MacOS/Calculator