Hide Artifacts: VBA Stomping
- ID
- T1564.007
- Tactics
- TA0005 Stealth
- Sub-technique of
- T1564 Hide Artifacts
- Platforms
- Linux, macOS, Windows
- Data sources
- File Creation, Process Creation, File Metadata
- Source
- attack.mitre.org
- MITRE last modified
- 12 May 2026
Adversaries may hide malicious Visual Basic for Applications (VBA) payloads embedded within MS Office documents by replacing the VBA source code with benign data.[2]
MS Office documents with embedded VBA content store source code inside of module streams. Each module stream has a PerformanceCache that stores a separate compiled version of the VBA source code known as p-code. The p-code is executed when the MS Office version specified in the _VBA_PROJECT stream (which contains the version-dependent description of the VBA project) matches the version of the host MS Office application.[3][4]
An adversary may hide malicious VBA code by overwriting the VBA source code location with zero’s, benign code, or random bytes while leaving the previously compiled malicious p-code. Tools that scan for malicious VBA source code may be bypassed as the unwanted code is hidden in the compiled p-code. If the VBA source code is removed, some tools might even think that there are no macros present. If there is a version match between the _VBA_PROJECT stream and host MS Office application, the p-code will be executed, otherwise the benign VBA source code will be decompressed and recompiled to p-code, thus removing malicious p-code and potentially bypassing dynamic analysis.[5][2][6]
Detection
- DET0012 Detection Strategy for VBA Stomping
Data components: File Creation, Process Creation, File Metadata
Mitigations (1)
- M1042 Disable or Remove Feature or Program
Turn off or restrict access to unneeded VB components.[1]
References
- Microsoft Disable VBA Jan 2020
- FireEye VBA stomp Feb 2020
- Evil Clippy May 2019
- Microsoft _VBA_PROJECT Stream
- Walmart Roberts Oct 2018
- pcodedmp Bontchev
