T1547.015: 登录项
摘要
攻击者可能添加登录项以在用户登录时执行,从而获得持久化或提升权限。登录项是在用户登录时自动启动的应用程序、文档、文件夹或服务器连接。(Citation: Open Login Items Apple) 登录项可以通过共享文件列表或服务管理框架(Service Management Framework)添加。(Citation: Adding Login Items) 共享文件列表登录项可以使用诸如 [AppleScript](https://attack.mitre.org/techniques/T1059/002) 之类的脚本语言设置,而服务管理框架使用 API 调用 <code>SMLoginItemSetEnabled</code>。 使用服务管理框架安装的登录项利用 <code>launchd</code>,在系统偏好设置中不可见,并且只能由创建它们的应用程序移除。(Citation: Adding Login Items)(Citation: SMLoginItemSetEnabled Schroeder 2013) 使用共享文件列表创建的登录项在系统偏好设置中可见,可以在启动时隐藏应用程序,并通过 LaunchServices(而非 launchd)执行,以在不使用 Finder 的情况下打开应用程序、文档或 URL。(Citation: Launch Services Apple Developer) 用户和应用程序使用登录项来配置其用户环境以启动常用的服务或应用程序,如电子邮件、聊天和音乐应用程序。 攻击者可以利用 [AppleScript](https://attack.mitre.org/techniques/T1059/002) 和 [本机 API](https://attack.mitre.org/techniques/T1106) 调用来创建登录项以产生恶意可执行文件。(Citation: ELC Running at startup) 在 macOS 10.5 版本之前,攻击者可以通过使用 [AppleScript](https://attack.mitre.org/techniques/T1059/002) 向“System Events”进程发送 Apple 事件来添加登录项,该进程具有用于操作登录项的 AppleScript 字典。(Citation: Login Items AE) 攻击者可以使用诸如 <code>tell application “System Events” to make login item at end with properties /path/to/executable</code> 之类的命令。(Citation: Startup Items Eclectic)(Citation: hexed osx.dok analysis 2019)(Citation: Add List Remove Login Items Apple Script) 此命令将恶意可执行文件的路径添加到位于 <code>~/Library/Application Support/com.apple.backgroundtaskmanagementagent/backgrounditems.btm</code> 的登录项文件列表中。(Citation: Startup Items Eclectic) 攻击者还可以使用登录项启动可用于远程控制受害者系统的可执行文件,或作为通过提示用户凭据以获得权限提升的手段。(Citation: objsee mac malware 2017)(Citation: CheckPoint Dok)(Citation: objsee netwire backdoor 2019)
来源归属
来源:MITRE ATT&CK · 置信度:high
平台
- macOS
战术
持久化
参考来源
- https://attack.mitre.org/techniques/T1547/015
- https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html
- https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW1
- https://developer.apple.com/documentation/coreservices/launch_services
- https://developer.apple.com/library/archive/samplecode/LoginItemsAE/Introduction/Intro.html#//apple_ref/doc/uid/DTS10003788
- https://support.apple.com/guide/mac-help/open-items-automatically-when-you-log-in-mh15189/mac
- https://web.archive.org/web/20221007144948/http://www.hexed.in/2019/07/osxdok-analysis.html
- https://eclecticlight.co/2018/05/22/running-at-startup-when-to-use-a-login-item-or-a-launchagent-launchdaemon/
- https://eclecticlight.co/2021/09/16/how-to-run-an-app-or-tool-at-startup/
- https://gist.github.com/kaloprominat/6111584
- https://blog.checkpoint.com/2017/04/27/osx-malware-catching-wants-read-https-traffic/
- https://objective-see.com/blog/blog_0x31.html
- https://objective-see.com/blog/blog_0x44.html
- https://objective-see.com/blog/blog_0x25.html
- https://www.sentinelone.com/blog/how-malware-persists-on-macos/
- https://web.archive.org/web/20160216034946/https://blog.timschroeder.net/2013/04/21/smloginitemsetenabled-demystified/