Investigating Mac Persistence with BTM
Use the macOS BTM store in a malware or intrusion case: items with no developer, hidden items, unregistered plists, the notification, and a worked example.
Offline · nothing is uploaded · macOS 13 to 26
Since macOS 13, Background Task Management records every login item, launch agent and daemon a Mac registers. See each one with its user, developer, team ID and disposition, joined to its launch plist, and what deserves a look first.
Drop a BTM store, a dumpbtm text or a collection
BackgroundItems-v*.btm, sudo sfltool dumpbtm output, a legacy backgrounditems.btm, or a .zip, .tar.gz or folder holding /private/var/db and the launch plists. User records and launch plists in a collection name the users and complete each item.
Runs entirely in your browser: files are never uploaded.
The store sits in /private/var/db/com.apple.backgroundtaskmanagement, which macOS protects even from root: give Terminal Full Disk Access first (System Settings › Privacy & Security › Full Disk Access), then run one of these as an administrator.
cd ~/Desktop && sudo sh -c 'tar -czf "btm-$(hostname -s).tar.gz" /private/var/db/com.apple.backgroundtaskmanagement /private/var/db/dslocal/nodes/Default/users /Library/LaunchAgents /Library/LaunchDaemons /Users/*/Library/LaunchAgents /Users/*/Library/Application\ Support/com.apple.backgroundtaskmanagementagent /Library/Preferences/SystemConfiguration/preferences.plist /System/Library/CoreServices/SystemVersion.plist 2>/dev/null; sfltool dumpbtm > "btm-$(hostname -s).txt"; ls -l btm-*'Archives the BTM folder, the local user records, the launch plists and the host files, and saves sfltool's dump next to it. Drop both files here; the dump is matched to the store record by record.
mkdir -p ~/Desktop/btm_case
sudo sh -c 'cp -p /private/var/db/com.apple.backgroundtaskmanagement/BackgroundItems-v*.btm "$0"' ~/Desktop/btm_case
sudo chown "$(id -un)" ~/Desktop/btm_case/*.btm
ls -l ~/Desktop/btm_caseCopies every BackgroundItems-v*.btm file of the folder (the number changes between macOS releases) into ~/Desktop/btm_case, keeping their modification times, and makes the copies yours so that a browser can open them.
sudo sfltool dumpbtm > ~/Desktop/btm.txtWhen you can run a command but not copy files: sfltool prints the same records as text. Drop the text file here.
/private/var/db/com.apple.backgroundtaskmanagement/BackgroundItems-v<N>.btm macOS 13 and later, every user
/Users/<user>/Library/Application Support/com.apple.backgroundtaskmanagementagent/backgrounditems.btm macOS 10.13–12, per user
/private/var/db/dslocal/nodes/Default/users/<name>.plist local users: name, UID, generateduid
/Library/LaunchAgents /Library/LaunchDaemons /Users/<user>/Library/LaunchAgents launch plistsThe store keeps every user's items. Before macOS 13, login items were kept per user in the legacy store.
Reference
Since macOS 13 Ventura, the backgroundtaskmanagementd daemon keeps a record of the login items, launch agents and launch daemons it sees, with the developer name and team ID taken from the code signature and a disposition: enabled or not, allowed or not, visible or hidden, notified or not. System Settings › General › Login Items is built from it, and so are the “Background Items Added” notifications.
The records sit in /private/var/db/com.apple.backgroundtaskmanagement/BackgroundItems-v<N>.btm, a binary property list written with NSKeyedArchiver, one section per user; sudo sfltool dumpbtm prints them as text. For an investigation it answers what was set to run on the Mac, for which user, signed by which developer, and whether it is still switched on.
FAQ
No. The page reads the files in your browser with JavaScript in a Web Worker; nothing is sent to a server. You can disconnect from the network once the page has loaded.
macOS protects /private/var/db/com.apple.backgroundtaskmanagement with its privacy controls, even from root. Terminal needs Full Disk Access for cp, tar or sfltool to read it.
Both when you can. The store is the evidence itself and keeps every field; the dump is what sfltool chooses to print, but it is all you need when you can run a command and cannot copy files. Dropped together, they are matched record by record.
The BTM store of macOS 13 Ventura and later (the number in BackgroundItems-v<N>.btm changes between releases; records are recognised by shape, not by version) and the legacy per-user login items store of macOS 10.13 to 12.
Export /private/var/db, /Library and the home folders with Disk Image Parser or another forensic tool and drop the folder here. The page also accepts files handed over by Disk Image Parser, tab to tab, without a server.
BTM had no developer to attach to the item, usually because its program is not signed with a Developer ID. The tool flags items that have neither a developer name nor a team ID.
Use the macOS BTM store in a malware or intrusion case: items with no developer, hidden items, unregistered plists, the notification, and a worked example.
Location, file versions and format of the macOS BTM store, how its records map to users, and the legacy backgrounditems.btm used from macOS 10.13 to 12.
How the BTM disposition differs from launchd's disabled.plist overrides on macOS, what each records, and how to read the combinations in an investigation.