Remote Scheduled Task Creation
Identifies remote scheduled task creations on a target host. This could be indicative of adversary lateral movement.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/11/20"
3integration = ["endpoint", "windows"]
4maturity = "production"
5updated_date = "2025/03/20"
6
7[rule]
8author = ["Elastic"]
9description = "Identifies remote scheduled task creations on a target host. This could be indicative of adversary lateral movement."
10from = "now-9m"
11index = [
12 "logs-endpoint.events.registry-*",
13 "logs-endpoint.events.network-*",
14 "winlogbeat-*",
15 "logs-windows.sysmon_operational-*",
16]
17language = "eql"
18license = "Elastic License v2"
19name = "Remote Scheduled Task Creation"
20note = """## Triage and analysis
21
22### Investigating Remote Scheduled Task Creation
23
24[Scheduled tasks](https://docs.microsoft.com/en-us/windows/win32/taskschd/about-the-task-scheduler) are a great mechanism for persistence and program execution. These features can be used remotely for a variety of legitimate reasons, but at the same time used by malware and adversaries. When investigating scheduled tasks that were set up remotely, one of the first steps should be to determine the original intent behind the configuration and to verify if the activity is tied to benign behavior such as software installation or any kind of network administrator work. One objective for these alerts is to understand the configured action within the scheduled task. This is captured within the registry event data for this rule and can be base64 decoded to view the value.
25
26#### Possible investigation steps
27
28- Review the base64 encoded tasks actions registry value to investigate the task configured action.
29- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
30- Further examination should include review of host-based artifacts and network logs from around when the scheduled task was created, on both the source and target machines.
31
32### False positive analysis
33
34- There is a high possibility of benign activity tied to the creation of remote scheduled tasks as it is a general feature within Windows and used for legitimate purposes for a wide range of activity. Any kind of context should be found to further understand the source of the activity and determine the intent based on the scheduled task's contents.
35
36### Related rules
37
38- Service Command Lateral Movement - d61cbcf8-1bc1-4cff-85ba-e7b21c5beedc
39- Remotely Started Services via RPC - aa9a274d-6b53-424d-ac5e-cb8ca4251650
40
41### Response and remediation
42
43- Initiate the incident response process based on the outcome of the triage.
44- Isolate the involved host to prevent further post-compromise behavior.
45- Remove scheduled task and any other related artifacts.
46- Review privileged account management and user account management settings. Consider implementing group policy object (GPO) policies to further restrict activity, or configuring settings that only allow administrators to create remote scheduled tasks.
47"""
48references = ["https://www.elastic.co/security-labs/hunting-for-lateral-movement-using-event-query-language"]
49risk_score = 47
50rule_id = "954ee7c8-5437-49ae-b2d6-2960883898e9"
51severity = "medium"
52tags = [
53 "Domain: Endpoint",
54 "OS: Windows",
55 "Use Case: Threat Detection",
56 "Tactic: Lateral Movement",
57 "Resources: Investigation Guide",
58 "Data Source: Elastic Defend",
59 "Data Source: Sysmon",
60]
61type = "eql"
62
63query = '''
64/* Task Scheduler service incoming connection followed by TaskCache registry modification */
65
66sequence by host.id, process.entity_id with maxspan = 1m
67 [network where host.os.type == "windows" and process.name : "svchost.exe" and
68 network.direction : ("incoming", "ingress") and source.port >= 49152 and destination.port >= 49152 and
69 source.ip != "127.0.0.1" and source.ip != "::1"
70 ]
71 [registry where host.os.type == "windows" and event.type == "change" and registry.value : "Actions" and
72 registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
73'''
74
75
76[[rule.threat]]
77framework = "MITRE ATT&CK"
78[[rule.threat.technique]]
79id = "T1021"
80name = "Remote Services"
81reference = "https://attack.mitre.org/techniques/T1021/"
82
83
84[rule.threat.tactic]
85id = "TA0008"
86name = "Lateral Movement"
87reference = "https://attack.mitre.org/tactics/TA0008/"
88[[rule.threat]]
89framework = "MITRE ATT&CK"
90[[rule.threat.technique]]
91id = "T1053"
92name = "Scheduled Task/Job"
93reference = "https://attack.mitre.org/techniques/T1053/"
94[[rule.threat.technique.subtechnique]]
95id = "T1053.005"
96name = "Scheduled Task"
97reference = "https://attack.mitre.org/techniques/T1053/005/"
98
99
100
101[rule.threat.tactic]
102id = "TA0002"
103name = "Execution"
104reference = "https://attack.mitre.org/tactics/TA0002/"
Triage and analysis
Investigating Remote Scheduled Task Creation
Scheduled tasks are a great mechanism for persistence and program execution. These features can be used remotely for a variety of legitimate reasons, but at the same time used by malware and adversaries. When investigating scheduled tasks that were set up remotely, one of the first steps should be to determine the original intent behind the configuration and to verify if the activity is tied to benign behavior such as software installation or any kind of network administrator work. One objective for these alerts is to understand the configured action within the scheduled task. This is captured within the registry event data for this rule and can be base64 decoded to view the value.
Possible investigation steps
- Review the base64 encoded tasks actions registry value to investigate the task configured action.
- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Further examination should include review of host-based artifacts and network logs from around when the scheduled task was created, on both the source and target machines.
False positive analysis
- There is a high possibility of benign activity tied to the creation of remote scheduled tasks as it is a general feature within Windows and used for legitimate purposes for a wide range of activity. Any kind of context should be found to further understand the source of the activity and determine the intent based on the scheduled task's contents.
Related rules
- Service Command Lateral Movement - d61cbcf8-1bc1-4cff-85ba-e7b21c5beedc
- Remotely Started Services via RPC - aa9a274d-6b53-424d-ac5e-cb8ca4251650
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- Remove scheduled task and any other related artifacts.
- Review privileged account management and user account management settings. Consider implementing group policy object (GPO) policies to further restrict activity, or configuring settings that only allow administrators to create remote scheduled tasks.
References
Related rules
- Execution via TSClient Mountpoint
- Incoming DCOM Lateral Movement via MSHTA
- Incoming DCOM Lateral Movement with MMC
- Incoming DCOM Lateral Movement with ShellBrowserWindow or ShellWindows
- Incoming Execution via PowerShell Remoting