Detectionlowtest
Suspicious PowerShell Get Current User
Detects the use of PowerShell to identify the current logged user.
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script
Definition
Requirements: Script Block Logging must be enabled
Detection Logic
Detection Logic1 selector
detection:
selection:
ScriptBlockText|contains:
- '[System.Environment]::UserName'
- '$env:UserName'
- '[System.Security.Principal.WindowsIdentity]::GetCurrent()'
condition: selectionFalse Positives
Legitimate PowerShell scripts
MITRE ATT&CK
Tactics
Techniques
Rule Metadata
Rule ID
4096a49c-7de4-4da0-a230-c66ccd56ea5a
Status
test
Level
low
Type
Detection
Created
2022-04-04
Author
Path
rules/windows/powershell/powershell_script/posh_ps_susp_get_current_user.yml
Raw Tags
attack.discoveryattack.t1033