Launch Agent/Daemon Execution Via Launchctl
A Sigma rule for process creation on macOS, by Pratinav Chandra.
medium 3 ATT&CK techniques 1 program it names 5 everyday examples trip it
What it looks for
detection:
selection:
CommandLine|contains:
- 'submit'
- 'load'
- 'start'
Image|endswith: '/launchctl'
condition: selection
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Pratinav Chandra, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
Command lines that trip it
Activate a user-specific agent to be loaded into launchd whenever the user logs in on the page for launchctl
launchctl load ~/Library/LaunchAgents/my_script.plistIdentifyActivate an agent which requires root privileges to run and/or should be loaded whenever any user logs in (note the absence of ~ in the path) on the page for launchctl
sudo launchctl load /Library/LaunchAgents/root_script.plistIdentifyActivate a system-wide daemon to be loaded whenever the system boots up (even if no user logs in) on the page for launchctl
sudo launchctl load /Library/LaunchDaemons/system_daemon.plistIdentify