PowerShell module: Obfuscated Invoke via rundll32/shell32.dll comspec iex patterns

Flags PowerShell module payloads containing obfuscated rundll32 shell32.dll shellexec_rundll invocation patterns.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_module
Author
Nikita Nazarov, oscd.community (SigmaHQ), DRL 1.1
Published
2019-10-08
Updated
2026-07-31
title: "PowerShell module: Obfuscated Invoke via rundll32/shell32.dll comspec iex patterns"
id: ce46b2c9-0cbf-4c37-8c7b-fdefb3125bfd
related:
  - id: a5a30a6e-75ca-4233-8b8c-42e0f2037d3b
    type: derived
  - id: 88a22f69-62f9-4b8a-aa00-6b0212f2f05a
    type: derived
status: test
description: This rule identifies PowerShell module payloads containing a set of obfuscation and execution indicators, including &&, rundll32, shell32.dll, shellexec_rundll, and the combination of value, invoke, comspec, and iex. Attackers may use these mixed command-and-script patterns to trigger indirect execution and hinder straightforward inspection. It relies on PowerShell module telemetry where the Payload field is available to match the specified string fragments.
references:
  - https://github.com/SigmaHQ/sigma/issues/1009
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_module/posh_pm_invoke_obfuscation_via_use_rundll32.yml
author: Nikita Nazarov, oscd.community, Huntrule Team
date: 2019-10-08
modified: 2022-11-29
tags:
  - attack.stealth
  - attack.t1027
  - attack.execution
  - attack.t1059.001
logsource:
  product: windows
  category: ps_module
  definition: 0ad03ef1-f21b-4a79-8ce8-e6900c54b65b
detection:
  selection_4103:
    Payload|contains|all:
      - "&&"
      - rundll32
      - shell32.dll
      - shellexec_rundll
    Payload|contains:
      - value
      - invoke
      - comspec
      - iex
  condition: selection_4103
falsepositives:
  - Unknown
level: high
license: DRL-1.1