Detectionmediumtest

Powershell LocalAccount Manipulation

Adversaries may manipulate accounts to maintain access to victim systems. Account manipulation may consist of any action that preserves adversary access to a compromised account, such as modifying credentials or permission groups

Open in Detection LabConvert ruleBuild Package
François HubautCreated 2021-12-284fdc44df-bfe9-4fcc-b041-68f5a2d3031cwindows
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:
            - 'Disable-LocalUser'
            - 'Enable-LocalUser'
            - 'Get-LocalUser'
            - 'Set-LocalUser'
            - 'New-LocalUser'
            - 'Rename-LocalUser'
            - 'Remove-LocalUser'
    condition: selection
False Positives

Legitimate administrative script

Testing & Validation

Regression Tests

by frack113
Positive Detection Test1 matchevtx

Microsoft-Windows-PowerShell

Rule Metadata
Rule ID
4fdc44df-bfe9-4fcc-b041-68f5a2d3031c
Status
test
Level
medium
Type
Detection
Created
2021-12-28
Path
rules/windows/powershell/powershell_script/posh_ps_localuser.yml
Raw Tags
attack.privilege-escalationattack.persistenceattack.t1098
View on GitHub