Safeguard
Application Security•

Detecting Malicious Login Items on macOS (T1547.015)

Login items launch apps at macOS login, and two different mechanisms create them, one of them hidden from System Preferences. MITRE T1547.015 explained, with detection and a review command.

Safeguard Security Team
3 min read

Login items are applications, documents, folders or server connections that macOS launches when a user logs in. MITRE tracks their abuse as T1547.015, with Persistence and Privilege Escalation as the tactics and macOS as the platform.

How attackers use it

MITRE describes two ways a login item gets created, and they behave differently.

  • Shared file list items can be set with scripting languages such as AppleScript. They are visible in System Preferences, can hide the application when it launches, and are run through LaunchServices rather than launchd.
  • Service Management Framework items use the API call SMLoginItemSetEnabled. They use launchd, are not visible in System Preferences, and can only be removed by the application that created them.

Adversaries can use AppleScript and native API calls to create a login item that spawns a malicious executable. On macOS before 10.5, AppleScript could send Apple events to the System Events process, which holds a dictionary for editing login items. MITRE notes that this adds the path to a list file under ~/Library/Application Support/com.apple.backgroundtaskmanagementagent/backgrounditems.btm.

Login items can also launch executables that control the system remotely, or help gain privileges by prompting for user credentials.

How to detect it

MITRE's detection strategy points at several artifacts.

  • File creation or modification of backgrounditems.btm.
  • New executables in Contents/Library/LoginItems/ inside app bundles.
  • Use of the SMLoginItemSetEnabled API.
  • Suspicious processes that start after login without any user action.

The behavioral pivots are anomalous Apple events, odd parent and child process pairs, and login-triggered execution chains.

How to reduce the risk

MITRE states this technique cannot be easily mitigated with preventive controls, because it abuses a system feature. That makes inventory the main defense. Keep a list of expected login items per role, and review what a device actually has against it.

Check your own environment

Read-only commands for macOS Terminal. The first lists the background task management records on current macOS versions, and the second lists per-user launch agents.

sfltool dumpbtm
ls -la ~/Library/LaunchAgents

Look for items you cannot tie to an application you installed, especially ones that point to user writable folders.

Quick check

Why are Service Management Framework login items harder for a user to spot?

They are not visible in System Preferences, and only the application that created them can remove them.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.