Detectionhightest

Clearing Windows Console History

Identifies when a user attempts to clear console history. An adversary may clear the command history of a compromised account to conceal the actions undertaken during an intrusion.

Convert In Phoenix Studio

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

Launch
Austin SongerCreated Thu Nov 25Updated Sun Dec 25bde47d4b-9987-405c-94c7-b080410e8ea7windows
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script

Definition

Requirements: Script Block Logging must be enabled

Detection Logic
Detection Logic3 selectors
detection:
    selection1:
        ScriptBlockText|contains: Clear-History
    selection2a:
        ScriptBlockText|contains:
            - Remove-Item
            - rm
    selection2b:
        ScriptBlockText|contains:
            - ConsoleHost_history.txt
            - (Get-PSReadlineOption).HistorySavePath
    condition: selection1 or selection2a and selection2b
False Positives
Unknown

False positive likelihood has not been assessed. Additional context may be needed during triage.

Rule Metadata
Rule ID
bde47d4b-9987-405c-94c7-b080410e8ea7
Status
test
Level
high
Type
Detection
Created
Thu Nov 25
Modified
Sun Dec 25
Path
rules/windows/powershell/powershell_script/posh_ps_clearing_windows_console_history.yml
Raw Tags
attack.defense-evasionattack.t1070attack.t1070.003
View on GitHub