Detection rules › Sigma

Alternate PowerShell Hosts - PowerShell Module

Status
test
Severity
medium
Log source
category ps_module, product windows
Author
Roberto Rodriguez @Cyb3rWard0g
Source
github.com/SigmaHQ/sigma

Detects alternate PowerShell hosts potentially bypassing detections looking for powershell.exe

Known false positives

  • Programs using PowerShell directly without invocation of a dedicated interpreter
  • MSP Detection Searcher
  • Citrix ConfigSync.ps1

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: Alternate PowerShell Hosts - PowerShell Module
id: 64e8e417-c19a-475a-8d19-98ea705394cc
status: test
description: Detects alternate PowerShell hosts potentially bypassing detections looking for powershell.exe
references:
    - https://threathunterplaybook.com/hunts/windows/190610-PwshAlternateHosts/notebook.html
author: Roberto Rodriguez @Cyb3rWard0g
date: 2019-08-11
modified: 2025-10-17
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_module
    definition: 0ad03ef1-f21b-4a79-8ce8-e6900c54b65b
detection:
    selection:
        ContextInfo|contains: '*'
    filter_powershell:
        # This filter covers the following use cases
        #   - When powershell is called directly from commandline via keyword powershell or powershell.exe
        #   - Or called via path but not with full "".exe". Example: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell
        ContextInfo|contains:
            - '= powershell' # Host Application=...powershell.exe or Application hote=...powershell.exe in French Win10 event
            - '= C:\Windows\System32\WindowsPowerShell\v1.0\powershell'
            - '= C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell'
            # In some cases powershell was invoked with inverted slashes
            - '= C:/Windows/System32/WindowsPowerShell/v1.0/powershell'
            - '= C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershell'
            # In some cases \??\C:.. is used
            - '= \\\?\?\C:Windows\System32\WindowsPowerShell\v1.0\powershell'
            - '= \\\?\?\C:Windows\SysWOW64\WindowsPowerShell\v1.0\powershell'
    filter_sdiagnhost:
        ContextInfo|contains: '= C:\WINDOWS\System32\sdiagnhost.exe -Embedding' # When MSDT is launched for example
    filter_citrix:
        ContextInfo|contains: 'ConfigSyncRun.exe'
    filter_adace:  # Active Directory Administrative Center Enhancements
        ContextInfo|contains: 'C:\Windows\system32\dsac.exe'
    filter_winrm:
        ContextInfo|contains: 'C:\Windows\system32\wsmprovhost.exe -Embedding'
    filter_help_update:
        Payload|contains:
            - 'Update-Help'
            - 'Failed to update Help for the module'
    condition: selection and not 1 of filter_*
falsepositives:
    - Programs using PowerShell directly without invocation of a dedicated interpreter
    - MSP Detection Searcher
    - Citrix ConfigSync.ps1
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_*

Stage 1: selection

selection:
    ContextInfo|contains: '*'

Stage 2: not filter_*

filter_powershell:
    ContextInfo|contains:
        - '= powershell'
        - '= C:\Windows\System32\WindowsPowerShell\v1.0\powershell'
        - '= C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell'
        - '= C:/Windows/System32/WindowsPowerShell/v1.0/powershell'
        - '= C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershell'
        - '= \\\?\?\C:Windows\System32\WindowsPowerShell\v1.0\powershell'
        - '= \\\?\?\C:Windows\SysWOW64\WindowsPowerShell\v1.0\powershell'
filter_sdiagnhost:
    ContextInfo|contains: '= C:\WINDOWS\System32\sdiagnhost.exe -Embedding'
filter_citrix:
    ContextInfo|contains: 'ConfigSyncRun.exe'
filter_adace:
    ContextInfo|contains: 'C:\Windows\system32\dsac.exe'
filter_winrm:
    ContextInfo|contains: 'C:\Windows\system32\wsmprovhost.exe -Embedding'
filter_help_update:
    Payload|contains:
        - 'Update-Help'
        - 'Failed to update Help for the module'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
ContextInfomatch= C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershellexcludes:ContextInfo field:"ContextInfo" value:"= C:/Windows/SysWOW64/WindowsPowerShell/v1.0/powershell"
ContextInfomatch= C:/Windows/System32/WindowsPowerShell/v1.0/powershellexcludes:ContextInfo field:"ContextInfo" value:"= C:/Windows/System32/WindowsPowerShell/v1.0/powershell"
ContextInfomatch= C:\WINDOWS\System32\sdiagnhost.exe -Embeddingexcludes:ContextInfo field:"ContextInfo" value:"= C:\WINDOWS\System32\sdiagnhost.exe -Embedding"
ContextInfomatch= C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershellexcludes:ContextInfo field:"ContextInfo" value:"= C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell"
ContextInfomatch= C:\Windows\System32\WindowsPowerShell\v1.0\powershellexcludes:ContextInfo field:"ContextInfo" value:"= C:\Windows\System32\WindowsPowerShell\v1.0\powershell"
ContextInfomatch= \\\?\?\C:Windows\SysWOW64\WindowsPowerShell\v1.0\powershellexcludes:ContextInfo field:"ContextInfo" value:"= \\\?\?\C:Windows\SysWOW64\WindowsPowerShell\v1.0\powershell"
ContextInfomatch= \\\?\?\C:Windows\System32\WindowsPowerShell\v1.0\powershellexcludes:ContextInfo field:"ContextInfo" value:"= \\\?\?\C:Windows\System32\WindowsPowerShell\v1.0\powershell"
ContextInfomatch= powershellexcludes:ContextInfo field:"ContextInfo" value:"= powershell"
ContextInfomatchC:\Windows\system32\dsac.exeexcludes:ContextInfo field:"ContextInfo" value:"C:\Windows\system32\dsac.exe"
ContextInfomatchC:\Windows\system32\wsmprovhost.exe -Embeddingexcludes:ContextInfo field:"ContextInfo" value:"C:\Windows\system32\wsmprovhost.exe -Embedding"
ContextInfomatchConfigSyncRun.exeexcludes:ContextInfo field:"ContextInfo" value:"ConfigSyncRun.exe"
PayloadmatchFailed to update Help for the moduleexcludes:Payload field:"Payload" value:"Failed to update Help for the module"
PayloadmatchUpdate-Helpexcludes:Payload field:"Payload" value:"Update-Help"

Indicators

These rows show field, operator, and value matches.