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"
 5updated_date = "2024/05/31"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Detects the creation or modification of a new Group Policy based scheduled task or service. These methods are used for
11legitimate system administration, but can also be abused by an attacker with domain admin permissions to execute a
12malicious payload remotely on all or a subset of the domain joined machines.
13"""
14from = "now-9m"
15index = ["winlogbeat-*", "logs-endpoint.events.file-*", "logs-windows.sysmon_operational-*", "endgame-*"]
16language = "eql"
17license = "Elastic License v2"
18name = "Creation or Modification of a new GPO Scheduled Task or Service"
19risk_score = 21
20rule_id = "c0429aa8-9974-42da-bfb6-53a0a515a145"
21setup = """## Setup
22
23If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
24events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
25Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
26`event.ingested` to @timestamp.
27For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
28"""
29severity = "low"
30tags = [
31    "Domain: Endpoint",
32    "OS: Windows",
33    "Use Case: Threat Detection",
34    "Tactic: Privilege Escalation",
35    "Tactic: Persistence",
36    "Data Source: Elastic Endgame",
37    "Data Source: Elastic Defend",
38    "Data Source: Sysmon",
39]
40timestamp_override = "event.ingested"
41type = "eql"
42
43query = '''
44file where host.os.type == "windows" and event.type != "deletion" and
45  file.path : ("?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\ScheduledTasks\\ScheduledTasks.xml",
46               "?:\\Windows\\SYSVOL\\domain\\Policies\\*\\MACHINE\\Preferences\\Services\\Services.xml") and
47  not process.name : "dfsrs.exe"
48'''
49
50
51[[rule.threat]]
52framework = "MITRE ATT&CK"
53[[rule.threat.technique]]
54id = "T1484"
55name = "Domain or Tenant Policy Modification"
56reference = "https://attack.mitre.org/techniques/T1484/"
57[[rule.threat.technique.subtechnique]]
58id = "T1484.001"
59name = "Group Policy Modification"
60reference = "https://attack.mitre.org/techniques/T1484/001/"
61
62
63
64[rule.threat.tactic]
65id = "TA0004"
66name = "Privilege Escalation"
67reference = "https://attack.mitre.org/tactics/TA0004/"
68[[rule.threat]]
69framework = "MITRE ATT&CK"
70[[rule.threat.technique]]
71id = "T1053"
72name = "Scheduled Task/Job"
73reference = "https://attack.mitre.org/techniques/T1053/"
74[[rule.threat.technique.subtechnique]]
75id = "T1053.005"
76name = "Scheduled Task"
77reference = "https://attack.mitre.org/techniques/T1053/005/"
78
79
80
81[rule.threat.tactic]
82id = "TA0003"
83name = "Persistence"
84reference = "https://attack.mitre.org/tactics/TA0003/"

Related rules

to-top