Detectionmediumtest
Suspicious Eventlog Clear
Detects usage of known powershell cmdlets such as "Clear-EventLog" to clear the Windows event logs
Nasreddine Bencherchali, Swachchhanda Shrawan Poudel (Nextron Systems)Created 2022-09-12Updated 2025-10-060f017df3-8f5a-414f-ad6b-24aff1128278windows
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script
Definition
Requirements: Script Block Logging must be enabled
Detection Logic
Detection Logic1 selector
detection:
selection:
- ScriptBlockText|contains:
- 'Clear-EventLog '
- 'Remove-EventLog '
- 'Limit-EventLog '
- 'Clear-WinEvent '
- ScriptBlockText|contains|all:
- 'Eventing.Reader.EventLogSession' # [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName)
- 'ClearLog'
- ScriptBlockText|contains|all:
- 'Diagnostics.EventLog'
- 'Clear'
condition: selectionFalse Positives
Rare need to clear logs before doing something. Sometimes used by installers or cleaner scripts. The script should be investigated to determine if it's legitimate
MITRE ATT&CK
Tactics
Sub-techniques
Rule Metadata
Rule ID
0f017df3-8f5a-414f-ad6b-24aff1128278
Status
test
Level
medium
Type
Detection
Created
2022-09-12
Modified
2025-10-06
Path
rules/windows/powershell/powershell_script/posh_ps_susp_clear_eventlog.yml
Raw Tags
attack.defense-impairmentattack.t1685.005