Detection rule
Delete Important Scheduled Task
Overview
Detects when adversaries stop services or processes by deleting their respective scheduled tasks in order to conduct data destructive activities
- Rule id
dbc1f800-0fe0-4bc0-9c66-292c2abe3f78- ATT&CK techniques
- T1489 Service Stop
- Severity
- High
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, Akira, safepay, Play, everest, 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) · dbc1f800-0fe0-4bc0-9c66-292c2abe3f78
title: Delete Important Scheduled Task
id: dbc1f800-0fe0-4bc0-9c66-292c2abe3f78
related:
- id: 9e3cb244-bdb8-4632-8c90-6079c8f4f16d # TaskScheduler EventLog
type: similar
- id: 7595ba94-cf3b-4471-aa03-4f6baa9e5fad # Security-Audting Eventlog
type: similar
status: test
description: Detects when adversaries stop services or processes by deleting their respective scheduled tasks in order to conduct data destructive activities
references:
- Internal Research
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-09-09
modified: 2026-03-11
tags:
- attack.impact
- attack.t1489
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: '\schtasks.exe'
- OriginalFileName: 'schtasks.exe'
selection_cli_delete:
CommandLine|contains|windash: '/delete'
selection_cli_task:
CommandLine|contains:
# Add more important tasks
- '\Windows\BitLocker'
- '\Windows\ExploitGuard'
- '\Windows\SystemRestore\SR'
- '\Windows\UpdateOrchestrator\'
- '\Windows\Windows Defender\'
- '\Windows\WindowsBackup\'
- '\Windows\WindowsUpdate\'
condition: all of selection_*
falsepositives:
- Unlikely
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_schtasks_delete/info.ymlQRadar 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 '%\schtasks.exe' OR LOWER("Process Name") LIKE '%\schtasks.exe') OR Filename='schtasks.exe') AND (LOWER(Command) LIKE '%-delete%' OR LOWER(Command) LIKE '%/delete%' OR LOWER(Command) LIKE '%–delete%' OR LOWER(Command) LIKE '%—delete%' OR LOWER(Command) LIKE '%―delete%') AND (LOWER(Command) LIKE '%\windows\bitlocker%' OR LOWER(Command) LIKE '%\windows\exploitguard%' OR LOWER(Command) LIKE '%\windows\systemrestore\sr%' OR LOWER(Command) LIKE '%\windows\updateorchestrator\%' OR LOWER(Command) LIKE '%\windows\windows defender\%' OR LOWER(Command) LIKE '%\windows\windowsbackup\%' OR LOWER(Command) LIKE '%\windows\windowsupdate\%')QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Delete Important Scheduled Task- 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:Delete Important Scheduled Task:selection_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:\schtasks.exeFilenameis equal to (case-insensitive):schtasks.exe
BB:OffSet7:Delete Important Scheduled Task:selection_cli_delete(match)All test lines must match (AND).Commandcontains:/delete
BB:OffSet7:Delete Important Scheduled Task:selection_cli_task(match)All test lines must match (AND).Commandcontains:\Windows\BitLocker,\Windows\ExploitGuard,\Windows\SystemRestore\SR,\Windows\UpdateOrchestrator\,\Windows\Windows Defender\,\Windows\WindowsBackup\,\Windows\WindowsUpdate\
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:Delete Important Scheduled Task:selection_img, BB:OffSet7:Delete Important Scheduled Task:selection_cli_delete, BB:OffSet7:Delete Important Scheduled Task:selection_cli_task])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND ((LOWER("Process Path") LIKE '%\schtasks.exe' OR LOWER("Process Name") LIKE '%\schtasks.exe') OR Filename='schtasks.exe') AND (LOWER(Command) LIKE '%-delete%' OR LOWER(Command) LIKE '%/delete%' OR LOWER(Command) LIKE '%–delete%' OR LOWER(Command) LIKE '%—delete%' OR LOWER(Command) LIKE '%―delete%') AND (LOWER(Command) LIKE '%\windows\bitlocker%' OR LOWER(Command) LIKE '%\windows\exploitguard%' OR LOWER(Command) LIKE '%\windows\systemrestore\sr%' OR LOWER(Command) LIKE '%\windows\updateorchestrator\%' OR LOWER(Command) LIKE '%\windows\windows defender\%' OR LOWER(Command) LIKE '%\windows\windowsbackup\%' OR LOWER(Command) LIKE '%\windows\windowsupdate\%')
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="*\\schtasks.exe" OR OriginalFileName="schtasks.exe") (CommandLine="*-delete*" OR CommandLine="*/delete*" OR CommandLine="*–delete*" OR CommandLine="*—delete*" OR CommandLine="*―delete*") (CommandLine IN ("*\\Windows\\BitLocker*", "*\\Windows\\ExploitGuard*", "*\\Windows\\SystemRestore\\SR*", "*\\Windows\\UpdateOrchestrator\\*", "*\\Windows\\Windows Defender\\*", "*\\Windows\\WindowsBackup\\*", "*\\Windows\\WindowsUpdate\\*"))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
[Delete Important Scheduled Task]
description = Detects when adversaries stop services or processes by deleting their respective scheduled tasks in order to conduct data destructive activities
search = (Image="*\\schtasks.exe" OR OriginalFileName="schtasks.exe") (CommandLine="*-delete*" OR CommandLine="*/delete*" OR CommandLine="*–delete*" OR CommandLine="*—delete*" OR CommandLine="*―delete*") (CommandLine IN ("*\\Windows\\BitLocker*", "*\\Windows\\ExploitGuard*", "*\\Windows\\SystemRestore\\SR*", "*\\Windows\\UpdateOrchestrator\\*", "*\\Windows\\Windows Defender\\*", "*\\Windows\\WindowsBackup\\*", "*\\Windows\\WindowsUpdate\\*"))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 "\\schtasks.exe" or TargetProcessFileOriginalName =~ "schtasks.exe") and (TargetProcessCommandLine contains "-delete" or TargetProcessCommandLine contains "/delete" or TargetProcessCommandLine contains "–delete" or TargetProcessCommandLine contains "—delete" or TargetProcessCommandLine contains "―delete") and (TargetProcessCommandLine contains "\\Windows\\BitLocker" or TargetProcessCommandLine contains "\\Windows\\ExploitGuard" or TargetProcessCommandLine contains "\\Windows\\SystemRestore\\SR" or TargetProcessCommandLine contains "\\Windows\\UpdateOrchestrator\\" or TargetProcessCommandLine contains "\\Windows\\Windows Defender\\" or TargetProcessCommandLine contains "\\Windows\\WindowsBackup\\" or TargetProcessCommandLine contains "\\Windows\\WindowsUpdate\\")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 "\\schtasks.exe" or ProcessVersionInfoOriginalFileName =~ "schtasks.exe") and (ProcessCommandLine contains "-delete" or ProcessCommandLine contains "/delete" or ProcessCommandLine contains "–delete" or ProcessCommandLine contains "—delete" or ProcessCommandLine contains "―delete") and (ProcessCommandLine contains "\\Windows\\BitLocker" or ProcessCommandLine contains "\\Windows\\ExploitGuard" or ProcessCommandLine contains "\\Windows\\SystemRestore\\SR" or ProcessCommandLine contains "\\Windows\\UpdateOrchestrator\\" or ProcessCommandLine contains "\\Windows\\Windows Defender\\" or ProcessCommandLine contains "\\Windows\\WindowsBackup\\" or ProcessCommandLine contains "\\Windows\\WindowsUpdate\\")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:*\\schtasks.exe OR process.pe.original_file_name:schtasks.exe) AND process.command_line:(*\-delete* OR *\/delete* OR *–delete* OR *—delete* OR *―delete*) AND (process.command_line:(*\\Windows\\BitLocker* OR *\\Windows\\ExploitGuard* OR *\\Windows\\SystemRestore\\SR* OR *\\Windows\\UpdateOrchestrator\\* OR *\\Windows\\Windows\ Defender\\* OR *\\Windows\\WindowsBackup\\* OR *\\Windows\\WindowsUpdate\\*))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:"*\\schtasks.exe" or process.pe.original_file_name:"schtasks.exe") and process.command_line like~ ("*-delete*", "*/delete*", "*–delete*", "*—delete*", "*―delete*") and (process.command_line like~ ("*\\Windows\\BitLocker*", "*\\Windows\\ExploitGuard*", "*\\Windows\\SystemRestore\\SR*", "*\\Windows\\UpdateOrchestrator\\*", "*\\Windows\\Windows Defender\\*", "*\\Windows\\WindowsBackup\\*", "*\\Windows\\WindowsUpdate\\*"))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, "\\schtasks.exe") or process.pe.original_file_name=="schtasks.exe") and (process.command_line like "*-delete*" or process.command_line like "*/delete*" or process.command_line like "*–delete*" or process.command_line like "*—delete*" or process.command_line like "*―delete*") and (process.command_line like "*\\\\Windows\\\\BitLocker*" or process.command_line like "*\\\\Windows\\\\ExploitGuard*" or process.command_line like "*\\\\Windows\\\\SystemRestore\\\\SR*" or process.command_line like "*\\\\Windows\\\\UpdateOrchestrator\\\\*" or process.command_line like "*\\\\Windows\\\\Windows Defender\\\\*" or process.command_line like "*\\\\Windows\\\\WindowsBackup\\\\*" or process.command_line like "*\\\\Windows\\\\WindowsUpdate\\\\*")Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageOriginalFileName
False positives
- Unlikely
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.
Author and attribution
- Author
- Nasreddine Bencherchali (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_schtasks_delete.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2