Sigma rule: Clear PowerShell History - PowerShell Module
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-a19af34aebbc, updated 2022-12-02T00:00:00.000Z.
Rule
- Title
- Clear PowerShell History - PowerShell Module
- Status
- test
- Level
- medium
- Author
- Ilyas Ochkov, Jonhnathan Ribeiro, Daniil Yugoslavskiy, oscd.community
- Date
- 2019-10-25
- Modified
- 2022-12-02
- File
- rules/windows/powershell/powershell_module/posh_pm_clear_powershell_history.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects keywords that could indicate clearing PowerShell history
Log source
- product
- windows
- category
- ps_module
- definition
- 0ad03ef1-f21b-4a79-8ce8-e6900c54b65b
Detection
selection_1a_payload:
Payload|contains:
- 'del'
- 'Remove-Item'
- 'rm'
selection_1b_payload:
Payload|contains: '(Get-PSReadlineOption).HistorySavePath'
selection_payload_2:
Payload|contains|all:
- 'Set-PSReadlineOption'
- '–HistorySaveStyle' # not sure if the homoglyph –/- is intended, just checking for both
- 'SaveNothing'
selection_payload_3:
Payload|contains|all:
- 'Set-PSReadlineOption'
- '-HistorySaveStyle'
- 'SaveNothing'
condition: 1 of selection_payload_* or all of selection_1*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_module/posh_pm_clear_powershell_history.yml
Sources and licences
SigmaHQ
"Clear PowerShell History - PowerShell Module" by Ilyas Ochkov, Jonhnathan Ribeiro, Daniil Yugoslavskiy, oscd.community (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/powershell/powershell_module/posh_pm_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 Module",
entity page, dataset version ref-a19af34aebbc, updated 2022-12-02T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/f99276ad-d122-4989-a09a-d00904a5f9d2 (accessed 2026-11-03).
Underlying source: SigmaHQ rule f99276ad-d122-4989-a09a-d00904a5f9d2, 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.