Persistence via Microsoft Office AddIns

Detects attempts to establish persistence on an endpoint by abusing Microsoft Office add-ins.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/10/16"
 3integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
 4maturity = "production"
 5updated_date = "2025/01/15"
 6min_stack_version = "8.14.0"
 7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
 8
 9[rule]
10author = ["Elastic"]
11description = "Detects attempts to establish persistence on an endpoint by abusing Microsoft Office add-ins."
12from = "now-9m"
13index = ["logs-endpoint.events.file-*", "winlogbeat-*", "logs-windows.sysmon_operational-*", "endgame-*", "logs-m365_defender.event-*", "logs-sentinel_one_cloud_funnel.*"]
14language = "eql"
15license = "Elastic License v2"
16name = "Persistence via Microsoft Office AddIns"
17references = ["https://labs.withsecure.com/publications/add-in-opportunities-for-office-persistence"]
18risk_score = 73
19rule_id = "f44fa4b6-524c-4e87-8d9e-a32599e4fb7c"
20severity = "high"
21tags = [
22    "Domain: Endpoint",
23    "OS: Windows",
24    "Use Case: Threat Detection",
25    "Tactic: Persistence",
26    "Data Source: Elastic Endgame",
27    "Data Source: Elastic Defend",
28    "Data Source: Sysmon",
29    "Data Source: Microsoft Defender for Endpoint",
30    "Data Source: SentinelOne",
31    "Resources: Investigation Guide",
32]
33timestamp_override = "event.ingested"
34type = "eql"
35
36query = '''
37file where host.os.type == "windows" and event.type != "deletion" and
38 file.extension : ("wll","xll","ppa","ppam","xla","xlam") and
39 file.path :
40    (
41    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\*",
42    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\*",
43    "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\*"
44    )
45'''
46note = """## Triage and analysis
47
48> **Disclaimer**:
49> 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.
50
51### Investigating Persistence via Microsoft Office AddIns
52
53Microsoft Office AddIns enhance productivity by allowing custom functionalities in Office applications. However, adversaries exploit this by placing malicious add-ins in specific startup directories, ensuring execution each time the application launches. The detection rule identifies suspicious files with extensions like .xll or .xlam in these directories, flagging potential persistence mechanisms on Windows systems.
54
55### Possible investigation steps
56
57- Review the file path and extension from the alert to confirm it matches the suspicious directories and extensions specified in the detection rule, such as .xll or .xlam in the Microsoft Office startup directories.
58- Check the file creation and modification timestamps to determine when the suspicious file was added or altered, which can help establish a timeline of potential malicious activity.
59- Investigate the file's origin by examining recent file downloads, email attachments, or network activity that might have introduced the file to the system.
60- Analyze the file's contents or hash against known malware databases to identify if it is a known threat or potentially malicious.
61- Review user activity and system logs around the time the file was created or modified to identify any unusual behavior or processes that could be related to the persistence mechanism.
62- Assess the impacted user's role and access level to determine the potential risk and impact of the persistence mechanism on the organization.
63
64### False positive analysis
65
66- Legitimate add-ins installed by trusted software vendors may trigger alerts. Verify the source and publisher of the add-in to determine its legitimacy.
67- Custom add-ins developed internally for business purposes can be flagged. Maintain a whitelist of known internal add-ins to prevent unnecessary alerts.
68- Frequent updates to legitimate add-ins might cause repeated alerts. Implement version control and update the whitelist accordingly to accommodate these changes.
69- User-specific add-ins for accessibility or productivity tools may be detected. Educate users on safe add-in practices and monitor for any unusual behavior.
70- Temporary add-ins used for specific projects or tasks can be mistaken for threats. Document and review these cases to ensure they are recognized as non-threatening.
71
72### Response and remediation
73
74- Isolate the affected endpoint from the network to prevent further spread of the potential threat.
75- Terminate any suspicious Microsoft Office processes that may be running add-ins from the identified directories.
76- Remove the malicious add-in files from the specified startup directories: "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Word\\Startup\\", "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\AddIns\\", and "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Excel\\XLSTART\\".
77- Conduct a full antivirus and antimalware scan on the affected system using tools like Microsoft Defender for Endpoint to ensure no other malicious files are present.
78- Review and restore any altered system configurations or settings to their default state to ensure system integrity.
79- Monitor the affected system and network for any signs of re-infection or related suspicious activity, using enhanced logging and alerting mechanisms.
80- Escalate the incident to the security operations center (SOC) or relevant IT security team for further analysis and to determine if additional systems are affected."""
81
82
83[[rule.threat]]
84framework = "MITRE ATT&CK"
85[[rule.threat.technique]]
86id = "T1137"
87name = "Office Application Startup"
88reference = "https://attack.mitre.org/techniques/T1137/"
89[[rule.threat.technique.subtechnique]]
90id = "T1137.006"
91name = "Add-ins"
92reference = "https://attack.mitre.org/techniques/T1137/006/"
93
94
95
96[rule.threat.tactic]
97id = "TA0003"
98name = "Persistence"
99reference = "https://attack.mitre.org/tactics/TA0003/"

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 Persistence via Microsoft Office AddIns

