Detectionlowtest

Suspicious PowerShell Get Current User

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

Convert In Phoenix Studio

Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.

Launch
François HubautCreated Mon Apr 044096a49c-7de4-4da0-a230-c66ccd56ea5awindows
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: selection
False Positives

Legitimate PowerShell scripts

Rule Metadata
Rule ID
4096a49c-7de4-4da0-a230-c66ccd56ea5a
Status
test
Level
low
Type
Detection
Created
Mon Apr 04
Path
rules/windows/powershell/powershell_script/posh_ps_susp_get_current_user.yml
Raw Tags
attack.discoveryattack.t1033
View on GitHub