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
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
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.evtxIdentifyClear specific event log types from the local computer on the page for Clear-EventLog
Clear-EventLog "Windows PowerShell"IdentifyClear specific multiple log types from the local and remote computers on the page for Clear-EventLog
Clear-EventLog -LogName ODiag, OSession -ComputerName localhost, Server02IdentifyClear all logs on the specified computers then display the event log list on the page for Clear-EventLog
Clear-EventLog -LogName Application, System -ConfirmIdentifyClear 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 Server01IdentifyIncrease the size of an event log on the page for Limit-EventLog
Limit-EventLog -LogName "Windows PowerShell" -MaximumSize 20KBIdentifyRetain an event log for a specified duration on the page for Limit-EventLog
Limit-EventLog -LogName Security -ComputerName "Server01", "Server02" -RetentionDays 7IdentifyChange 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 -ListIdentifyRemove an event log from the local computer on the page for Remove-EventLog
Remove-EventLog -LogName "MyLog"IdentifyRemove an event log from several computers on the page for Remove-EventLog
Remove-EventLog -LogName "MyLog", "TestLog" -ComputerName "Server01", "Server02", "localhost"IdentifyDelete an event source on the page for Remove-EventLog
Remove-EventLog -Source "MyApp"Identify