Office Test Registry Persistence
Identifies the modification of the Microsoft Office "Office Test" Registry key, a registry location that can be used to specify a DLL which will be executed every time an MS Office application is started. Attackers can abuse this to gain persistence on a compromised host.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/08/22"
3integration = ["endpoint", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike", "windows"]
4maturity = "production"
5updated_date = "2025/08/26"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies the modification of the Microsoft Office "Office Test" Registry key, a registry location that can be used to
11specify a DLL which will be executed every time an MS Office application is started. Attackers can abuse this to gain
12persistence on a compromised host.
13"""
14from = "now-9m"
15index = [
16 "logs-endpoint.events.registry-*",
17 "logs-m365_defender.event-*",
18 "endgame-*",
19 "logs-sentinel_one_cloud_funnel.*",
20 "logs-crowdstrike.fdr*",
21 "logs-windows.sysmon_operational-*",
22]
23language = "eql"
24license = "Elastic License v2"
25name = "Office Test Registry Persistence"
26note = """## Triage and analysis
27
28> **Disclaimer**:
29> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
30
31### Investigating Office Test Registry Persistence
32
33The Office Test Registry key in Windows environments allows specifying a DLL to execute whenever an Office application starts, providing a mechanism for legitimate customization. However, adversaries can exploit this for persistence by loading malicious DLLs. The detection rule monitors modifications to this registry path, excluding deletions, to identify potential abuse, leveraging data from various security sources to flag suspicious activity.
34
35### Possible investigation steps
36
37- Review the registry event details to identify the specific DLL path that was added or modified in the Office Test Registry key.
38- Check the file properties and digital signature of the DLL specified in the registry modification to determine its legitimacy.
39- Investigate the source of the registry modification by correlating with user activity logs to identify which user account made the change.
40- Analyze recent process execution logs for any Office applications to detect if the suspicious DLL has been loaded or executed.
41- Cross-reference the DLL and associated registry modification with threat intelligence sources to check for known malicious indicators.
42- Examine the system for additional signs of compromise, such as unusual network connections or other persistence mechanisms, to assess the scope of potential intrusion.
43
44### False positive analysis
45
46- Legitimate software installations or updates may modify the Office Test Registry key as part of their setup process. Users can create exceptions for known software vendors or specific applications that are frequently updated.
47- System administrators might use scripts or management tools that modify the registry for configuration purposes. Identify and exclude these trusted scripts or tools from triggering alerts.
48- Customization by IT departments for legitimate business needs can lead to registry modifications. Document and whitelist these customizations to prevent false positives.
49- Security software or monitoring tools might interact with the registry as part of their normal operations. Verify and exclude these interactions if they are known to be safe and necessary for system functionality.
50
51### Response and remediation
52
53- Immediately isolate the affected host from the network to prevent further spread or communication with potential command and control servers.
54- Use endpoint detection and response (EDR) tools to terminate any suspicious processes associated with the malicious DLL identified in the registry path.
55- Remove the malicious DLL entry from the Office Test Registry key to prevent it from executing on future Office application startups.
56- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any additional malicious files or remnants.
57- Review recent user activity and system logs to identify any unauthorized access or changes that may have led to the registry modification, and reset credentials if necessary.
58- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
59- Implement enhanced monitoring and alerting for similar registry modifications across the network to detect and respond to future attempts promptly."""
60references = [
61 "https://unit42.paloaltonetworks.com/unit42-technical-walkthrough-office-test-persistence-method-used-in-recent-sofacy-attacks/",
62]
63risk_score = 21
64rule_id = "14dab405-5dd9-450c-8106-72951af2391f"
65severity = "low"
66tags = [
67 "Domain: Endpoint",
68 "OS: Windows",
69 "Use Case: Threat Detection",
70 "Tactic: Persistence",
71 "Tactic: Defense Evasion",
72 "Data Source: Elastic Defend",
73 "Data Source: Elastic Endgame",
74 "Data Source: Microsoft Defender for Endpoint",
75 "Data Source: SentinelOne",
76 "Data Source: Crowdstrike",
77 "Data Source: Sysmon",
78 "Resources: Investigation Guide",
79]
80timestamp_override = "event.ingested"
81type = "eql"
82
83query = '''
84registry where host.os.type == "windows" and event.action != "deletion" and
85 registry.path : "*\\Software\\Microsoft\\Office Test\\Special\\Perf\\*"
86'''
87
88
89[[rule.threat]]
90framework = "MITRE ATT&CK"
91[[rule.threat.technique]]
92id = "T1137"
93name = "Office Application Startup"
94reference = "https://attack.mitre.org/techniques/T1137/"
95[[rule.threat.technique.subtechnique]]
96id = "T1137.002"
97name = "Office Test"
98reference = "https://attack.mitre.org/techniques/T1137/002/"
99
100
101
102[rule.threat.tactic]
103id = "TA0003"
104name = "Persistence"
105reference = "https://attack.mitre.org/tactics/TA0003/"
106[[rule.threat]]
107framework = "MITRE ATT&CK"
108[[rule.threat.technique]]
109id = "T1112"
110name = "Modify Registry"
111reference = "https://attack.mitre.org/techniques/T1112/"
112
113
114[rule.threat.tactic]
115id = "TA0005"
116name = "Defense Evasion"
117reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Office Test Registry Persistence
The Office Test Registry key in Windows environments allows specifying a DLL to execute whenever an Office application starts, providing a mechanism for legitimate customization. However, adversaries can exploit this for persistence by loading malicious DLLs. The detection rule monitors modifications to this registry path, excluding deletions, to identify potential abuse, leveraging data from various security sources to flag suspicious activity.
Possible investigation steps
- Review the registry event details to identify the specific DLL path that was added or modified in the Office Test Registry key.
- Check the file properties and digital signature of the DLL specified in the registry modification to determine its legitimacy.
- Investigate the source of the registry modification by correlating with user activity logs to identify which user account made the change.
- Analyze recent process execution logs for any Office applications to detect if the suspicious DLL has been loaded or executed.
- Cross-reference the DLL and associated registry modification with threat intelligence sources to check for known malicious indicators.
- Examine the system for additional signs of compromise, such as unusual network connections or other persistence mechanisms, to assess the scope of potential intrusion.
False positive analysis
- Legitimate software installations or updates may modify the Office Test Registry key as part of their setup process. Users can create exceptions for known software vendors or specific applications that are frequently updated.
- System administrators might use scripts or management tools that modify the registry for configuration purposes. Identify and exclude these trusted scripts or tools from triggering alerts.
- Customization by IT departments for legitimate business needs can lead to registry modifications. Document and whitelist these customizations to prevent false positives.
- Security software or monitoring tools might interact with the registry as part of their normal operations. Verify and exclude these interactions if they are known to be safe and necessary for system functionality.
Response and remediation
- Immediately isolate the affected host from the network to prevent further spread or communication with potential command and control servers.
- Use endpoint detection and response (EDR) tools to terminate any suspicious processes associated with the malicious DLL identified in the registry path.
- Remove the malicious DLL entry from the Office Test Registry key to prevent it from executing on future Office application startups.
- Conduct a thorough scan of the affected system using updated antivirus and anti-malware tools to identify and remove any additional malicious files or remnants.
- Review recent user activity and system logs to identify any unauthorized access or changes that may have led to the registry modification, and reset credentials if necessary.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and alerting for similar registry modifications across the network to detect and respond to future attempts promptly.
References
Related rules
- Installation of Security Support Provider
- Persistence via Hidden Run Key Detected
- Suspicious ImagePath Service Creation
- Image File Execution Options Injection
- Suspicious Startup Shell Folder Modification