# OffSet7: Suspicious Eventlog Clearing or Configuration Change Activity

> Design for the QRadar Rule Wizard. Not an importable rule and not tested in QRadar.

- Rule type: Event rule (Local), create disabled
- Log source types: Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1

## Building blocks

### BB:OffSet7:Suspicious Eventlog Clearing or Configuration Ch:selection_wevtutil_img (match)
Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
- when **Process Path / Process Name** ends with: `\wevtutil.exe`
- when **Filename** is equal to (case-insensitive): `wevtutil.exe`

### BB:OffSet7:Suspicious Eventlog Clearing or Configuration Ch:selection_wevtutil_cmd (match)
All test lines must match (AND).
- when **Command** contains: `clear-log`, ` cl`, `set-log`, ` sl`, `lfn:`

### BB:OffSet7:Suspicious Eventlog Clearing or Configuration Ch:selection_other_ps_img (match)
All test lines must match (AND).
- when **Process Path / Process Name** ends with: `\powershell.exe`, `\powershell_ise.exe`, `\pwsh.exe`

### BB:OffSet7:Suspicious Eventlog Clearing or Configuration Ch:selection_other_ps_cmd (match)
Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
- when **Command** contains: `Clear-EventLog`, `Remove-EventLog`, `Limit-EventLog`, `Clear-WinEvent`
- when **Command** contains: `Eventing.Reader.EventLogSession`, `ClearLog`
- when **Command** contains: `Diagnostics.EventLog`, `Clear`

### BB:OffSet7:Suspicious Eventlog Clearing or Configuration Ch:selection_other_wmi (match)
All test lines must match (AND).
- when **Process Path / Process Name** ends with: `\powershell.exe`, `\powershell_ise.exe`, `\pwsh.exe`, `\wmic.exe`
- when **Command** contains: `ClearEventLog`

### BB:OffSet7:Suspicious Eventlog Clearing or Configuration Ch:filter_main_msiexec (exclusion)
All test lines must match (AND).
- when **Parent Process Path** is equal to (case-insensitive): `C:\Windows\SysWOW64\msiexec.exe`, `C:\Windows\System32\msiexec.exe`
- when **Command** contains: ` sl`

## Main rule — option A (building blocks)

1. when the event(s) were detected by one or more of these log source types: `Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1`
2. when an event matches the condition built from these building blocks: `(((ALL of []) OR ((ALL of []) OR BB:OffSet7:Suspicious Eventlog Clearing OR Configuration Ch:selection_other_wmi) AND NOT (ANY of [BB:OffSet7:Suspicious Eventlog Clearing OR Configuration Ch:filter_main_msiexec])`

## Main rule — option B (AQL filter test)

1. when the event matches this AQL filter query: `devicetype=12 AND ((((LOWER("Process Path") LIKE '%\wevtutil.exe' OR LOWER("Process Name") LIKE '%\wevtutil.exe') OR Filename='wevtutil.exe') AND (LOWER(Command) LIKE '%clear-log %' OR LOWER(Command) LIKE '% cl %' OR LOWER(Command) LIKE '%set-log %' OR LOWER(Command) LIKE '% sl %' OR LOWER(Command) LIKE '%lfn:%')) OR (((LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\powershell_ise.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe') OR (LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\powershell_ise.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe')) AND ((LOWER(Command) LIKE '%clear-eventlog %' OR LOWER(Command) LIKE '%remove-eventlog %' OR LOWER(Command) LIKE '%limit-eventlog %' OR LOWER(Command) LIKE '%clear-winevent %') OR (LOWER(Command) LIKE '%eventing.reader.eventlogsession%' AND LOWER(Command) LIKE '%clearlog%') OR (LOWER(Command) LIKE '%diagnostics.eventlog%' AND LOWER(Command) LIKE '%clear%'))) OR (((LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\powershell_ise.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe' OR LOWER("Process Path") LIKE '%\wmic.exe') OR (LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\powershell_ise.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe' OR LOWER("Process Name") LIKE '%\wmic.exe')) AND LOWER(Command) LIKE '%cleareventlog%')) AND (NOT((("Parent Process Path" IN('C:\Windows\SysWOW64\msiexec.exe', 'C:\Windows\System32\msiexec.exe')) AND LOWER(Command) LIKE '% sl %')))`

## Rule response

- Severity 7, credibility 8, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)

## Limitations

- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Source rule: Suspicious Eventlog Clearing or Configuration Change Activity (cc36992a-4671-4f21-a91d-6c2b72a2edf5). Author: Ecco, Daniil Yugoslavskiy, oscd.community, D3F7A5105, Swachchhanda Shrawan Poudel (Nextron Systems). Licence: DRL-1.1.
