Detection rules › Elastic
Suspicious Scheduled Task Registry Modification
Identifies the modification of a scheduled task registry key by an unusual process. This behavior is consistent with an adversary attempting to persist or execute via scheduled tasks while avoiding generating event logs.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence |
Rule body
[rule]
description = """
Identifies the modification of a scheduled task registry key by an unusual process. This behavior is consistent with an
adversary attempting to persist or execute via scheduled tasks while avoiding generating event logs.
"""
id = "817af31e-a360-44eb-9019-e694395627d1"
license = "Elastic License v2"
name = "Suspicious Scheduled Task Registry Modification"
os_list = ["windows"]
reference = ["https://github.com/netero1010/GhostTask/"]
version = "1.0.7"
query = '''
registry where event.action == "modification" and registry.data.strings != "null" and process.executable != null and
process.thread.Ext.call_stack_summary : "?*" and
registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*Actions*" and
not (process.executable : ("?:\\Windows\\system32\\svchost.exe", "\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe") and
process.thread.Ext.call_stack_summary : ("*schedsvc.dll*", "*Unknown*")) and
not process.executable : "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiWorker.exe"
'''
min_endpoint_version = "8.7.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.7.0"
Stages and Predicates
Stage 1: registry
registry where event.action == "modification" and registry.data.strings != "null" and process.executable != null and
process.thread.Ext.call_stack_summary : "?*" and
registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*Actions*" and
not (process.executable : ("?:\\Windows\\system32\\svchost.exe", "\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe") and
process.thread.Ext.call_stack_summary : ("*schedsvc.dll*", "*Unknown*")) and
not process.executable : "C:\\Windows\\WinSxS\\amd64_microsoft-windows-servicingstack_*\\TiWorker.exe"
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.executable | wildcard | ?:\Windows\system32\svchost.exe, \Device\HarddiskVolume*\Windows\System32\svchost.exe | excludes:process.executable field:"process.executable" value:"?:\Windows\system32\svchost.exe" field:"process.executable" value:"\Device\HarddiskVolume*\Windows\System32\svchost.exe" |
process.thread.Ext.call_stack_summary | match | schedsvc.dll, Unknown | excludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"schedsvc.dll" field:"process.thread.Ext.call_stack_summary" value:"Unknown" |
process.executable | wildcard | C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_*\TiWorker.exe | excludes:process.executable field:"process.executable" value:"C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_*\TiWorker.exe" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"modification" |
process.executable | is_not_null | field:"Image" kind:is_not_null | |
process.thread.Ext.call_stack_summary | wildcard |
| field:"process.thread.Ext.call_stack_summary" kind:wildcard value:"?*" |
registry.data.strings | ne |
| field:"Details" kind:ne value:"null" |
registry.path | wildcard |
| field:"TargetObject" kind:wildcard value:"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks\*Actions*" |