T1547.007

Re-opened Applications

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.

Microsoft Sentinel / Defender
kusto
DeviceFileEvents
| where Timestamp > ago(24h)
| where FolderPath has "Library/Preferences/ByHost"
| where FileName startswith "com.apple.loginwindow."
| where ActionType in ("FileModified", "FileCreated")
| project Timestamp, DeviceName, FileName, FolderPath, ActionType,
         InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
| sort by Timestamp desc
medium severity medium confidence

Data Sources

File: File Modification File: File Creation Microsoft Defender for Endpoint

Required Tables

DeviceFileEvents

False Positives

  • Normal macOS logon/logoff cycle modifying the loginwindow plist via the loginwindow process
  • Users manually toggling the 'Reopen windows when logging back in' checkbox in System Preferences
  • macOS system updates that modify loginwindow preferences

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