Skip to content

Latest commit

 

History

History
66 lines (32 loc) · 1.93 KB

T1164.md

File metadata and controls

66 lines (32 loc) · 1.93 KB

T1164 - Re-opened Applications

Starting in Mac OS X 10.7 (Lion), users can specify certain applications to be re-opened when a user reboots their machine. While this is usually done via a Graphical User Interface (GUI) on an app-by-app basis, there are property list files (plist) that contain this information as well located at ~/Library/Preferences/com.apple.loginwindow.plist and ~/Library/Preferences/ByHost/com.apple.loginwindow.* .plist.

An adversary can modify one of these files directly to include a link to their malicious executable to provide a persistence mechanism each time the user reboots their machine (Citation: Methods of Mac Malware Persistence).

Atomic Tests


Atomic Test #1 - Re-Opened Applications

Plist Method

Reference

Supported Platforms: macOS

Run it with these steps! 1. create a custom plist:

~/Library/Preferences/com.apple.loginwindow.plist

or

~/Library/Preferences/ByHost/com.apple.loginwindow.*.plist


Atomic Test #2 - Re-Opened Applications

Mac Defaults

Reference

Supported Platforms: macOS

Inputs:

Name Description Type Default Value
script path to script path /path/to/script

Attack Commands: Run with sh!

sudo defaults write com.apple.loginwindow LoginHook #{script}
sudo defaults delete com.apple.loginwindow LoginHook