Suspicious Eventlog Clear
Detects usage of known powershell cmdlets such as "Clear-EventLog" to clear the Windows event logs
Sigma rule (View on GitHub)
1title: Suspicious Eventlog Clear
2id: 0f017df3-8f5a-414f-ad6b-24aff1128278
3related:
4 - id: cc36992a-4671-4f21-a91d-6c2b72a2edf5
5 type: derived
6status: test
7description: Detects usage of known powershell cmdlets such as "Clear-EventLog" to clear the Windows event logs
8references:
9 - https://twitter.com/oroneequalsone/status/1568432028361830402
10 - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.001/T1070.001.md
11 - https://eqllib.readthedocs.io/en/latest/analytics/5b223758-07d6-4100-9e11-238cfdd0fe97.html
12 - https://stackoverflow.com/questions/66011412/how-to-clear-a-event-log-in-powershell-7
13 - https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventing.reader.eventlogsession.clearlog?view=windowsdesktop-9.0&viewFallbackFrom=dotnet-plat-ext-5.0#System_Diagnostics_Eventing_Reader_EventLogSession_ClearLog_System_String_
14 - https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog.clear
15author: Nasreddine Bencherchali (Nextron Systems), Swachchhanda Shrawan Poudel (Nextron Systems)
16date: 2022-09-12
17modified: 2025-03-12
18tags:
19 - attack.defense-evasion
20 - attack.t1070.001
21logsource:
22 product: windows
23 category: ps_script
24 definition: 'Requirements: Script Block Logging must be enabled'
25detection:
26 selection:
27 - ScriptBlockText|contains:
28 - 'Clear-EventLog '
29 - 'Remove-EventLog '
30 - 'Limit-EventLog '
31 - 'Clear-WinEvent '
32 - ScriptBlockText|contains|all:
33 - 'Eventing.Reader.EventLogSession' # [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName)
34 - 'ClearLog'
35 - ScriptBlockText|contains:
36 - 'Diagnostics.EventLog'
37 - 'Clear'
38 condition: selection
39falsepositives:
40 - 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
41level: medium
References
Related rules
- Suspicious Eventlog Clearing or Configuration Change Activity
- Eventlog Cleared
- Important Windows Eventlog Cleared
- NotPetya Ransomware Activity
- Security Eventlog Cleared