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.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
frack113 (SigmaHQ), DRL 1.1
Published
2021-12-28
Updated
2026-07-31
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