MITRE ATT&CKsub-technique
T1137.001 Office Template Macros
- Domain
- enterprise
- Tactics
- Persistence
- Platforms
- Office Suite, Windows
- Version
- 1.2
- Created
- 2019-11-07
Description
Adversaries may abuse Microsoft Office templates to obtain persistence on a compromised system. Microsoft Office contains templates that are part of common Office applications and are used to customize styles. The base templates within the application are used each time an application starts.
Office Visual Basic for Applications (VBA) macros can be inserted into the base template and used to execute code when the respective Office application starts in order to obtain persistence. Examples for both Word and Excel have been discovered and published. By default, Word has a Normal.dotm template created that can be modified to include a malicious macro. Excel does not have a template file created by default, but one can be added that will automatically be loaded. Shared templates may also be stored and pulled from remote locations.
Word Normal.dotm location:
C:\Users\<username>\AppData\Roaming\Microsoft\Templates\Normal.dotm
Excel Personal.xlsb location:
C:\Users\<username>\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLSB
Adversaries may also change the location of the base template to point to their own by hijacking the application's search order, e.g. Word 2016 will first look for Normal.dotm under C:\Program Files (x86)\Microsoft Office\root\Office16\, or by modifying the GlobalDotName registry key. By modifying the GlobalDotName registry key an adversary can specify an arbitrary location, file name, and file extension to use for the template that will be loaded on application startup. To abuse GlobalDotName, adversaries may first need to register the template as a trusted document or place it in a trusted location.
An adversary may need to enable macros to execute unrestricted depending on the system or enterprise security policy on use of macros.
Related
Subtechnique of · MITRE ATT&CK (1)
- T1137 Office Application Startup technique
Tactic · MITRE ATT&CK (1)
- TA0003 Persistence tactic
Referenced by MITRE ATT&CK · mitigates (2)
Referenced by MITRE ATT&CK · uses (5)
Referenced by Compliance · mitigates (12)
- CIS-13.7 Deploy a Host-Based Intrusion Prevention Solution CIS Safeguard v8.1
- CIS-2.7 Allowlist Authorized Scripts CIS Safeguard v8.1
- NIST-AC-6 Least Privilege NIST 800-53 control
- NIST-CM-2 Baseline Configuration NIST 800-53 control
- NIST-CM-6 Configuration Settings NIST 800-53 control
- NIST-CM-8 System Component Inventory NIST 800-53 control
- NIST-RA-5 Vulnerability Monitoring and Scanning NIST 800-53 control
- NIST-SC-18 Mobile Code NIST 800-53 control
- NIST-SC-44 Detonation Chambers NIST 800-53 control
- NIST-SI-3 Malicious Code Protection NIST 800-53 control
- NIST-SI-4 System Monitoring NIST 800-53 control
- NIST-SI-8 Spam Protection NIST 800-53 control
References
- https://msdn.microsoft.com/en-us/vba/office-shared-vba/articles/getting-started-with-vba-in-office MSDN VBA in Office
- http://www.hexacorn.com/blog/2017/04/19/beyond-good-ol-run-key-part-62/ Hexacorn Office Template Macros
- https://support.office.com/article/Change-the-Normal-template-Normal-dotm-06de294b-d216-47f6-ab77-ccb5166f98ea Microsoft Change Normal Template
- https://enigma0x3.net/2014/01/23/maintaining-access-with-normal-dotm/comment-page-1/ enigma0x3 normal.dotm
- https://malware.news/t/using-outlook-forms-for-lateral-movement-and-persistence/13746 CrowdStrike Outlook Forms
- https://www.221bluestreet.com/post/office-templates-and-globaldotname-a-stealthy-office-persistence-technique GlobalDotName Jun 2019
- https://medium.com/@bwtech789/outlook-today-homepage-persistence-33ea9b505943 Outlook Today Home Page