PowerShell Hidden WindowStyle Indicator in Script Block Text (Windows)

Flags PowerShell script block text indicating WindowStyle set to Hidden, suggesting concealed execution.

FreeReviewedSigma · Medium · v2
Product
windows
Category
ps_script
Author
frack113, Tim Shelton (fp AWS) (SigmaHQ), DRL 1.1
Published
2021-10-20
Updated
2026-07-31
title: PowerShell Hidden WindowStyle Indicator in Script Block Text (Windows)
id: 07291c94-8c82-4e11-9564-6f1082eb0534
status: test
description: This rule flags PowerShell script block content that includes the terms "powershell", "WindowStyle", and "Hidden", which can indicate an attempt to run with a concealed window. Attackers may use hidden windows to reduce user visibility while executing actions on a host. The detection relies on Script Block Logging telemetry and matches on ScriptBlockText substring content, excluding matches that contain specific Amazon WorkSpaces-related script paths.
references:
  - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1564.003/T1564.003.md
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_susp_windowstyle.yml
author: frack113, Tim Shelton (fp AWS), Huntrule Team
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
license: DRL-1.1
related:
  - id: 313fbb0a-a341-4682-848d-6d6f8c4fab7c
    type: derived