Detection rules › Sigma

Suspicious PowerShell WindowStyle Option

Status
test
Severity
medium
Log source
product windows, category ps_script
Author
frack113, Tim Shelton (fp AWS)
Source
github.com/SigmaHQ/sigma

Adversaries may use hidden windows to conceal malicious activity from the plain sight of users. In some cases, windows that would typically be displayed when an application carries out an operation can be hidden

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious PowerShell WindowStyle Option
id: 313fbb0a-a341-4682-848d-6d6f8c4fab7c
status: test
description: |
    Adversaries may use hidden windows to conceal malicious activity from the plain sight of users.
    In some cases, windows that would typically be displayed when an application carries out an operation can be hidden
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1564.003/T1564.003.md
author: frack113, Tim Shelton (fp AWS)
date: 2021-10-20
modified: 2023-01-03
tags:
    - attack.stealth
    - attack.t1564.003
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains|all:
            - 'powershell'
            - 'WindowStyle'
            - 'Hidden'
    filter:
        ScriptBlockText|contains|all:
            - ':\Program Files\Amazon\WorkSpacesConfig\Scripts\'
            - '$PSScriptRoot\Module\WorkspaceScriptModule\WorkspaceScriptModule'
    condition: selection and not filter
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

selection and not filter

Stage 1: selection

selection:
    ScriptBlockText|contains|all:
        - 'powershell'
        - 'WindowStyle'
        - 'Hidden'

Stage 2: not filter

filter:
    ScriptBlockText|contains|all:
        - ':\Program Files\Amazon\WorkSpacesConfig\Scripts\'
        - '$PSScriptRoot\Module\WorkspaceScriptModule\WorkspaceScriptModule'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
ScriptBlockTextmatch$PSScriptRoot\Module\WorkspaceScriptModule\WorkspaceScriptModule
ScriptBlockTextmatch:\Program Files\Amazon\WorkSpacesConfig\Scripts\

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ScriptBlockTextmatch
  • Hidden corpus 2 (sigma 2)
  • WindowStyle
  • powershell corpus 3 (sigma 3)