Detection rules › Sigma

Suspicious PowerShell Invocation From Script Engines

Status
test
Severity
medium
Log source
category process_creation, product windows
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects suspicious powershell invocations from interpreters or unusual programs

Known false positives

  • Microsoft Operations Manager (MOM)
  • Other scripts

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Suspicious PowerShell Invocation From Script Engines
id: 95eadcb2-92e4-4ed1-9031-92547773a6db
status: test
description: Detects suspicious powershell invocations from interpreters or unusual programs
references:
    - https://www.securitynewspaper.com/2017/03/20/attackers-leverage-excel-powershell-dns-latest-non-malware-attack/
author: Florian Roth (Nextron Systems)
date: 2019-01-16
modified: 2023-01-05
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith:
            - '\wscript.exe'
            - '\cscript.exe'
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
    filter_health_service:
        CurrentDirectory|contains: '\Health Service State\'
    condition: selection and not 1 of filter_*
falsepositives:
    - Microsoft Operations Manager (MOM)
    - Other scripts
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_*

Stage 1: selection

selection:
    ParentImage|endswith:
        - '\wscript.exe'
        - '\cscript.exe'
    Image|endswith:
        - '\powershell.exe'
        - '\pwsh.exe'

Stage 2: not filter_health_service

filter_health_service:
    CurrentDirectory|contains: '\Health Service State\'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
CurrentDirectorymatch\Health Service State\excludes:CurrentDirectory field:"CurrentDirectory" value:"\Health Service State\"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Imageends_with
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
  • \pwsh.exe corpus 165 (sigma 164, kusto 1)
field:"Image" kind:ends_with
ParentImageends_with
  • \cscript.exe corpus 17 (sigma 17)
  • \wscript.exe corpus 19 (sigma 19)
field:"ParentImage" kind:ends_with