MITRE ATT&CKsub-technique
T1564.007 VBA Stomping
- Domain
- enterprise
- Tactics
- Stealth
- Platforms
- Linux, macOS, Windows
- Version
- 2.0
- Created
- 2020-09-17
Description
Adversaries may hide malicious Visual Basic for Applications (VBA) payloads embedded within MS Office documents by replacing the VBA source code with benign data.
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.
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.
Related
Subtechnique of · MITRE ATT&CK (1)
- T1564 Hide Artifacts technique
Tactic · MITRE ATT&CK (1)
- TA0005 Stealth tactic
Referenced by MITRE ATT&CK · mitigates (1)
- M1042 Disable or Remove Feature or Program mitigation
References
- https://github.com/bontchev/pcodedmp pcodedmp Bontchev
- https://www.fireeye.com/blog/threat-research/2020/01/stomp-2-dis-brilliance-in-the-visual-basics.html FireEye VBA stomp Feb 2020
- https://outflank.nl/blog/2019/05/05/evil-clippy-ms-office-maldoc-assistant/ Evil Clippy May 2019
- https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/ef7087ac-3974-4452-aab2-7dba2214d239 Microsoft _VBA_PROJECT Stream
- https://medium.com/walmartglobaltech/vba-stomping-advanced-maldoc-techniques-612c484ab278 Walmart Roberts Oct 2018