Suspicious PowerShell Get Current User

Detects the use of PowerShell to identify the current logged user.

Sigma rule (View on GitHub)

 1title: Suspicious PowerShell Get Current User
 2id: 4096a49c-7de4-4da0-a230-c66ccd56ea5a
 3status: test
 4description: Detects the use of PowerShell to identify the current logged user.
 5references:
 6    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1033/T1033.md#atomic-test-4---user-discovery-with-env-vars-powershell-script
 7    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1033/T1033.md#atomic-test-5---getcurrent-user-with-powershell-script
 8author: frack113
 9date: 2022-04-04
10tags:
11    - attack.discovery
12    - attack.t1033
13logsource:
14    product: windows
15    category: ps_script
16    definition: 'Requirements: Script Block Logging must be enabled'
17detection:
18    selection:
19        ScriptBlockText|contains:
20            - '[System.Environment]::UserName'
21            - '$env:UserName'
22            - '[System.Security.Principal.WindowsIdentity]::GetCurrent()'
23    condition: selection
24falsepositives:
25    - Legitimate PowerShell scripts
26level: low

References

Related rules

to-top