IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Scheduled Task Created by a Windows Script
editScheduled Task Created by a Windows Script
editA scheduled task was created by a Windows script via cscript.exe, wscript.exe or powershell.exe. This can be abused by an adversary to establish persistence.
Rule type: eql
Rule indices:
- winlogbeat-*
- logs-endpoint.events.*
- logs-windows.*
Severity: medium
Risk score: 47
Runs every: 5 minutes
Searches indices from: now-9m (Date Math format, see also Additional look-back time
)
Maximum alerts per execution: 100
Tags:
- Elastic
- Host
- Windows
- Threat Detection
- Persistence
Version: 7 (version history)
Added (Elastic Stack release): 7.11.0
Last modified (Elastic Stack release): 8.4.0
Rule authors: Elastic
Rule license: Elastic License v2
Potential false positives
editLegitimate scheduled tasks may be created during installation of new software.
Investigation guide
edit## Triage and analysis Decode the base64 encoded Tasks Actions registry value to investigate the task's configured action.
Rule query
editsequence by host.id with maxspan = 30s [any where (event.category == "library" or (event.category == "process" and event.action : "Image loaded*")) and (dll.name : "taskschd.dll" or file.name : "taskschd.dll") and process.name : ("cscript.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe")] [registry where registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
Threat mapping
editFramework: MITRE ATT&CKTM
-
Tactic:
- Name: Persistence
- ID: TA0003
- Reference URL: https://attack.mitre.org/tactics/TA0003/
-
Technique:
- Name: Scheduled Task/Job
- ID: T1053
- Reference URL: https://attack.mitre.org/techniques/T1053/
Rule version history
edit- Version 7 (8.4.0 release)
-
-
Updated query, changed from:
sequence by host.id with maxspan = 30s [library where dll.name : "taskschd.dll" and process.name : ("cscript.exe", "wscript.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe")] [registry where registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
-
- Version 5 (7.16.0 release)
-
-
Updated query, changed from:
sequence by host.id with maxspan = 30s [library where dll.name : "taskschd.dll" and process.name : ("cscript.exe", "wscript.exe", "powershell.exe")] [registry where registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
-
- Version 3 (7.13.0 release)
-
- Formatting only
- Version 2 (7.12.0 release)
-
-
Updated query, changed from:
sequence by host.id with maxspan = 30s [library where file.name : "taskschd.dll" and process.name : ("cscript.exe", "wscript.exe", "powershell.exe")] [registry where registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
-