Safeguard
Application Security•

Detecting and Mitigating the Office Test Registry Key (T1137.002)

A little-known Office Test registry key loads any DLL when Word or Excel starts. It does not exist by default, so its presence is a strong signal.

Safeguard Security Team
2 min read

T1137.002, Office Test, is a persistence technique that uses a registry location in Microsoft Office. It applies to Windows and Office Suite.

How attackers use it

An Office Test registry location lets a user specify an arbitrary DLL to run every time an Office application starts. MITRE says the key is thought to be used by Microsoft to load DLLs for testing and debugging while developing Office applications. It is not created by default during an Office installation.

There are user and global versions:

  • HKEY_CURRENT_USER\Software\Microsoft\Office test\Special\Perf
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Office test\Special\Perf

An adversary adds the key and points it at a malicious DLL, which then runs whenever Word or Excel starts. Because the DLL loads into the Office process, macros are not involved, so macro warnings never appear. MITRE lists APT28 as a user of this technique.

How to detect it

Two signals from MITRE's analytics:

  • Creation of the Office test\Special\Perf registry key with a DLL path. Sysmon event IDs 12 and 13 record registry creation and value sets.
  • An Office application loading a nonstandard DLL at startup, without a macro warning banner. Sysmon event ID 7 records image loads.

The key is not there on a normal install, so alert on any creation.

How to reduce the risk

MITRE lists two steps.

  1. Pre-create the key with tight permissions. Create the registry key and set its permissions to Read Control so it cannot easily be modified without administrator rights or a privilege escalation.
  2. Block Office child processes and executable writes with Attack Surface Reduction rules on Windows 10.

To check your hosts, read-only:

reg query "HKCU\Software\Microsoft\Office test\Special\Perf"
reg query "HKLM\Software\Microsoft\Office test\Special\Perf"

Quick check

Does the Office Test key exist on a normal Office install?

No. MITRE says it is not created by default, so its presence is worth investigating.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.