Query: alert when Detects failed attempts to clear Windows event logs via the WMI NTEventLogFile ClearEventLog method. Event 5858 in the W
Matching passage: Sigma rule: Detects failed attempts to clear Windows event logs via the WMI NTEventLogFile ClearEventLog method. Event 5858 in the W. Logsource: windows / wmi. Rule: title: Failed Event Log Clear Via WMI NTEventLogFile ClearEventLog id: d4f1a2b3-7c8e-4d5f-b6a9-1e0c2d3f4e5b status: test description: '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. ' references: - https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/cleareventlog-method-in-class-win32-nteventlogfile author: Swachchhanda Shrawan Poudel (Nextron Systems) date: 2026-07-01 tags: - attack.defense-impairment - attack.t1685.005 logsource: product: windows service: wmi detection: selection: EventID: 5858 Operation|contains|all: - Win32_NTEventlogFile - cleareventlog condition: selection falsepositives: - Unknown level: medium regression_tests_path: regression_data/rules/windows/builtin/wmi/win_wmi_activity_nteventlogfile_cleareventlog/info.yml
Near-miss passage: Sigma rule: Detects changes to the "Default" property for keys located in the \Software\Microsoft\Windows\CurrentVersion\App Paths\. Logsource: windows / registry_set. Rule: title: Potential Persistence Via App Paths Default Property id: 707e097c-e20f-4f67-8807-1f72ff4500d6 status: test description: 'Detects changes to the "Default" property for keys located in the \Software\Microsoft\Windows\CurrentVersion\App Paths\ registry. Which might be used as a method of persistence The entries found under App Paths are used primarily for the following purposes. First, to map an application''s executable file name to that file''s fully qualified path. Second, to prepend information to the PATH environment variable on a per-application, per-process basis. ' references: - https://www.hexacorn.com/blog/2013/01/19/beyond-good-ol-run-key-part-3/ - https://learn.microsoft.com/en-us/windows/win32/shell/app-registration author: Nasreddine Bencherchali (Nextron Systems) date: 2022-08-10 modified: 2023-08-17 tags: - attack.privilege-escalation - attack.persistence - attack.t1546.012 logsource: category: registry_set product: windows detection: selection: TargetObject|contains: \SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths TargetObject|endswith: - (Default) - Path Details|contains: - \Users\Public - \AppData\Local\Temp\ - \Windows\Temp\ - \Desktop\ - \Downloads\ - '%temp%' - '%tmp%' - iex - Invoke- - rundll32 - regsvr32 - mshta - cscript - wscript - .bat - .hta - .dll - .ps1 condition: selection falsepositives: - Legitimate applications registering their binary from on of the suspicious locations mentioned above (tune it) level: high