Detectionmediumtest

Failed Event Log Clear Via WMI NTEventLogFile ClearEventLog

Detects failed attempts to clear Windows event logs via the WMI NTEventLogFile ClearEventLog method. Event 5858 in the WMI-Activity operational log is an error event, meaning it is only generated when the WMI operation encounters an error (e.g. access denied, provider failure). It could be an indication of an attacker attempting to clear event logs via WMI, but failing due to insufficient privileges or other issues. Successful clearing operations will NOT produce this event; for those, correlate with Security event 1102 or System event 104.

Open in Detection LabConvert ruleBuild Package
Swachchhanda Shrawan Poudel (Nextron Systems)Created 2026-07-01d4f1a2b3-7c8e-4d5f-b6a9-1e0c2d3f4e5bwindows
Log Source
Windowswmi
ProductWindows← raw: windows
Servicewmi← raw: wmi
Detection Logic
Detection Logic1 selector
detection:
    selection:
        EventID: 5858
        Operation|contains|all:
            - 'Win32_NTEventlogFile'
            - 'cleareventlog'
    condition: selection
False Positives
Unknown

False positive likelihood has not been assessed. Additional context may be needed during triage.

Testing & Validation

Regression Tests

by Swachchhanda Shrawan Poudel (Nextron Systems)
Positive Detection Test1 matchevtx

Microsoft-Windows-Sysmon

Rule Metadata
Rule ID
d4f1a2b3-7c8e-4d5f-b6a9-1e0c2d3f4e5b
Status
test
Level
medium
Type
Detection
Created
2026-07-01
Path
rules/windows/builtin/wmi/win_wmi_activity_nteventlogfile_cleareventlog.yml
Raw Tags
attack.defense-impairmentattack.t1685.005
View on GitHub