Detection rule
Suspicious Windows Defender Registry Key Tampering Via Reg.EXE
Overview
Detects the usage of "reg.exe" to tamper with different Windows Defender registry keys in order to disable some important features related to protection and detection
- Rule id
452bce90-6fb0-43cc-97a5-affc283139b3- ATT&CK techniques
- T1685 Disable or Modify Tools
- Severity
- High
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, INC Ransom, Akira, safepay, Play, braincipher, majinahanashi
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
2 of 2 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 452bce90-6fb0-43cc-97a5-affc283139b3
title: Suspicious Windows Defender Registry Key Tampering Via Reg.EXE
id: 452bce90-6fb0-43cc-97a5-affc283139b3
status: test
description: |
Detects the usage of "reg.exe" to tamper with different Windows Defender registry keys in order to disable some important features related to protection and detection
references:
- https://thedfirreport.com/2022/03/21/apt35-automates-initial-access-using-proxyshell/
- https://web.archive.org/web/20240111104527/https://github.com/swagkarna/Defeat-Defender-V1.2.0/tree/ae4059c4276da6f6303b8f53cdff085ecae88a91
- https://www.elevenforum.com/t/video-guide-how-to-completely-disable-microsoft-defender-antivirus.14608/page-2
- https://tria.ge/241231-j9yatstqbm/behavioral1
author: Florian Roth (Nextron Systems), Swachchhanda Shrawan Poudel, Nasreddine Bencherchali (Nextron Systems)
date: 2022-03-22
modified: 2025-06-04
tags:
- attack.defense-impairment
- attack.t1685
logsource:
category: process_creation
product: windows
detection:
selection_root_img:
- Image|endswith: '\reg.exe'
- OriginalFileName: 'reg.exe'
selection_root_path:
CommandLine|contains:
- 'SOFTWARE\Microsoft\Windows Defender\'
- 'SOFTWARE\Policies\Microsoft\Windows Defender Security Center'
- 'SOFTWARE\Policies\Microsoft\Windows Defender\'
selection_dword_0:
CommandLine|contains|all:
- ' add '
- 'd 0'
CommandLine|contains:
- 'DisallowExploitProtectionOverride'
- 'EnableControlledFolderAccess'
- 'MpEnablePus'
- 'PUAProtection'
- 'SpynetReporting'
- 'SubmitSamplesConsent'
- 'TamperProtection'
selection_dword_1:
CommandLine|contains|all:
- ' add '
- 'd 1'
CommandLine|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'
condition: all of selection_root_* and 1 of selection_dword_*
falsepositives:
- Rare legitimate use by administrators to test software (should always be investigated)
level: highQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE 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%')))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Suspicious Windows Defender Registry Key Tampering Via Reg.EXE- Rule type
- Event rule (Local)
- 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.Process Path / Process Nameends with:\reg.exeFilenameis equal to (case-insensitive):reg.exe
BB:OffSet7:Suspicious Windows Defender Registry Key Tamperi:selection_root_path(match)All test lines must match (AND).Commandcontains: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).Commandcontains:add,d 0Commandcontains: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).Commandcontains:add,d 1Commandcontains: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)
- 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 - 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)
- 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.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
(Image="*\\reg.exe" OR OriginalFileName="reg.exe") (CommandLine IN ("*SOFTWARE\\Microsoft\\Windows Defender\\*", "*SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center*", "*SOFTWARE\\Policies\\Microsoft\\Windows Defender\\*")) ((CommandLine="* add *" CommandLine="*d 0*" (CommandLine IN ("*DisallowExploitProtectionOverride*", "*EnableControlledFolderAccess*", "*MpEnablePus*", "*PUAProtection*", "*SpynetReporting*", "*SubmitSamplesConsent*", "*TamperProtection*"))) OR (CommandLine="* add *" CommandLine="*d 1*" (CommandLine IN ("*DisableAccess*", "*DisableAntiSpyware*", "*DisableAntiSpywareRealtimeProtection*", "*DisableAntiVirus*", "*DisableAntiVirusSignatures*", "*DisableArchiveScanning*", "*DisableBehaviorMonitoring*", "*DisableBlockAtFirstSeen*", "*DisableCloudProtection*", "*DisableConfig*", "*DisableEnhancedNotifications*", "*DisableIntrusionPreventionSystem*", "*DisableIOAVProtection*", "*DisableNetworkProtection*", "*DisableOnAccessProtection*", "*DisablePrivacyMode*", "*DisableRealtimeMonitoring*", "*DisableRoutinelyTakingAction*", "*DisableScanOnRealtimeEnable*", "*DisableScriptScanning*", "*DisableSecurityCenter*", "*Notification_Suppress*", "*SignatureDisableUpdateOnStartupWithoutEngine*"))))Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Suspicious Windows Defender Registry Key Tampering Via Reg.EXE]
description = Detects the usage of "reg.exe" to tamper with different Windows Defender registry keys in order to disable some important features related to protection and detection
search = (Image="*\\reg.exe" OR OriginalFileName="reg.exe") (CommandLine IN ("*SOFTWARE\\Microsoft\\Windows Defender\\*", "*SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center*", "*SOFTWARE\\Policies\\Microsoft\\Windows Defender\\*")) ((CommandLine="* add *" CommandLine="*d 0*" (CommandLine IN ("*DisallowExploitProtectionOverride*", "*EnableControlledFolderAccess*", "*MpEnablePus*", "*PUAProtection*", "*SpynetReporting*", "*SubmitSamplesConsent*", "*TamperProtection*"))) OR (CommandLine="* add *" CommandLine="*d 1*" (CommandLine IN ("*DisableAccess*", "*DisableAntiSpyware*", "*DisableAntiSpywareRealtimeProtection*", "*DisableAntiVirus*", "*DisableAntiVirusSignatures*", "*DisableArchiveScanning*", "*DisableBehaviorMonitoring*", "*DisableBlockAtFirstSeen*", "*DisableCloudProtection*", "*DisableConfig*", "*DisableEnhancedNotifications*", "*DisableIntrusionPreventionSystem*", "*DisableIOAVProtection*", "*DisableNetworkProtection*", "*DisableOnAccessProtection*", "*DisablePrivacyMode*", "*DisableRealtimeMonitoring*", "*DisableRoutinelyTakingAction*", "*DisableScanOnRealtimeEnable*", "*DisableScriptScanning*", "*DisableSecurityCenter*", "*Notification_Suppress*", "*SignatureDisableUpdateOnStartupWithoutEngine*"))))Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where ((TargetProcessName endswith "\\reg.exe" or TargetProcessFileOriginalName =~ "reg.exe") and (TargetProcessCommandLine contains "SOFTWARE\\Microsoft\\Windows Defender\\" or TargetProcessCommandLine contains "SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center" or TargetProcessCommandLine contains "SOFTWARE\\Policies\\Microsoft\\Windows Defender\\")) and (((TargetProcessCommandLine contains " add " and TargetProcessCommandLine contains "d 0") and (TargetProcessCommandLine contains "DisallowExploitProtectionOverride" or TargetProcessCommandLine contains "EnableControlledFolderAccess" or TargetProcessCommandLine contains "MpEnablePus" or TargetProcessCommandLine contains "PUAProtection" or TargetProcessCommandLine contains "SpynetReporting" or TargetProcessCommandLine contains "SubmitSamplesConsent" or TargetProcessCommandLine contains "TamperProtection")) or ((TargetProcessCommandLine contains " add " and TargetProcessCommandLine contains "d 1") and (TargetProcessCommandLine contains "DisableAccess" or TargetProcessCommandLine contains "DisableAntiSpyware" or TargetProcessCommandLine contains "DisableAntiSpywareRealtimeProtection" or TargetProcessCommandLine contains "DisableAntiVirus" or TargetProcessCommandLine contains "DisableAntiVirusSignatures" or TargetProcessCommandLine contains "DisableArchiveScanning" or TargetProcessCommandLine contains "DisableBehaviorMonitoring" or TargetProcessCommandLine contains "DisableBlockAtFirstSeen" or TargetProcessCommandLine contains "DisableCloudProtection" or TargetProcessCommandLine contains "DisableConfig" or TargetProcessCommandLine contains "DisableEnhancedNotifications" or TargetProcessCommandLine contains "DisableIntrusionPreventionSystem" or TargetProcessCommandLine contains "DisableIOAVProtection" or TargetProcessCommandLine contains "DisableNetworkProtection" or TargetProcessCommandLine contains "DisableOnAccessProtection" or TargetProcessCommandLine contains "DisablePrivacyMode" or TargetProcessCommandLine contains "DisableRealtimeMonitoring" or TargetProcessCommandLine contains "DisableRoutinelyTakingAction" or TargetProcessCommandLine contains "DisableScanOnRealtimeEnable" or TargetProcessCommandLine contains "DisableScriptScanning" or TargetProcessCommandLine contains "DisableSecurityCenter" or TargetProcessCommandLine contains "Notification_Suppress" or TargetProcessCommandLine contains "SignatureDisableUpdateOnStartupWithoutEngine")))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where ((FolderPath endswith "\\reg.exe" or ProcessVersionInfoOriginalFileName =~ "reg.exe") and (ProcessCommandLine contains "SOFTWARE\\Microsoft\\Windows Defender\\" or ProcessCommandLine contains "SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center" or ProcessCommandLine contains "SOFTWARE\\Policies\\Microsoft\\Windows Defender\\")) and (((ProcessCommandLine contains " add " and ProcessCommandLine contains "d 0") and (ProcessCommandLine contains "DisallowExploitProtectionOverride" or ProcessCommandLine contains "EnableControlledFolderAccess" or ProcessCommandLine contains "MpEnablePus" or ProcessCommandLine contains "PUAProtection" or ProcessCommandLine contains "SpynetReporting" or ProcessCommandLine contains "SubmitSamplesConsent" or ProcessCommandLine contains "TamperProtection")) or ((ProcessCommandLine contains " add " and ProcessCommandLine contains "d 1") and (ProcessCommandLine contains "DisableAccess" or ProcessCommandLine contains "DisableAntiSpyware" or ProcessCommandLine contains "DisableAntiSpywareRealtimeProtection" or ProcessCommandLine contains "DisableAntiVirus" or ProcessCommandLine contains "DisableAntiVirusSignatures" or ProcessCommandLine contains "DisableArchiveScanning" or ProcessCommandLine contains "DisableBehaviorMonitoring" or ProcessCommandLine contains "DisableBlockAtFirstSeen" or ProcessCommandLine contains "DisableCloudProtection" or ProcessCommandLine contains "DisableConfig" or ProcessCommandLine contains "DisableEnhancedNotifications" or ProcessCommandLine contains "DisableIntrusionPreventionSystem" or ProcessCommandLine contains "DisableIOAVProtection" or ProcessCommandLine contains "DisableNetworkProtection" or ProcessCommandLine contains "DisableOnAccessProtection" or ProcessCommandLine contains "DisablePrivacyMode" or ProcessCommandLine contains "DisableRealtimeMonitoring" or ProcessCommandLine contains "DisableRoutinelyTakingAction" or ProcessCommandLine contains "DisableScanOnRealtimeEnable" or ProcessCommandLine contains "DisableScriptScanning" or ProcessCommandLine contains "DisableSecurityCenter" or ProcessCommandLine contains "Notification_Suppress" or ProcessCommandLine contains "SignatureDisableUpdateOnStartupWithoutEngine")))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
((process.executable:*\\reg.exe OR process.pe.original_file_name:reg.exe) AND (process.command_line:(*SOFTWARE\\Microsoft\\Windows\ Defender\\* OR *SOFTWARE\\Policies\\Microsoft\\Windows\ Defender\ Security\ Center* OR *SOFTWARE\\Policies\\Microsoft\\Windows\ Defender\\*))) AND (((process.command_line:*\ add\ * AND process.command_line:*d\ 0*) AND (process.command_line:(*DisallowExploitProtectionOverride* OR *EnableControlledFolderAccess* OR *MpEnablePus* OR *PUAProtection* OR *SpynetReporting* OR *SubmitSamplesConsent* OR *TamperProtection*))) OR ((process.command_line:*\ add\ * AND process.command_line:*d\ 1*) AND (process.command_line:(*DisableAccess* OR *DisableAntiSpyware* OR *DisableAntiSpywareRealtimeProtection* OR *DisableAntiVirus* OR *DisableAntiVirusSignatures* OR *DisableArchiveScanning* OR *DisableBehaviorMonitoring* OR *DisableBlockAtFirstSeen* OR *DisableCloudProtection* OR *DisableConfig* OR *DisableEnhancedNotifications* OR *DisableIntrusionPreventionSystem* OR *DisableIOAVProtection* OR *DisableNetworkProtection* OR *DisableOnAccessProtection* OR *DisablePrivacyMode* OR *DisableRealtimeMonitoring* OR *DisableRoutinelyTakingAction* OR *DisableScanOnRealtimeEnable* OR *DisableScriptScanning* OR *DisableSecurityCenter* OR *Notification_Suppress* OR *SignatureDisableUpdateOnStartupWithoutEngine*))))Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where ((process.executable:"*\\reg.exe" or process.pe.original_file_name:"reg.exe") and (process.command_line like~ ("*SOFTWARE\\Microsoft\\Windows Defender\\*", "*SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center*", "*SOFTWARE\\Policies\\Microsoft\\Windows Defender\\*"))) and (((process.command_line:"* add *" and process.command_line:"*d 0*") and (process.command_line like~ ("*DisallowExploitProtectionOverride*", "*EnableControlledFolderAccess*", "*MpEnablePus*", "*PUAProtection*", "*SpynetReporting*", "*SubmitSamplesConsent*", "*TamperProtection*"))) or ((process.command_line:"* add *" and process.command_line:"*d 1*") and (process.command_line like~ ("*DisableAccess*", "*DisableAntiSpyware*", "*DisableAntiSpywareRealtimeProtection*", "*DisableAntiVirus*", "*DisableAntiVirusSignatures*", "*DisableArchiveScanning*", "*DisableBehaviorMonitoring*", "*DisableBlockAtFirstSeen*", "*DisableCloudProtection*", "*DisableConfig*", "*DisableEnhancedNotifications*", "*DisableIntrusionPreventionSystem*", "*DisableIOAVProtection*", "*DisableNetworkProtection*", "*DisableOnAccessProtection*", "*DisablePrivacyMode*", "*DisableRealtimeMonitoring*", "*DisableRoutinelyTakingAction*", "*DisableScanOnRealtimeEnable*", "*DisableScriptScanning*", "*DisableSecurityCenter*", "*Notification_Suppress*", "*SignatureDisableUpdateOnStartupWithoutEngine*"))))Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where (ends_with(process.executable, "\\reg.exe") or process.pe.original_file_name=="reg.exe") and (process.command_line like "*SOFTWARE\\\\Microsoft\\\\Windows Defender\\\\*" or process.command_line like "*SOFTWARE\\\\Policies\\\\Microsoft\\\\Windows Defender Security Center*" or process.command_line like "*SOFTWARE\\\\Policies\\\\Microsoft\\\\Windows Defender\\\\*") and (process.command_line like "* add *" and process.command_line like "*d 0*" and (process.command_line like "*DisallowExploitProtectionOverride*" or process.command_line like "*EnableControlledFolderAccess*" or process.command_line like "*MpEnablePus*" or process.command_line like "*PUAProtection*" or process.command_line like "*SpynetReporting*" or process.command_line like "*SubmitSamplesConsent*" or process.command_line like "*TamperProtection*") or process.command_line like "* add *" and process.command_line like "*d 1*" and (process.command_line like "*DisableAccess*" or process.command_line like "*DisableAntiSpyware*" or process.command_line like "*DisableAntiSpywareRealtimeProtection*" or process.command_line like "*DisableAntiVirus*" or process.command_line like "*DisableAntiVirusSignatures*" or process.command_line like "*DisableArchiveScanning*" or process.command_line like "*DisableBehaviorMonitoring*" or process.command_line like "*DisableBlockAtFirstSeen*" or process.command_line like "*DisableCloudProtection*" or process.command_line like "*DisableConfig*" or process.command_line like "*DisableEnhancedNotifications*" or process.command_line like "*DisableIntrusionPreventionSystem*" or process.command_line like "*DisableIOAVProtection*" or process.command_line like "*DisableNetworkProtection*" or process.command_line like "*DisableOnAccessProtection*" or process.command_line like "*DisablePrivacyMode*" or process.command_line like "*DisableRealtimeMonitoring*" or process.command_line like "*DisableRoutinelyTakingAction*" or process.command_line like "*DisableScanOnRealtimeEnable*" or process.command_line like "*DisableScriptScanning*" or process.command_line like "*DisableSecurityCenter*" or process.command_line like "*Notification_Suppress*" or process.command_line like "*SignatureDisableUpdateOnStartupWithoutEngine*"))Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageOriginalFileName
False positives
- Rare legitimate use by administrators to test software (should always be investigated)
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
- https://thedfirreport.com/2022/03/21/apt35-automates-initial-access-using-proxyshell/
- https://web.archive.org/web/20240111104527/https://github.com/swagkarna/Defeat-Defender-V1.2.0/tree/ae4059c4276da6f6303b8f53cdff085ecae88a91
- https://www.elevenforum.com/t/video-guide-how-to-completely-disable-microsoft-defender-antivirus.14608/page-2
- https://tria.ge/241231-j9yatstqbm/behavioral1
Author and attribution
- Author
- Florian Roth (Nextron Systems), Swachchhanda Shrawan Poudel, Nasreddine Bencherchali (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_reg_windows_defender_tamper.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2