Sigma rule: Clear PowerShell History - PowerShell
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-d5c0dff53501, updated 2022-12-02T00:00:00.000Z.
Rule
- Title
- Clear PowerShell History - PowerShell
- Status
- test
- Level
- medium
- Author
- Ilyas Ochkov, Jonhnathan Ribeiro, Daniil Yugoslavskiy, oscd.community
- Date
- 2022-01-25
- Modified
- 2022-12-02
- File
- rules/windows/powershell/powershell_script/posh_ps_clear_powershell_history.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects keywords that could indicate clearing PowerShell history
Log source
- product
- windows
- category
- ps_script
- definition
- Requirements: Script Block Logging must be enabled
Detection
selection1a:
ScriptBlockText|contains:
- 'del'
- 'Remove-Item'
- 'rm'
selection1b:
ScriptBlockText|contains: '(Get-PSReadlineOption).HistorySavePath'
selection_2:
ScriptBlockText|contains|all:
- 'Set-PSReadlineOption'
- '–HistorySaveStyle' # not sure if the homoglyph –/- is intended, just checking for both
- 'SaveNothing'
selection_3:
ScriptBlockText|contains|all:
- 'Set-PSReadlineOption'
- '-HistorySaveStyle'
- 'SaveNothing'
condition: 1 of selection_* or all of selection1*False positives (as the rule lists them)
- Legitimate PowerShell scripts
Tags
- attack.stealth
- attack.t1070.003
MITRE ATT&CK ids this rule names
Related rules
- dfba4ce1-e0ea-495f-986e-97140f31af2d (derived)
References
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_clear_powershell_history.yml
Sources and licences
SigmaHQ
"Clear PowerShell History - PowerShell" by Ilyas Ochkov, Jonhnathan Ribeiro, Daniil Yugoslavskiy, oscd.community (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_script/posh_ps_clear_powershell_history.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License
Cite this page
Dragons Eye Ransomware Tracker, "Sigma rule: Clear PowerShell History - PowerShell",
entity page, dataset version ref-d5c0dff53501, updated 2022-12-02T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/26b692dc-1722-49b2-b496-a8258aa6371d (accessed 2026-11-03).
Underlying source: SigmaHQ rule 26b692dc-1722-49b2-b496-a8258aa6371d, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.