T1553.001: Gatekeeper 绕过
摘要
攻击者可能修改文件属性并颠覆 Gatekeeper 功能,以逃避用户提示并执行不受信任的程序。Gatekeeper 是一组技术,作为 Apple 安全模型的一层,确保只有受信任的应用程序在主机上执行。Gatekeeper 建立在 Snow Leopard(10.6,2009)的文件隔离(File Quarantine)之上,并已发展至包含代码签名、安全策略合规性、公证(Notarization)等。Gatekeeper 对首次运行的应用程序与重新打开的应用程序的处理方式也不同。(Citation: TheEclecticLightCompany Quarantine and the flag)(Citation: TheEclecticLightCompany apple notarization ) 基于一个可选加入(opt-in)系统,当文件被下载时,执行下载的应用程序可以在文件上设置一个名为 `com.apple.quarantine` 的扩展属性(xattr)(也称为隔离标志)。Launch Services 以挂起状态打开应用程序。对于设置了隔离标志的首次运行应用程序,Gatekeeper 执行以下功能: 1. 检查扩展属性 – Gatekeeper 检查隔离标志,然后向用户提供警报提示以允许或拒绝执行。(Citation: OceanLotus for OS X)(Citation: 20 macOS Common Tools and Techniques) 2. 检查系统策略 - Gatekeeper 检查系统安全策略,允许执行仅从 App Store 或从 App Store 和已识别开发人员下载的应用程序。 3. 代码签名 – Gatekeeper 检查来自 Apple Developer ID 的有效代码签名。 4. 公证 - 使用 `api.apple-cloudkit.com` API,Gatekeeper 联系 Apple 服务器以验证或拉取公证书(notarization ticket)并确保该证书未被撤销。用户可以覆盖公证,这将导致提示执行“未授权应用”并修改安全策略。 攻击者可以通过逻辑错误(例如[为隐蔽而利用](https://attack.mitre.org/techniques/T1211))、未检查的文件类型和外部库来颠覆 Gatekeeper 检查中的一个或多个安全控制。例如,在 macOS 13 Ventura 之前,代码签名和公证检查仅在首次启动时进行,允许攻击者将恶意可执行文件写入先前打开的应用程序,以绕过 Gatekeeper 安全检查。(Citation: theevilbit gatekeeper bypass 2021)(Citation: Application Bundle Manipulation Brandon Dalton) 从 USB 闪存驱动器、光盘、外部硬盘、通过本地网络共享的驱动器加载到系统的应用程序和文件,或使用 curl 命令加载的应用程序和文件,可能不会设置隔离标志。此外,也可以通过[路过式入侵](https://attack.mitre.org/techniques/T1189)避免设置隔离标志。
来源归属
来源:MITRE ATT&CK · 置信度:high
平台
- macOS
战术
Defense Impairment
参考来源
- https://attack.mitre.org/techniques/T1553/001
- https://redcanary.com/blog/mac-application-bundles/
- https://theevilbit.github.io/posts/gatekeeper_not_a_bypass/
- https://www.alienvault.com/blogs/labs-research/oceanlotus-for-os-x-an-application-bundle-pretending-to-be-an-adobe-flash-update
- https://eclecticlight.co/2020/10/29/quarantine-and-the-quarantine-flag/
- https://eclecticlight.co/2020/08/28/how-notarization-works/
- https://labs.sentinelone.com/20-common-tools-techniques-used-by-macos-threat-actors-malware/