CmdID

CmdID / Rules / Windows

Suspicious Eventlog Clearing or Configuration Change Activity

A Sigma rule for process creation on Windows, by Ecco, Daniil Yugoslavskiy, oscd.community, D3F7A5105, Swachchhanda Shrawan Poudel (Nextron Systems).

high 2 ATT&CK techniques 7 programs it names 11 everyday examples trip it

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_main_msiexec:
    CommandLine|contains: ' sl '
    ParentImage:
      - 'C:\Windows\SysWOW64\msiexec.exe'
      - 'C:\Windows\System32\msiexec.exe'
  selection_other_ps_cmd:
    - CommandLine|contains:
        - 'Clear-EventLog '
        - 'Remove-EventLog '
        - 'Limit-EventLog '
        - 'Clear-WinEvent '
    - CommandLine|contains|all:
        - 'Eventing.Reader.EventLogSession'
        - 'ClearLog'
    - CommandLine|contains|all:
        - 'Diagnostics.EventLog'
        - 'Clear'
  selection_other_ps_img:
    Image|endswith:
      - '\powershell.exe'
      - '\powershell_ise.exe'
      - '\pwsh.exe'
  selection_other_wmi:
    CommandLine|contains: 'ClearEventLog'
    Image|endswith:
      - '\powershell.exe'
      - '\powershell_ise.exe'
      - '\pwsh.exe'
      - '\wmic.exe'
  selection_wevtutil_cmd:
    CommandLine|contains:
      - 'clear-log '
      - ' cl '
      - 'set-log '
      - ' sl '
      - 'lfn:'
  selection_wevtutil_img:
    - Image|endswith: '\wevtutil.exe'
    - OriginalFileName: 'wevtutil.exe'
  condition: ((all of selection_wevtutil_*) or (all of selection_other_ps_*) or selection_other_wmi) and not 1 of filter_main_*

The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Ecco, Daniil Yugoslavskiy, oscd.community, D3F7A5105, Swachchhanda Shrawan Poudel (Nextron Systems), under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.

Command lines that trip it

everyday examples from tldr-pages, CC BY 4.0, each read by CmdID

Clear all of the events from the Application log after saving them to C:\admin\backups\a10306.evtx on the page for wevtutil

wevtutil cl Application /bu:C:\admin\backups\a10306.evtxIdentify

Clear specific event log types from the local computer on the page for Clear-EventLog

Clear-EventLog "Windows PowerShell"Identify

Clear specific multiple log types from the local and remote computers on the page for Clear-EventLog

Clear-EventLog -LogName ODiag, OSession -ComputerName localhost, Server02Identify

Clear all logs on the specified computers then display the event log list on the page for Clear-EventLog

Clear-EventLog -LogName Application, System -ConfirmIdentify

Clear all logs on the specified computers then display the event log list on the page for Clear-EventLog

function clear-all-event-logs ($ComputerName="localhost") { $logs = Get-EventLog -ComputerName $ComputerName -List | ForEach-Object {$_.Log} $logs | ForEach-Object {Clear-EventLog -ComputerName $ComputerName -LogName $_ } Get-EventLog -ComputerName $ComputerName -List } clear-all-event-logs -ComputerName Server01Identify

Increase the size of an event log on the page for Limit-EventLog

Limit-EventLog -LogName "Windows PowerShell" -MaximumSize 20KBIdentify

Retain an event log for a specified duration on the page for Limit-EventLog

Limit-EventLog -LogName Security -ComputerName "Server01", "Server02" -RetentionDays 7Identify

Change the overflow action of all event logs on the page for Limit-EventLog

$Logs = Get-EventLog -List | foreach {$_.Log} Limit-EventLog -OverflowAction OverwriteOlder -LogName $Logs Get-EventLog -ListIdentify

Remove an event log from the local computer on the page for Remove-EventLog

Remove-EventLog -LogName "MyLog"Identify

Remove an event log from several computers on the page for Remove-EventLog

Remove-EventLog -LogName "MyLog", "TestLog" -ComputerName "Server01", "Server02", "localhost"Identify

Delete an event source on the page for Remove-EventLog

Remove-EventLog -Source "MyApp"Identify

Programs and files it names

their pages here

ATT&CK

the techniques it is tagged with
T1685.001Disable or Modify Tools: Disable or Modify Windows Event Log
T1685.005Disable or Modify Tools: Clear Windows Event Logs