T1547.015 IBM QRadar · QRadar

Detect Login Items in IBM QRadar

Adversaries may add login items to execute upon user login to gain persistence or escalate privileges. Login items are applications, documents, folders, or server connections that are automatically launched when a user logs in. Login items can be added via a shared file list or Service Management Framework. Shared file list login items can be set using scripting languages such as AppleScript, whereas the Service Management Framework uses the API call SMLoginItemSetEnabled. Login items installed using the Service Management Framework leverage launchd, are not visible in the System Preferences, and can only be removed by the application that created them. Adversaries can utilize AppleScript and Native API calls to create a login item to spawn malicious executables.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1547 Boot or Logon Autostart Execution
Sub-technique
T1547.015 Login Items
Canonical reference
https://attack.mitre.org/techniques/T1547/015/

QRadar Detection Query

IBM QRadar (QRadar)
sql
SELECT
  DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS "Event Time",
  LOGSOURCENAME(logsourceid) AS "Log Source",
  username AS "Username",
  sourceip AS "Source IP",
  QIDNAME(qid) AS "Event Name",
  "ProcessName" AS "Process Name",
  "CommandLine" AS "Command Line",
  "ParentProcessName" AS "Parent Process",
  "FilePath" AS "File Path"
FROM events
WHERE
  starttime > (CURRENT_TIMESTAMP - 86400000)
  AND (
    /* osascript login item via AppleScript / System Events */
    (
      ("ProcessName" ILIKE '%osascript%' OR "CommandLine" ILIKE '%osascript%')
      AND (
        "CommandLine" ILIKE '%login item%'
        OR "CommandLine" ILIKE '%System Events%'
        OR "CommandLine" ILIKE '%make login item%'
      )
    )
    /* System Events process with login item arguments */
    OR (
      "ProcessName" ILIKE '%System Events%'
      AND (
        "CommandLine" ILIKE '%login item%'
        OR "CommandLine" ILIKE '%loginitem%'
        OR "CommandLine" ILIKE '%LoginItem%'
      )
    )
    /* sfltool adding login items */
    OR (
      ("ProcessName" ILIKE '%sfltool%' OR "CommandLine" ILIKE '%sfltool%')
      AND "CommandLine" ILIKE '%add%'
      AND "CommandLine" ILIKE '%login%'
    )
    /* File creation/modification in login item paths */
    OR (
      "EventCategory" IN ('File Created', 'File Modified', 'File Written')
      AND (
        "FilePath" ILIKE '%backgrounditems.btm%'
        OR "FilePath" ILIKE '%com.apple.backgroundtaskmanagementagent%'
        OR "FilePath" ILIKE '%com.apple.loginitems%'
        OR "FilePath" ILIKE '%Application Support/com.apple.backgroundtaskmanagementagent%'
      )
    )
  )
ORDER BY starttime DESC
high severity medium confidence

Detects macOS Login Items persistence (T1547.015) by querying for osascript/System Events AppleScript login item manipulation, sfltool login item additions, and file writes to Background Task Manager and Login Items plist paths. Queries both process execution and file activity event types from macOS endpoint log sources.

Data Sources

macOS Endpoint Detection (CrowdStrike Falcon, Carbon Black, SentinelOne via QRadar DSM)Jamf Pro or similar MDM with process/file event forwardingQRadar macOS custom DSM with osquery or Elastic Agent

Required Tables

events

False Positives & Tuning

  • Legitimate software installers and application first-run setups that use AppleScript or osascript to register login items, including commercial productivity software (Dropbox, OneDrive, Zoom)
  • IT management and MDM platform agents (Jamf, Mosyle) that programmatically configure login items as part of policy enforcement or software deployment workflows
  • macOS system processes and OS updates that legitimately modify the backgrounditems.btm database or com.apple.loginitems plist as part of system configuration
  • Security tools that use sfltool for audit or inventory purposes during compliance scanning
Download portable Sigma rule (.yml)

Other platforms for T1547.015


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Add Login Item via AppleScript (Shared File List)

    Expected signal: Sysmon for macOS Event ID 1: Process Create for osascript with CommandLine containing 'login item' and 'System Events'. File modification event on ~/Library/Application Support/com.apple.backgroundtaskmanagementagent/backgrounditems.btm. Unified Log entry in com.apple.backgroundtaskmanagement subsystem.

  2. Test 2Add Hidden Login Item via AppleScript

    Expected signal: Sysmon for macOS Event ID 1: Process Create for osascript with CommandLine containing 'hidden:true'. File modification of backgrounditems.btm. Unified Log entry showing the hidden login item creation.

  3. Test 3Enumerate Login Items via AppleScript (Reconnaissance)

    Expected signal: Sysmon for macOS Event ID 1: Process Create for osascript with CommandLine containing 'login item' and 'System Events'. No file modification events (read-only operation).

  4. Test 4Login Item via sfltool (Shared File List Tool)

    Expected signal: Sysmon for macOS Event ID 1: Process Create for sfltool with CommandLine containing 'add-item' and the shared file list name. File modification of backgrounditems.btm. Unified Log entries for shared file list modifications.

Unlock Pro Content

Get the full detection package for T1547.015 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections