Detections · Harmful behavior
Mac malware persistence: how a program starts again on its own
Persistence is how a program arranges to run again after you quit it, log out or restart your Mac. A stealer that runs once takes what it finds; one that persists keeps watching, keeps collecting and comes back after every reboot. It is also one of the easiest traces to find.
Updated November 25, 2026 · 172 detections in this category
In short
How a program arranges to start again on its own: launch agents and daemons, login items, scheduled jobs.
MacVigil has 172 detections in this category. It reads the file to find them and never runs it.
What persistence means on a Mac
macOS starts many programs by itself: background services when the Mac boots, helpers when you log in, tasks on a schedule, code that loads when Terminal opens. The attacker gains a foothold that survives a restart, without you ever opening the app again.
Persistence steals nothing on its own. It turns a single infection into a lasting one, so it usually comes with something else: a hidden program, a download, a collector.
How Mac malware does it
- A launch agent or launch daemon written to
~/Library/LaunchAgents,/Library/LaunchAgentsor/Library/LaunchDaemons, withRunAtLoadorKeepAliveso it starts at login or boot and restarts if killed, then loaded withlaunchctl loadorlaunchctl bootstrap. - A service named like an Apple one (
com.apple.…) or like a known vendor’s, pointing at a program hidden in/tmp, a dot-folder or another out-of-sight place. - A login item added through AppleScript and System Events, or through the login item interfaces, sometimes marked hidden.
- Lines appended to
~/.zshrc,~/.bash_profileor other shell startup files, or a prompt hook and a redirectedZDOTDIR, so code runs each time a terminal opens. - Scheduled jobs: a
crontabentry such as@reboot, scripts dropped in/etc/periodic, or aStartIntervalthat relaunches a task at intervals. - Plug-ins the system loads by itself: Spotlight importers, color pickers, screen savers, Folder Actions, input methods, authorization plug-ins in
SecurityAgentPlugins, Python startup modules such assitecustomize.py. - A tampered Dock icon: the familiar app is replaced by a wrapper that opens it and also starts a downloaded program.
- Editor and assistant settings that run a command when a folder opens or on an event, git hooks redirected to another folder, and npm lifecycle scripts.
- Covering tracks: silencing the notice macOS shows when a new background item appears, rewriting a planted file’s dates, or hiding a new administrator account.
What MacVigil looks for
MacVigil reads the file and never runs it. It looks for the pieces of a startup mechanism and, above all, for what ties them together: the same function that opens a launch folder and writes a service declaration into it, the same script that copies a file to a path and registers that same path as a login item, the program a startup entry is set to launch and where that program lives.
A single ingredient is usually not enough. A mention of RunAtLoad or of a launch folder on its own is recorded as a clue, not a verdict, and when the pieces are only separate mentions, MacVigil says so and does not claim they ran. A login item registered by a script is only treated as most serious when the copied program’s own analysis finds it harmful; otherwise it is kept for review, because installers do the same.
In installer packages, it checks what lands in launch folders and whether a service name imitates Apple’s.
When it is normal
Plenty of honest software starts on its own. Menu bar utilities, backup tools, cloud sync clients, VPNs and updaters install launch agents or login item helpers in Contents/Library/LoginItems, and use the modern SMAppService interface to register them. Developer setup scripts edit shell profiles. What matters is who signed the program, where the program being launched lives, and whether the startup entry is tied to something harmful.
How to check your Mac
- Open System Settings > General > Login Items (Login Items & Extensions on recent macOS). Review “Open at Login” and “Allow in the Background”, and turn off anything you do not recognize.
- In Finder, choose Go > Go to Folder and look in
~/Library/LaunchAgents,/Library/LaunchAgentsand/Library/LaunchDaemons. Read each unfamiliar.plistwithplutil -pand note theProgramArgumentspath. - Check who signed that program with
codesign -dv --verbose=4 /path/to/programin Terminal. A program in a hidden folder or in/tmp, unsigned or ad hoc signed, deserves suspicion. - Run
crontab -land look at the end of~/.zshrcand~/.zprofilefor lines you did not add. - For a full list of background items macOS knows about, run
sudo sfltool dumpbtm.
Related categories
- Download and execute: Code fetched from the network and run here: what executes is decided by a server, not by the file that was checked.
- Hidden payload: A second program carried out of sight: encoded, encrypted, appended after the file's end or tucked into resources.
- Masquerading: A file that presents itself as something else: a misleading name, icon or extension, a label imitating Apple.
- Privilege escalation: Ways to obtain administrator or root rights: sudo, authorization requests, setuid programs, account changes.
On the blog
Know what a file does before you open it
MacVigil reads any app, disk image, installer or script without running it, and shows the evidence behind every finding. Nothing leaves your Mac.
Free for 7 days, then $29.95 a year for 2 Macs, a launch price: the regular price will be $59 a year. Requires macOS 15 Sequoia or later on a Mac with Apple silicon.
More: all detection categories · what MacVigil detects · the blog