Microsoft Office AddIns enhance productivity by allowing custom functionalities in Office applications. However, adversaries exploit this by placing malicious add-ins in specific startup directories, ensuring execution each time the application launches. The detection rule identifies suspicious files with extensions like .xll or .xlam in these directories, flagging potential persistence mechanisms on Windows systems.

Possible investigation steps

  • Review the file path and extension from the alert to confirm it matches the suspicious directories and extensions specified in the detection rule, such as .xll or .xlam in the Microsoft Office startup directories.
  • Check the file creation and modification timestamps to determine when the suspicious file was added or altered, which can help establish a timeline of potential malicious activity.
  • Investigate the file's origin by examining recent file downloads, email attachments, or network activity that might have introduced the file to the system.
  • Analyze the file's contents or hash against known malware databases to identify if it is a known threat or potentially malicious.
  • Review user activity and system logs around the time the file was created or modified to identify any unusual behavior or processes that could be related to the persistence mechanism.
  • Assess the impacted user's role and access level to determine the potential risk and impact of the persistence mechanism on the organization.

False positive analysis

  • Legitimate add-ins installed by trusted software vendors may trigger alerts. Verify the source and publisher of the add-in to determine its legitimacy.
  • Custom add-ins developed internally for business purposes can be flagged. Maintain a whitelist of known internal add-ins to prevent unnecessary alerts.
  • Frequent updates to legitimate add-ins might cause repeated alerts. Implement version control and update the whitelist accordingly to accommodate these changes.
  • User-specific add-ins for accessibility or productivity tools may be detected. Educate users on safe add-in practices and monitor for any unusual behavior.
  • Temporary add-ins used for specific projects or tasks can be mistaken for threats. Document and review these cases to ensure they are recognized as non-threatening.

Response and remediation

  • Isolate the affected endpoint from the network to prevent further spread of the potential threat.
  • Terminate any suspicious Microsoft Office processes that may be running add-ins from the identified directories.
  • Remove the malicious add-in files from the specified startup directories: "C:\Users*\AppData\Roaming\Microsoft\Word\Startup", "C:\Users*\AppData\Roaming\Microsoft\AddIns", and "C:\Users*\AppData\Roaming\Microsoft\Excel\XLSTART".
  • Conduct a full antivirus and antimalware scan on the affected system using tools like Microsoft Defender for Endpoint to ensure no other malicious files are present.
  • Review and restore any altered system configurations or settings to their default state to ensure system integrity.
  • Monitor the affected system and network for any signs of re-infection or related suspicious activity, using enhanced logging and alerting mechanisms.
  • Escalate the incident to the security operations center (SOC) or relevant IT security team for further analysis and to determine if additional systems are affected.

References

Related rules

to-top