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 = "2024/10/15"
6min_stack_version = "8.14.0"
7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
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 = [
14 "logs-endpoint.events.registry-*",
15 "logs-endpoint.events.network-*",
16 "winlogbeat-*",
17 "logs-windows.sysmon_operational-*",
18]
19language = "eql"
20license = "Elastic License v2"
21name = "Remote Scheduled Task Creation"
22note = """## Triage and analysis
23
24### Investigating Remote Scheduled Task Creation
25
26[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.
27
28#### Possible investigation steps
29
30- Review the base64 encoded tasks actions registry value to investigate the task configured action.
31- Validate if the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
32- 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.
33
34### False positive analysis
35
36- 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.
37
38### Related rules
39
40- Service Command Lateral Movement - d61cbcf8-1bc1-4cff-85ba-e7b21c5beedc
41- Remotely Started Services via RPC - aa9a274d-6b53-424d-ac5e-cb8ca4251650
42
43### Response and remediation
44
45- Initiate the incident response process based on the outcome of the triage.
46- Isolate the involved host to prevent further post-compromise behavior.
47- Remove scheduled task and any other related artifacts.
48- 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.
49"""
50references = ["https://www.elastic.co/security-labs/hunting-for-lateral-movement-using-event-query-language"]
51risk_score = 47
52rule_id = "954ee7c8-5437-49ae-b2d6-2960883898e9"
53severity = "medium"
54tags = [
55 "Domain: Endpoint",
56 "OS: Windows",
57 "Use Case: Threat Detection",
58 "Tactic: Lateral Movement",
59 "Resources: Investigation Guide",
60 "Data Source: Elastic Defend",
61 "Data Source: Sysmon",
62]
63type = "eql"
64
65query = '''
66/* Task Scheduler service incoming connection followed by TaskCache registry modification */
67
68sequence by host.id, process.entity_id with maxspan = 1m
69 [network where host.os.type == "windows" and process.name : "svchost.exe" and
70 network.direction : ("incoming", "ingress") and source.port >= 49152 and destination.port >= 49152 and
71 source.ip != "127.0.0.1" and source.ip != "::1"
72 ]
73 [registry where host.os.type == "windows" and event.type == "change" and registry.value : "Actions" and
74 registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tasks\\*\\Actions"]
75'''
76
77
78[[rule.threat]]
79framework = "MITRE ATT&CK"
80[[rule.threat.technique]]
81id = "T1021"
82name = "Remote Services"
83reference = "https://attack.mitre.org/techniques/T1021/"
84
85
86[rule.threat.tactic]
87id = "TA0008"
88name = "Lateral Movement"
89reference = "https://attack.mitre.org/tactics/TA0008/"
90[[rule.threat]]
91framework = "MITRE ATT&CK"
92[[rule.threat.technique]]
93id = "T1053"
94name = "Scheduled Task/Job"
95reference = "https://attack.mitre.org/techniques/T1053/"
96[[rule.threat.technique.subtechnique]]
97id = "T1053.005"
98name = "Scheduled Task"
99reference = "https://attack.mitre.org/techniques/T1053/005/"
100
101
102
103[rule.threat.tactic]
104id = "TA0002"
105name = "Execution"
106reference = "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
- PsExec Network Connection
- RDP Enabled via Registry
- Remotely Started Services via RPC
- Account Discovery Command via SYSTEM Account
- Adobe Hijack Persistence