PowerShell Get-ADUser Enumeration Using UserAccountControl DONT_REQ_PREAUTH Flag

Flags Get-ADUser PowerShell scripts enumerating accounts by UserAccountControl DONT_REQ_PREAUTH (4194304).

FreeReviewedSigma · Medium · v2
Product
windows
Category
ps_script
Author
frack113 (SigmaHQ), DRL 1.1
Published
2022-03-17
Updated
2026-07-31
title: PowerShell Get-ADUser Enumeration Using UserAccountControl DONT_REQ_PREAUTH Flag
id: f0f9d2ba-0030-4eb4-b09e-48bd1a58525b
status: test
description: This rule matches PowerShell script block content that calls Get-ADUser with a -Filter expression referencing the UserAccountControl -band value 4194304 (DONT_REQ_PREAUTH). This behavior is commonly used to enumerate accounts configured to not require pre-authentication, which can enable follow-on credential access techniques. Detection relies on Script Block Logging telemetry capturing the relevant text patterns in PowerShell.
references:
  - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1069.002/T1069.002.md#atomic-test-11---get-aduser-enumeration-using-useraccountcontrol-flags-as-rep-roasting
  - https://shellgeek.com/useraccountcontrol-flags-to-manipulate-properties/
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_as_rep_roasting.yml
author: frack113, Huntrule Team
date: 2022-03-17
tags:
  - attack.discovery
  - attack.t1033
logsource:
  product: windows
  category: ps_script
  definition: "Requirements: Script Block Logging must be enabled"
detection:
  selection:
    ScriptBlockText|contains|all:
      - Get-ADUser
      - -Filter
      - useraccountcontrol
      - -band
      - "4194304"
  condition: selection
falsepositives:
  - Legitimate PowerShell scripts
level: medium
license: DRL-1.1
related:
  - id: 96c982fe-3d08-4df4-bed2-eb14e02f21c8
    type: derived