Login Items

T1547.015

Sub-technique of T1547 Boot or Logon Autostart Execution.View on attack.mitre.org

About this technique

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. Login items created using a shared file list are visible in System Preferences, can hide the application when it launches, and are executed through LaunchServices, not launchd, to open applications, documents, or URLs without using Finder. Users and applications use login items to configure their user environment to launch commonly used services or applications, such as email, chat, and music applications.

Adversaries can utilize AppleScript and Native API calls to create a login item to spawn malicious executables. Prior to version 10.5 on macOS, adversaries can add login items by using AppleScript to send an Apple events to the “System Events” process, which has an AppleScript dictionary for manipulating login items. Adversaries can use a command such as tell application “System Events” to make login item at end with properties /path/to/executable. This command adds the path of the malicious executable to the login item file list located in ~/Library/Application Support/com.apple.backgroundtaskmanagementagent/backgrounditems.btm. Adversaries can also use login items to launch executables that can be used to control the victim system remotely or as a means to gain privilege escalation by prompting for user credentials.

Detection rules1

Rules on DetectionCode tagged with T1547.015.

Sigma1

RuleLevelLog source
Windows Terminal Profile Settings Modification By Uncommon Processmediumwindows / file_event

Splunk0

No Splunk rules are mapped to this technique yet.

Groups0

None recorded.

Software3

Campaigns0

None recorded.

Procedure examples3

Software3

Used byProcedure example
MalwareDok

Dok uses AppleScript to install a login Item by sending Apple events to the System Events process.

MalwareGreen Lambert

Green Lambert can add Login Items to establish persistence.

MalwareNETWIRE

NETWIRE can persist via startup options for Login items.

References12

  1. Add List Remove Login Items Apple Script Open source
    kaloprominat. (2013, July 30). macos: manage add list remove login items apple script. Retrieved October 5, 2021.
  2. Adding Login Items Open source
    Apple. (2016, September 13). Adding Login Items. Retrieved July 11, 2017.
  3. CheckPoint Dok Open source
    Ofer Caspi. (2017, May 4). OSX Malware is Catching Up, and it wants to Read Your HTTPS Traffic. Retrieved October 5, 2021.
  4. ELC Running at startup Open source
    hoakley. (2018, May 22). Running at startup: when to use a Login Item or a LaunchAgent/LaunchDaemon. Retrieved October 5, 2021.
  5. Launch Services Apple Developer Open source
    Apple. (n.d.). Launch Services. Retrieved October 5, 2021.
  6. Login Items AE Open source
    Apple. (n.d.). Login Items AE. Retrieved October 4, 2021.
  7. Open Login Items Apple Open source
    Apple. (n.d.). Open items automatically when you log in on Mac. Retrieved October 1, 2021.
  8. SMLoginItemSetEnabled Schroeder 2013 Open source
    Tim Schroeder. (2013, April 21). SMLoginItemSetEnabled Demystified. Retrieved November 17, 2024.
  9. Startup Items Eclectic Open source
    hoakley. (2021, September 16). How to run an app or tool at startup. Retrieved October 5, 2021.
  10. hexed osx.dok analysis 2019 Open source
    fluffybunny. (2019, July 9). OSX.Dok Analysis. Retrieved November 17, 2024.
  11. objsee mac malware 2017 Open source
    Patrick Wardle. (n.d.). Mac Malware of 2017. Retrieved September 21, 2018.
  12. objsee netwire backdoor 2019 Open source
    Patrick Wardle. (2019, June 20). Burned by Fire(fox). Retrieved October 1, 2021.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.