T1547.007 Sumo Logic CSE · Sumo

Detect Re-opened Applications in Sumo Logic CSE

Adversaries may modify plist files to automatically run an application when a user logs in on macOS. When a user logs out or restarts via the macOS GUI, a prompt with a checkbox to 'Reopen windows when logging back in' causes all currently open applications to be added to a property list file named com.apple.loginwindow.[UUID].plist within ~/Library/Preferences/ByHost/. Adversaries can establish persistence by adding a malicious application path to this plist file to execute payloads when a user logs in.

MITRE ATT&CK

Tactic
Persistence Privilege Escalation
Technique
T1547 Boot or Logon Autostart Execution
Sub-technique
T1547.007 Re-opened Applications
Canonical reference
https://attack.mitre.org/techniques/T1547/007/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
_sourceCategory=macos* OR _sourceCategory=osquery* OR _sourceCategory=endpoint* "com.apple.loginwindow" "Library/Preferences/ByHost"
| parse field=target_path "*/Library/Preferences/ByHost/*" as pref_path nodrop
| parse field=message "com.apple.loginwindow.*" as loginwindow_file nodrop
| where (action = "UPDATED" OR action = "CREATED" OR action = "MODIFIED" OR action = "FileCreated" OR action = "FileModified")
| where target_path matches "*/Library/Preferences/ByHost/com.apple.loginwindow*"
| fields _time, host, target_path, action, md5, sha256, user
| sort - _time
medium severity medium confidence

Detects creation or modification of com.apple.loginwindow plist files within macOS ByHost preferences directory. Adversaries add malicious application paths to these files to achieve persistence at user login.

Data Sources

macOS osquery file_events tableElastic Agent macOS file monitoringCarbon Black macOS sensor

Required Tables

macOS endpoint log sourceosquery results index

False Positives & Tuning

  • Routine macOS session restore activity triggered by users selecting 'Reopen windows when logging back in' at logout
  • Automated workstation provisioning or re-imaging workflows that reset user login preferences as part of onboarding
  • macOS software installers that modify user session preferences as part of their post-install configuration
Download portable Sigma rule (.yml)

Other platforms for T1547.007


Testing Methodology

Validate this detection against 3 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 Application to Loginwindow Plist via defaults

    Expected signal: File modification event for com.apple.loginwindow plist. Process creation for defaults command with the write arguments.

  2. Test 2Read Current Loginwindow Plist

    Expected signal: Process creation event for plutil. No file modification events.

  3. Test 3Modify Loginwindow Plist via AppleScript

    Expected signal: Process creation for osascript. File modification event for loginwindow plist. The osascript parent process is a strong indicator.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections