SigmaHQ/rules/windows/powershell/powershell_clear_powershell_history.yml
2020-11-28 09:26:18 +01:00

51 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

title: Clear PowerShell History
id: dfba4ce1-e0ea-495f-986e-97140f31af2d
status: experimental
description: Detects keywords that could indicate clearing PowerShell history
date: 2019/10/25
modified: 2020/11/28
author: Ilyas Ochkov, Jonhnathan Ribeiro, Daniil Yugoslavskiy, oscd.community
references:
- https://gist.github.com/hook-s3c/7363a856c3cdbadeb71085147f042c1a
tags:
- attack.defense_evasion
- attack.t1070.003
- attack.t1146 # an old one
logsource:
product: windows
service: powershell
detection:
selection_1:
EventID: 4104
selection_2:
ScriptBlockText|contains:
- 'del'
- 'Remove-Item'
- 'rm'
ScriptBlockText|contains|all:
- '(Get-PSReadlineOption).HistorySavePath'
selection_3:
ScriptBlockText|contains|all:
- 'Set-PSReadlineOption'
- 'HistorySaveStyle'
- 'SaveNothing'
selection_4:
EventID: 4103
selection_5:
Payload|contains:
- 'del'
- 'Remove-Item'
- 'rm'
Payload|contains|all:
- '(Get-PSReadlineOption).HistorySavePath'
selection_6:
Payload|contains|all:
- 'Set-PSReadlineOption'
- 'HistorySaveStyle'
- 'SaveNothing'
condition: selection_1 and ( selection_2 or selection_3 ) or
selection_4 and ( selection_5 or selection_6 )
falsepositives:
- Legitimate PowerShell scripts
level: medium