Get-ADUser Enumeration Using UserAccountControl Flags

 Original Source: [Sigma source]
Title: Get-ADUser Enumeration Using UserAccountControl Flags
Status: test
Description:Detects AS-REP roasting is an attack that is often-overlooked. It is not very common as you have to explicitly set accounts that do not require pre-authentication.
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/
Author: frack113
Date: 2022-03-17
modified:None
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