MITRE ATT&CK Technique: T1164
create a custom plist:
~/Library/Preferences/com.apple.loginwindow.plist
or
~/Library/Preferences/ByHost/com.apple.loginwindow.*.plist
Create:
sudo defaults write com.apple.loginwindow LoginHook /path/to/script
Delete:
sudo defaults delete com.apple.loginwindow LoginHook