T1221: 模板注入
摘要
攻击者可能在用户文档模板中创建或修改引用,以隐藏恶意代码或强制认证尝试。例如,Microsoft 的 Office Open XML (OOXML) 规范定义了一种基于 XML 的 Office 文档格式(.docx、xlsx、.pptx),用以取代较旧的二进制格式(.doc、.xls、.ppt)。OOXML 文件是打包在一起的 ZIP 归档,由各种称为“部件”(parts) 的 XML 文件组成,这些文件包含共同定义文档呈现方式的属性。(Citation: Microsoft Open XML July 2017) 部件内的属性可能引用通过在线 URL 访问的共享公共资源。例如,模板属性可能引用一个文件,作为预格式化的文档蓝图,在文档加载时被获取。 攻击者可能滥用这些模板来初步隐藏将经由用户文档执行的恶意代码。注入文档的模板引用可能使恶意载荷在文档加载时被获取并执行。(Citation: SANS Brian Wiltse Template Injection) 这些文档可以通过其他技术投递,例如[网络钓鱼](https://attack.mitre.org/techniques/T1566)和/或[污染共享内容](https://attack.mitre.org/techniques/T1080),并且可能逃避静态检测,因为在恶意载荷被获取之前不存在典型指标(VBA 宏、脚本等)。(Citation: Redxorblue Remote Template Injection) 已观察到野外示例,其中模板注入被用于加载包含漏洞利用的恶意代码。(Citation: MalwareBytes Template Injection OCT 2017) 攻击者还可能修改 .rtf 文件中的 <code>*\template</code> 控制字,以类似方式隐藏然后下载恶意代码。这个合法的控制字值旨在作为模板文件资源的目标文件,该资源在打开 .rtf 文件时被检索和加载。然而,攻击者可能更改现有 .rtf 文件的字节,以插入一个包含恶意载荷 URL 资源的模板控制字字段。(Citation: Proofpoint RTF Injection)(Citation: Ciberseguridad Decoding malicious RTF files) 此技术还可能通过注入 SMB/HTTPS(或其他凭据提示)URL 并触发认证尝试来实现[强制认证](https://attack.mitre.org/techniques/T1187)。(Citation: Anomali Template Injection MAR 2018)(Citation: Talos Template Injection July 2017)(Citation: ryhanson phishery SEPT 2016)
来源归属
来源:MITRE ATT&CK · 置信度:high
平台
- Windows
战术
Stealth
参考来源
- https://attack.mitre.org/techniques/T1221
- https://blog.talosintelligence.com/2017/07/template-injection.html
- https://github.com/ryhanson/phishery
- http://blog.redxorblue.com/2018/07/executing-macros-from-docx-with-remote.html
- https://forum.anomali.com/t/credential-harvesting-and-malicious-file-delivery-using-microsoft-office-template-injection/2104
- https://docs.microsoft.com/previous-versions/office/developer/office-2007/aa338205(v=office.12)
- https://ciberseguridad.blog/decodificando-ficheros-rtf-maliciosos/
- https://www.proofpoint.com/us/blog/threat-insight/injection-new-black-novel-rtf-template-inject-technique-poised-widespread
- https://blog.malwarebytes.com/threat-analysis/2017/10/decoy-microsoft-word-document-delivers-malware-through-rat/
- https://www.sans.org/reading-room/whitepapers/testing/template-injection-attacks-bypassing-security-controls-living-land-38780