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"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/06/22"
 8
 9[rule]
10author = ["Elastic"]
11description = "Identifies remote scheduled task creations on a target host. This could be indicative of adversary lateral movement."
12from = "now-9m"
13index = ["logs-endpoint.events.*", "winlogbeat-*", "logs-windows.*"]
14language = "eql"
15license = "Elastic License v2"
16name = "Remote Scheduled Task Creation"
17note = """## Triage and analysis
18
19### Investigating Remote Scheduled Task Creation
20
21[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.
22
23#### Possible investigation steps
24
25- Review the base64 encoded tasks actions registry value to investigate the task configured action.
26- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
27- 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.
28
29### False positive analysis
30
31- 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.
32
33### Related rules
34
35- Service Command Lateral Movement - d61cbcf8-1bc1-4cff-85ba-e7b21c5beedc
36- Remotely Started Services via RPC - aa9a274d-6b53-424d-ac5e-cb8ca4251650
37
38### Response and remediation
39
40- Initiate the incident response process based on the outcome of the triage.
41- Isolate the involved host to prevent further post-compromise behavior.
42- Remove scheduled task and any other related artifacts.
43- 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.
44"""
45risk_score = 47
46rule_id = "954ee7c8-5437-49ae-b2d6-2960883898e9"
47severity = "medium"
48tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Lateral Movement", "Resources: Investigation Guide", "Data Source: Elastic Defend"]
49type = "eql"
50
51query = '''
52/* Task Scheduler service incoming connection followed by TaskCache registry modification  */
53
54sequence by host.id, process.entity_id with maxspan = 1m
55   [network where host.os.type == "windows" and process.name : "svchost.exe" and
56   network.direction : ("incoming", "ingress") and source.port >= 49152 and destination.port >= 49152 and
57   source.ip != "127.0.0.1" and source.ip != "::1"
58   ]
59   [registry where host.os.type == "windows" and registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
60'''
61
62
63[[rule.threat]]
64framework = "MITRE ATT&CK"
65[[rule.threat.technique]]
66id = "T1021"
67name = "Remote Services"
68reference = "https://attack.mitre.org/techniques/T1021/"
69
70
71[rule.threat.tactic]
72id = "TA0008"
73name = "Lateral Movement"
74reference = "https://attack.mitre.org/tactics/TA0008/"
75[[rule.threat]]
76framework = "MITRE ATT&CK"
77[[rule.threat.technique]]
78id = "T1053"
79name = "Scheduled Task/Job"
80reference = "https://attack.mitre.org/techniques/T1053/"
81[[rule.threat.technique.subtechnique]]
82id = "T1053.005"
83name = "Scheduled Task"
84reference = "https://attack.mitre.org/techniques/T1053/005/"
85
86
87
88[rule.threat.tactic]
89id = "TA0002"
90name = "Execution"
91reference = "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.
  • 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.

Related rules

to-top