← Back to SOC feed Coverage →

Turning off System Restore

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficialransomware
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-25T23:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may disable System Restore to eliminate the ability to recover data encrypted by ransomware. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential ransomware activity and mitigate data loss risks.

KQL Query

DeviceProcessEvents
//Pivoting for rundll32  
| where InitiatingProcessFileName =~ 'rundll32.exe'   
//Looking for empty command line   
and InitiatingProcessCommandLine !contains " " and InitiatingProcessCommandLine != ""  
//Looking for schtasks.exe as the created process  
and FileName in~ ('schtasks.exe')  
//Disabling system restore   
and ProcessCommandLine has 'Change' and ProcessCommandLine has 'SystemRestore' 
and ProcessCommandLine has 'disable'

Analytic Rule Definition

id: 5de97d18-b12b-4acf-9c3e-c96a67e80312
name: Turning off System Restore
description: |
  This query identifies attempts to stop System Restore and prevent the system from creating restore points, which can be used to recover data encrypted by ransomware
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Ransomware
query: |
  DeviceProcessEvents
  //Pivoting for rundll32  
  | where InitiatingProcessFileName =~ 'rundll32.exe'   
  //Looking for empty command line   
  and InitiatingProcessCommandLine !contains " " and InitiatingProcessCommandLine != ""  
  //Looking for schtasks.exe as the created process  
  and FileName in~ ('schtasks.exe')  
  //Disabling system restore   
  and ProcessCommandLine has 'Change' and ProcessCommandLine has 'SystemRestore' 
  and ProcessCommandLine has 'disable'

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Ransomware/Turning off System Restore.yaml