# OffSet7: Suspicious Windows Defender Registry Key Tampering Via Reg.EXE

> 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 Windows Defender Registry Key Tamperi:selection_root_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: `\reg.exe`
- when **Filename** is equal to (case-insensitive): `reg.exe`

### BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_root_path (match)
All test lines must match (AND).
- when **Command** contains: `SOFTWARE\Microsoft\Windows Defender\`, `SOFTWARE\Policies\Microsoft\Windows Defender Security Center`, `SOFTWARE\Policies\Microsoft\Windows Defender\`

### BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_dword_0 (match)
All test lines must match (AND).
- when **Command** contains: ` add`, `d 0`
- when **Command** contains: `DisallowExploitProtectionOverride`, `EnableControlledFolderAccess`, `MpEnablePus`, `PUAProtection`, `SpynetReporting`, `SubmitSamplesConsent`, `TamperProtection`

### BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_dword_1 (match)
All test lines must match (AND).
- when **Command** contains: ` add`, `d 1`
- when **Command** contains: `DisableAccess`, `DisableAntiSpyware`, `DisableAntiSpywareRealtimeProtection`, `DisableAntiVirus`, `DisableAntiVirusSignatures`, `DisableArchiveScanning`, `DisableBehaviorMonitoring`, `DisableBlockAtFirstSeen`, `DisableCloudProtection`, `DisableConfig`, `DisableEnhancedNotifications`, `DisableIntrusionPreventionSystem`, `DisableIOAVProtection`, `DisableNetworkProtection`, `DisableOnAccessProtection`, `DisablePrivacyMode`, `DisableRealtimeMonitoring`, `DisableRoutinelyTakingAction`, `DisableScanOnRealtimeEnable`, `DisableScriptScanning`, `DisableSecurityCenter`, `Notification_Suppress`, `SignatureDisableUpdateOnStartupWithoutEngine`

## 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:Suspicious Windows Defender Registry Key Tamperi:selection_root_img, BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_root_path]) AND (ANY of [BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_dword_0, BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_dword_1])`

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

1. when the event matches this AQL filter query: `devicetype=12 AND (((LOWER("Process Path") LIKE '%\reg.exe' OR LOWER("Process Name") LIKE '%\reg.exe') OR Filename='reg.exe') AND (LOWER(Command) LIKE '%software\microsoft\windows defender\%' OR LOWER(Command) LIKE '%software\policies\microsoft\windows defender security center%' OR LOWER(Command) LIKE '%software\policies\microsoft\windows defender\%')) AND (((LOWER(Command) LIKE '% add %' AND LOWER(Command) LIKE '%d 0%') AND (LOWER(Command) LIKE '%disallowexploitprotectionoverride%' OR LOWER(Command) LIKE '%enablecontrolledfolderaccess%' OR LOWER(Command) LIKE '%mpenablepus%' OR LOWER(Command) LIKE '%puaprotection%' OR LOWER(Command) LIKE '%spynetreporting%' OR LOWER(Command) LIKE '%submitsamplesconsent%' OR LOWER(Command) LIKE '%tamperprotection%')) OR ((LOWER(Command) LIKE '% add %' AND LOWER(Command) LIKE '%d 1%') AND (LOWER(Command) LIKE '%disableaccess%' OR LOWER(Command) LIKE '%disableantispyware%' OR LOWER(Command) LIKE '%disableantispywarerealtimeprotection%' OR LOWER(Command) LIKE '%disableantivirus%' OR LOWER(Command) LIKE '%disableantivirussignatures%' OR LOWER(Command) LIKE '%disablearchivescanning%' OR LOWER(Command) LIKE '%disablebehaviormonitoring%' OR LOWER(Command) LIKE '%disableblockatfirstseen%' OR LOWER(Command) LIKE '%disablecloudprotection%' OR LOWER(Command) LIKE '%disableconfig%' OR LOWER(Command) LIKE '%disableenhancednotifications%' OR LOWER(Command) LIKE '%disableintrusionpreventionsystem%' OR LOWER(Command) LIKE '%disableioavprotection%' OR LOWER(Command) LIKE '%disablenetworkprotection%' OR LOWER(Command) LIKE '%disableonaccessprotection%' OR LOWER(Command) LIKE '%disableprivacymode%' OR LOWER(Command) LIKE '%disablerealtimemonitoring%' OR LOWER(Command) LIKE '%disableroutinelytakingaction%' OR LOWER(Command) LIKE '%disablescanonrealtimeenable%' OR LOWER(Command) LIKE '%disablescriptscanning%' OR LOWER(Command) LIKE '%disablesecuritycenter%' OR LOWER(Command) LIKE '%notification_suppress%' OR LOWER(Command) LIKE '%signaturedisableupdateonstartupwithoutengine%')))`

## 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: Suspicious Windows Defender Registry Key Tampering Via Reg.EXE (452bce90-6fb0-43cc-97a5-affc283139b3). Author: Florian Roth (Nextron Systems), Swachchhanda Shrawan Poudel, Nasreddine Bencherchali (Nextron Systems). Licence: DRL-1.1.
