Cross-source coverage
T1037.002 / ATT&CK
Boot or Logon Initialization Scripts: Login Hook
3 rules across 2 sources.
From MITRE ATT&CK 19.2
Adversaries may use a Login Hook to establish persistence executed upon user logon. A login hook is a plist file that points to a specific script to execute with root privileges upon user logon. The plist file is located in the /Library/Preferences/com.apple.loginwindow.plist file and can be modified using the defaults command-line utility. This behavior is the same for logout hooks where a script can be executed upon user logout. All hooks require administrator permissions to modify or create hooks.
Adversaries can add or insert a path to a malicious script in the com.apple.loginwindow.plist file, using the LoginHook or LogoutHook key-value pair. The malicious script is executed upon the next user login. If a login hook already exists, adversaries can add additional commands to an existing login hook. There can be only one login and logout hook on a system at a time.
Note: Login hooks were deprecated in 10.11 version of macOS in favor of Launch Daemon and Launch Agent
- Tactics
- Persistence · Privilege Escalation
- Platforms
- macOS
- Telemetry
-
macos:unifiedlogfs:plist
How MITRE says to detect it DET0244
Detection Strategy for Login Hook Persistence on macOS
macOS Analytic 0682
Detection of persistent login hooks configured via defaults or plist modifications that result in execution of scripts or binaries at user login, breaking expected parent-child process lineage.
macos:unifiedlogloginwindow or tccd-related entriesfs:plist/var/root/Library/Preferences/com.apple.loginwindow.plist
elastic/detection-rules
2 rules| Detection | Severity | Format |
|---|---|---|
| Persistence via Login or Logout Hook | Medium | Elastic TOML |
| Potential Persistence via Login Hook | Medium | Elastic TOML |
splunk/security_content
1 rule| Detection | Severity | Format |
|---|---|---|
| MacOS LoginHook Persistence | Undefined | SPL |