PowerShell Script Blocks Register Malicious XLL via Office COM Automation on Windows
Detects PowerShell Script Block content that uses COM automation to call .RegisterXLL for an Office XLL add-in.
- Product
- windows
- Category
- ps_script
- Author
- frack113 (SigmaHQ), DRL 1.1
- Published
- 2021-12-28
- Updated
- 2026-07-31
ATT&CK techniques
PersistenceRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies PowerShell script block content that creates a COM object for an Office application and invokes RegisterXLL, which can register and load an Office XLL add-in. Attackers may use this technique to execute code through Office extensibility mechanisms and establish persistence. The detection relies on script block text telemetry showing the use of new-object, COM automation, and the RegisterXLL method call.
Reporting behind it
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: PowerShell Script Blocks Register Malicious XLL via Office COM Automation on Windows
id: 1659b964-047b-4d8e-a236-fa935b31727f
status: test
description: This rule identifies PowerShell script block content that creates a COM object for an Office application and invokes RegisterXLL, which can register and load an Office XLL add-in. Attackers may use this technique to execute code through Office extensibility mechanisms and establish persistence. The detection relies on script block text telemetry showing the use of new-object, COM automation, and the RegisterXLL method call.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1137.006/T1137.006.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_office_comobject_registerxll.yml
author: frack113, Huntrule Team
date: 2021-12-28
tags:
- attack.persistence
- attack.t1137.006
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
selection:
ScriptBlockText|contains|all:
- "new-object "
- "-ComObject "
- .application
- .RegisterXLL
condition: selection
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 36fbec91-fa1b-4d5d-8df1-8d8edcb632ad
type: derived