ATT&CK-CN V1.01 Last Update: 2019-11 [返回索引页]

译者: 林妙倩、戴亦仑 原创翻译作品,如果需要转载请取得翻译作者同意。

数据来源:ATT&CK Matrices

原文: https://attack.mitre.org/techniques/T1198

术语表: /attack/glossary

SIP和信任提供者劫持

在用户模式下,Windows Authenticode 数字签名用于验证文件的来源和完整性,这些变量可用于建立对签名代码的信任(例如:可以将具有有效Microsoft签名的驱动程序视为安全的)。签名验证过程是通过WinVerifyTrust应用程序编程接口(API)函数处理的,该函数 接受查询并与负责验证签名参数的适当信任提供者进行协调。

由于可执行文件的类型和相应的签名格式各不相同,Microsoft创建了称为主题接口包(SIP)软件组件,以在API函数和文件之间提供抽象层。SIP负责使API函数能够创建,检索,计算和验证签名。大多数文件格式(可执行文件,PowerShell,安装程序等,都具有唯一的SIP,目录签名提供了一个包罗万象的 ),并且由全局唯一标识符(GUID)标识。

标签

ID编号: T1198

策略: 防御闪避,持续性

平台: Windows

所需权限: SYSTEM,administrator

数据源: API监视,应用程序日志,DLL监视,加载的DLL,进程监视,Windows注册表,Windows事件日志

绕过防御: 应用程序白名单,自动运行分析,数字证书验证,流程白名单,用户模式签名验证

缓解措施

减轻 描述
执行预防(M1038) 启用白名单解决方案(例如AppLocker和/或Device Guard)以阻止恶意SIP DLL的加载。
限制文件和目录权限(M1022) 将SIP DLL的存储和执行限制为受保护的目录(例如C:\ Windows),而不是用户目录。
限制注册表权限(M1024) 确保为注册表配置单元设置了适当的权限,以防止用户修改与SIP和信任提供程序组件相关的密钥。如果不防止对注册表项进行恶意修改,则组件仍然可以被劫持到磁盘上已经存在的适当功能。
Mitigation Description
Execution Prevention (M1038) Enable whitelisting solutions such as AppLocker and/or Device Guard to block the loading of malicious SIP DLLs.
Restrict File and Directory Permissions (M1022) Restrict storage and execution of SIP DLLs to protected directories, such as C:\Windows, rather than user directories.
Restrict Registry Permissions (M1024) Ensure proper permissions are set for Registry hives to prevent users from modifying keys related to SIP and trust provider components. Components may still be able to be hijacked to suitable functions already present on disk if malicious modifications to Registry keys are not prevented.

检测

定期基线注册的SIP和信任提供者(注册表项和磁盘上的文件),特别是寻找新的,修改的或非Microsoft的项。

启用CryptoAPI v2(CAPI)事件日志记录来监视和分析与失败的信任验证有关的错误事件(事件ID 81,尽管此事件可由劫持的信任提供程序组件所破坏),以及任何其他提供的信息事件(例如:成功的验证)。代码完整性事件日志记录还可能提供恶意SIP或信任提供者负载的重要指示,因为试图加载恶意制作的信任验证组件的受保护进程可能会失败(事件ID 3033)。

利用Sysmon检测规则和/或启用“ 高级安全审核”策略中的注册表(全局对象访问审核)设置,以应用全局系统访问控制列表(SACL)和事件审核,以对与注册表值(子)相关的键进行修改到SIP和信任提供者:

  • HKLM\SOFTWARE\Microsoft\Cryptography\OID
  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Cryptography\OID
  • HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust
  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Cryptography\Providers\Trust

注意:作为此技术的一部分,对手可能会尝试手动编辑这些注册表项(例如:Regedit)或使用Regsvr32 (T1117)进行合法的注册过程。

分析自动运行数据中的异常和异常,特别是通过隐藏在自动启动位置中而试图持久执行的恶意文件。默认情况下,自动运行将隐藏由Microsoft或Windows签名的条目,因此请确保同时取消选中“隐藏Microsoft条目”和“隐藏Windows条目”。

Periodically baseline registered SIPs and trust providers (Registry entries and files on disk), specifically looking for new, modified, or non-Microsoft entries.

Enable CryptoAPI v2 (CAPI) event logging to monitor and analyze error events related to failed trust validation (Event ID 81, though this event can be subverted by hijacked trust provider components) as well as any other provided information events (ex: successful validations). Code Integrity event logging may also provide valuable indicators of malicious SIP or trust provider loads, since protected processes that attempt to load a maliciously-crafted trust validation component will likely fail (Event ID 3033).

Utilize Sysmon detection rules and/or enable the Registry (Global Object Access Auditing) setting in the Advanced Security Audit policy to apply a global system access control list (SACL) and event auditing on modifications to Registry values (sub)keys related to SIPs and trust providers:

  • HKLM\SOFTWARE\Microsoft\Cryptography\OID
  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Cryptography\OID
  • HKLM\SOFTWARE\Microsoft\Cryptography\Providers\Trust
  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Cryptography\Providers\Trust

Note: As part of this technique, adversaries may attempt to manually edit these Registry keys (ex: Regedit) or utilize the legitimate registration process using Regsvr32 (T1117)

Analyze Autoruns data for oddities and anomalies, specifically malicious files attempting persistent execution by hiding within auto-starting locations. Autoruns will hide entries signed by Microsoft or Windows by default, so ensure "Hide Microsoft Entries" and "Hide Windows Entries" are both deselected.