Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adversaries may modify plist files to automatically run an application when a user logs in.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 115% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-17 | ✗→✓ | ▲ Improved | -12% | 0% |
> Sub-technique of: T1547
Adversaries may modify plist files to automatically run an application when a user logs in. When a user logs out or restarts via the macOS Graphical User Interface (GUI), a prompt is provided to the user with a checkbox to "Reopen windows when logging back in". When selected, all applications currently open are added to a property list file named <code>com.apple.loginwindow.UUID].plist</code> within the <code>~/Library/Preferences/ByHost</code> directory. Applications listed in this file are automatically reopened upon the user’s next logon.
Adversaries can establish Persistence by adding a malicious application path to the <code>com.apple.loginwindow.UUID].plist</code> file to execute payloads when a user logs in.
Platforms: macOS
The following tests are from Atomic Red Team and provide actionable ways to test this technique:
Copy in new loginwindow.plist to launch Calculator.
Supported Platforms: macos
bashcp #{calc_plist_path} ~/Library/Preferences/ByHost/com.apple.loginwindow.plist
Mac Defaults
Supported Platforms: macos Elevation Required: Yes
bashsudo defaults write com.apple.loginwindow LoginHook #{script}
Appends an entry to launch Calculator hidden loginwindow.\.plist for next login. Note that the change may not result in the added Calculator program launching on next user login. It may depend on which version of macOS you are running on.
Supported Platforms: macos
bashFILE=`find ~/Library/Preferences/ByHost/com.apple.loginwindow.*.plist -type f | head -1` if [ -z "${FILE}" ] ; then echo "No loginwindow plist file found" && exit 1 ; fi echo save backup copy to /tmp/ cp ${FILE} /tmp/t1547007_loginwindow-backup.plist echo before plutil -p ${FILE} echo overwriting... #{exe_path} ${FILE} && echo after && plutil -p ${FILE}
Dependencies:
If Atomic Red Team tests are not applicable, manually verify the technique by:
This feature can be disabled entirely with the following terminal command: <code>defaults write -g ApplePersistence -bool no</code>.
Holding the Shift key while logging in prevents apps from opening automatically.
| Finding | Severity | Impact | | ------------------------------------------- | -------- | ----------- | | Re-opened Applications technique applicable | Low | Persistence |
| CWE ID | Title | | ------- | ----------------------------- | | CWE-276 | Incorrect Default Permissions |
Other measured skills in the registry, with their headline benchmark lift.