← Back to SOC feed Coverage →

Suspicious PowerShell IEX Execution Patterns

sigma HIGH SigmaHQ
T1059.001
imProcessCreate
powershell
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at SigmaHQ →
Retrieved: 2026-05-12T23:00:00Z · Confidence: medium

Hunt Hypothesis

Detects suspicious ways to run Invoke-Execution using IEX alias

Detection Rule

Sigma (Original)

title: Suspicious PowerShell IEX Execution Patterns
id: 09576804-7a05-458e-a817-eb718ca91f54
status: test
description: Detects suspicious ways to run Invoke-Execution using IEX alias
references:
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-expression?view=powershell-7.2
    - https://www.huntress.com/blog/slashandgrab-screen-connect-post-exploitation-in-the-wild-cve-2024-1709-cve-2024-1708
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2022-03-24
modified: 2022-11-28
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: process_creation
detection:
    selection_combined_1:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
        CommandLine|contains:
            - ' | iex;'
            - ' | iex '
            - ' | iex}'
            - ' | IEX ;'
            - ' | IEX -Error'
            - ' | IEX (new'
            - ');IEX '
    selection_combined_2:
        CommandLine|contains:
            - '::FromBase64String'
            - '.GetString([System.Convert]::'
    selection_standalone:
        CommandLine|contains:
            - ')|iex;$'
            - ');iex($'
            - ');iex $'
            - ' | IEX | '
            - ' | iex\"'
    condition: all of selection_combined_* or selection_standalone
falsepositives:
    - Legitimate scripts that use IEX
level: high

KQL (Azure Sentinel)

imProcessCreate
| where (((TargetProcessName endswith "\\powershell.exe" or TargetProcessName endswith "\\pwsh.exe") and (TargetProcessCommandLine contains " | iex;" or TargetProcessCommandLine contains " | iex " or TargetProcessCommandLine contains " | iex}" or TargetProcessCommandLine contains " | IEX ;" or TargetProcessCommandLine contains " | IEX -Error" or TargetProcessCommandLine contains " | IEX (new" or TargetProcessCommandLine contains ");IEX ")) and (TargetProcessCommandLine contains "::FromBase64String" or TargetProcessCommandLine contains ".GetString([System.Convert]::")) or (TargetProcessCommandLine contains ")|iex;$" or TargetProcessCommandLine contains ");iex($" or TargetProcessCommandLine contains ");iex $" or TargetProcessCommandLine contains " | IEX | " or TargetProcessCommandLine contains " | iex\\\"")

Required Data Sources

Sentinel TableNotes
imProcessCreateEnsure this data connector is enabled

False Positive Guidance

MITRE ATT&CK Context

References

Original source: https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_powershell_iex_patterns.yml