launchd Persistence
What is launchd Persistence?
launchd PersistencemacOS persistence technique that installs a LaunchDaemon or LaunchAgent property list so launchd executes attacker code at boot, login, or on a trigger.
launchd persistence abuses macOS's launchd init system (PID 1), which starts and supervises services. Attackers drop a property-list (.plist) job in one of several directories, and the location decides the privilege and trigger. MITRE ATT&CK splits the technique in two: LaunchAgent (T1543.001) in /Library/LaunchAgents (every user at login) or ~/Library/LaunchAgents (current user), and LaunchDaemon (T1543.004) in /Library/LaunchDaemons, which runs at boot as root with no user session.
The plist defines a Label, a ProgramArguments command, and triggers such as RunAtLoad, KeepAlive (relaunch if killed), StartInterval, WatchPaths, or StartCalendarInterval. launchd then keeps the process alive, giving the implant reboot-survival and self-healing in one primitive. Real families relied on it: Silver Sparrow (2021, found on ~30,000 Macs, native Apple-silicon binary) installed a per-user LaunchAgent; XCSSET, OSX/Shlayer, and Bundlore adware use the same mechanism, typically masquerading the Label as an Apple service like com.apple.softwareupdate.
Defences: baseline the Launch*Daemon/Agent directories and alert on new or unsigned entries; macOS Ventura's Background Task Management (sfltool dumpbtm) logs and notifies the user when a persistence item is registered; hunt with EDR, fs_usage, or KnockKnock; and use SIP, TCC, and MDM configuration profiles to restrict who can write to system LaunchDaemons paths and to require signed, notarised executables.
flowchart TD
ATT[Attacker code] --> DROP{Write .plist to}
DROP -->|/Library/LaunchDaemons| D[LaunchDaemon<br/>boot, root — T1543.004]
DROP -->|/Library/LaunchAgents| A[LaunchAgent<br/>login, user — T1543.001]
D --> LD[launchd supervises]
A --> LD
LD -->|RunAtLoad / KeepAlive| EXEC[Implant runs<br/>+ restarts if killed]
EXEC -.detected by.-> DEF[BTM / KnockKnock / EDR]● Examples
- 01
Dropping com.apple.softwareupdated.plist in /Library/LaunchDaemons that launches /tmp/updater at boot.
- 02
Per-user LaunchAgent that re-runs a Python implant at every login via RunAtLoad.
● Frequently asked questions
What is launchd Persistence?
macOS persistence technique that installs a LaunchDaemon or LaunchAgent property list so launchd executes attacker code at boot, login, or on a trigger. It belongs to the Attacks & Threats category of cybersecurity.
What does launchd Persistence mean?
macOS persistence technique that installs a LaunchDaemon or LaunchAgent property list so launchd executes attacker code at boot, login, or on a trigger.
How do you defend against launchd Persistence?
Defences for launchd Persistence typically combine technical controls and operational practices, as detailed in the full definition above.
What are other names for launchd Persistence?
Common alternative names include: LaunchDaemon persistence, LaunchAgent persistence.