← All artifacts

Persistence Mechanisms

macOS persistence mechanisms — LaunchAgents, LaunchDaemons, login items, cron, periodic, and login/logout hooks. Critical for malware analysis and account compromise investigations.

Status
available
CLI plugin
system.persistence
Categories
system, security

Overview

Persistence mechanisms are the primary technique attackers use to survive reboots and re-establish access on a compromised macOS host. Enumerating every persistence vector — and detecting unsigned, suspicious, or recently-modified entries — is foundational to incident response.

Analysis Tips

  • Modification time correlation: Match persistence entry mtime with other artifacts (FSEvents, Unified Logs) to identify install timing
  • Code signing: Verify signature on the executable referenced by Program / ProgramArguments — unsigned binaries in user-writable paths are a strong signal
  • Background Task Management (BTM): macOS 13+ consolidated persistence into BackgroundItems-v*.btm under /private/var/db/com.apple.backgroundtaskmanagement/. Review Bypass flags and recently-added items
  • LaunchAgent vs LaunchDaemon: Daemons run as root, agents as the logged-in user. Daemons in user-writable locations are unusual
  • Cron and periodic: Less common on modern macOS but still used by attackers — easy to miss
  • Other vectors: macfor also collects at jobs, shell startup files, launchd overrides, login/logout hooks, kernel and system extensions, authorization plugins, configuration profiles, emond rules, and StartupItems

Related Artifacts

References

Data sources

*.plistPlist

/Library/LaunchAgents/

System-wide user-context persistence (loaded at login for any user)

*.plistPlist

/Library/LaunchDaemons/

System-wide root-context persistence (loaded at boot)

*.plistPlist

~/Library/LaunchAgents/

Per-user persistence (loaded at user login)

BackgroundItems-v*.btmBinary plist (NSKeyedArchiver)

/private/var/db/com.apple.backgroundtaskmanagement/

System Background Task Management database (macOS 13+) — login items, agents, daemons in one consolidated store

backgrounditems.btmBinary plist

~/Library/Application Support/com.apple.backgroundtaskmanagementagent/

Per-user legacy login items (pre-macOS 13)

com.apple.loginitems.plistPlist

~/Library/Preferences/

Legacy login items (pre-macOS 13)

crontab filesText

/usr/lib/cron/tabs/, /etc/crontab

Scheduled cron jobs

periodic scriptsShell script

/etc/periodic/{daily,weekly,monthly}/

Periodic maintenance scripts