# OffSet7: Disable Windows Defender AV Security Monitoring

> 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:Disable Windows Defender AV Security Monitoring:selection_pwsh_binary (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: `\powershell.exe`, `\pwsh.exe`
- when **Filename** is equal to (case-insensitive): `PowerShell.EXE`, `pwsh.dll`

### BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_pwsh_cli (match)
All test lines must match (AND).
- when **Command** contains: `-DisableBehaviorMonitoring $true`, `-DisableRuntimeMonitoring $true`

### BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_sc_binary (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: `\sc.exe`
- when **Filename** is equal to (case-insensitive): `sc.exe`

### BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_sc_tamper_cmd_stop (match)
All test lines must match (AND).
- when **Command** contains: `stop`, `WinDefend`

### BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_sc_tamper_cmd_delete (match)
All test lines must match (AND).
- when **Command** contains: `delete`, `WinDefend`

### BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_sc_tamper_cmd_disabled (match)
All test lines must match (AND).
- when **Command** contains: `config`, `WinDefend`, `start=disabled`

## 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 [BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_pwsh_binary, BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_pwsh_cli]) OR (BB:OffSet7:Disable Windows Defender AV Security Monitoring:selection_sc_binary AND (ANY of [])`

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

1. when the event matches this AQL filter query: `devicetype=12 AND (((((LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe') OR (LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe')) OR (Filename IN('PowerShell.EXE', 'pwsh.dll'))) AND (LOWER(Command) LIKE '%-disablebehaviormonitoring $true%' OR LOWER(Command) LIKE '%-disableruntimemonitoring $true%')) OR (((LOWER("Process Path") LIKE '%\sc.exe' OR LOWER("Process Name") LIKE '%\sc.exe') OR Filename='sc.exe') AND ((LOWER(Command) LIKE '%stop%' AND LOWER(Command) LIKE '%windefend%') OR (LOWER(Command) LIKE '%delete%' AND LOWER(Command) LIKE '%windefend%') OR (LOWER(Command) LIKE '%config%' AND LOWER(Command) LIKE '%windefend%' AND LOWER(Command) LIKE '%start=disabled%'))))`

## Rule response

- Severity 7, credibility 6, 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: Disable Windows Defender AV Security Monitoring (a7ee1722-c3c5-aeff-3212-c777e4733217). Author: ok @securonix invrep-de, oscd.community, frack113. Licence: DRL-1.1.
