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.
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 selection2bFalse Positives
Unknown
False positive likelihood has not been assessed. Additional context may be needed during triage.
References
MITRE ATT&CK
Tactics
Techniques
Sub-techniques
Rule Metadata
Rule ID
bde47d4b-9987-405c-94c7-b080410e8ea7
Status
test
Level
high
Type
Detection
Created
2021-11-25
Modified
2022-12-25
Author
Path
rules/windows/powershell/powershell_script/posh_ps_clearing_windows_console_history.yml
Raw Tags
attack.stealthattack.t1070attack.t1070.003