Creation or Modification of a new GPO Scheduled Task or Service
Detects the creation or modification of a new Group Policy based scheduled task or service. These methods are used for legitimate system administration, but can also be abused by an attacker with domain admin permissions to execute a malicious payload remotely on all or a subset of the domain joined machines.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/08/13"
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/03/06"
8
9[rule]
10author = ["Elastic"]
11description = """
12Detects the creation or modification of a new Group Policy based scheduled task or service. These methods are used for
13legitimate system administration, but can also be abused by an attacker with domain admin permissions to execute a
14malicious payload remotely on all or a subset of the domain joined machines.
15"""
16from = "now-9m"
17index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Creation or Modification of a new GPO Scheduled Task or Service"
21note = """## Setup
22
23If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
24"""
25risk_score = 21
26rule_id = "c0429aa8-9974-42da-bfb6-53a0a515a145"
27severity = "low"
28tags = ["Elastic", "Host", "Windows", "Threat Detection", "Persistence", "Elastic Endgame"]
29timestamp_override = "event.ingested"
30type = "eql"
31
32query = '''
33file where host.os.type == "windows" and event.type != "deletion" and
34 file.path : ("?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\ScheduledTasks\\ScheduledTasks.xml",
35 "?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\Services\\Services.xml") and
36 not process.name : "dfsrs.exe"
37'''
38
39
40[[rule.threat]]
41framework = "MITRE ATT&CK"
42[[rule.threat.technique]]
43id = "T1053"
44name = "Scheduled Task/Job"
45reference = "https://attack.mitre.org/techniques/T1053/"
46[[rule.threat.technique.subtechnique]]
47id = "T1053.005"
48name = "Scheduled Task"
49reference = "https://attack.mitre.org/techniques/T1053/005/"
50
51
52
53[rule.threat.tactic]
54id = "TA0003"
55name = "Persistence"
56reference = "https://attack.mitre.org/tactics/TA0003/"
Setup
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested
and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested
to @timestamp for this rule to work.