{"id":"0f017df3-8f5a-414f-ad6b-24aff1128278","title":"Suspicious Eventlog Clear","description":"Detects usage of known powershell cmdlets such as \"Clear-EventLog\" to clear the Windows event logs","author":"Nasreddine Bencherchali (Nextron Systems), Swachchhanda Shrawan Poudel (Nextron Systems)","status":"test","level":"medium","date":"2022-09-12","modified":"2025-10-06","tags":["attack.defense-impairment","attack.t1685.005"],"technique_ids":["T1685.005"],"logsource":{"product":"windows","category":"ps_script","definition":"Requirements: Script Block Logging must be enabled"},"falsepositives":["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"],"references":["https://twitter.com/oroneequalsone/status/1568432028361830402","https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.001/T1070.001.md","https://eqllib.readthedocs.io/en/latest/analytics/5b223758-07d6-4100-9e11-238cfdd0fe97.html","https://stackoverflow.com/questions/66011412/how-to-clear-a-event-log-in-powershell-7","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_","https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog.clear"],"source_path":"rules/windows/powershell/powershell_script/posh_ps_susp_clear_eventlog.yml","source_sha256":"fef8ceb93aa02d05a7e7345e11c4e47c38b8b98fc000f90a593a450b1a4c147b","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/powershell/powershell_script/posh_ps_susp_clear_eventlog.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Suspicious Eventlog Clear\nid: 0f017df3-8f5a-414f-ad6b-24aff1128278\nrelated:\n    - id: cc36992a-4671-4f21-a91d-6c2b72a2edf5\n      type: derived\nstatus: test\ndescription: Detects usage of known powershell cmdlets such as \"Clear-EventLog\" to clear the Windows event logs\nreferences:\n    - https://twitter.com/oroneequalsone/status/1568432028361830402\n    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070.001/T1070.001.md\n    - https://eqllib.readthedocs.io/en/latest/analytics/5b223758-07d6-4100-9e11-238cfdd0fe97.html\n    - https://stackoverflow.com/questions/66011412/how-to-clear-a-event-log-in-powershell-7\n    - 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_\n    - https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog.clear\nauthor: Nasreddine Bencherchali (Nextron Systems), Swachchhanda Shrawan Poudel (Nextron Systems)\ndate: 2022-09-12\nmodified: 2025-10-06\ntags:\n    - attack.defense-impairment\n    - attack.t1685.005\nlogsource:\n    product: windows\n    category: ps_script\n    definition: 'Requirements: Script Block Logging must be enabled'\ndetection:\n    selection:\n        - ScriptBlockText|contains:\n              - 'Clear-EventLog '\n              - 'Remove-EventLog '\n              - 'Limit-EventLog '\n              - 'Clear-WinEvent '\n        - ScriptBlockText|contains|all:\n              - 'Eventing.Reader.EventLogSession' # [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName)\n              - 'ClearLog'\n        - ScriptBlockText|contains|all:\n              - 'Diagnostics.EventLog'\n              - 'Clear'\n    condition: selection\nfalsepositives:\n    - 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\nlevel: medium\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1685.005","id":"T1685.005","name":"Clear Windows Event Logs","page":"techniques/enterprise/T1685.005/"}],"data_path":"data/detection-rules/0f017df3-8f5a-414f-ad6b-24aff1128278.json","kind":"sigma"}
