Persistence via Scheduled Job Creation

A job can be used to schedule programs or scripts to be executed at a specified date and time. Adversaries may abuse task scheduling functionality to facilitate initial or recurring execution of malicious code.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2021/03/15"
 3integration = ["endpoint", "windows"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/01/04"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12A job can be used to schedule programs or scripts to be executed at a specified date and time. Adversaries may abuse
13task scheduling functionality to facilitate initial or recurring execution of malicious code.
14"""
15false_positives = ["Legitimate scheduled jobs may be created during installation of new software."]
16from = "now-9m"
17index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Persistence via Scheduled Job Creation"
21risk_score = 47
22rule_id = "1327384f-00f3-44d5-9a8c-2373ba071e92"
23setup = """
24
25If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
26events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
27Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
28`event.ingested` to @timestamp.
29For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
30"""
31severity = "medium"
32tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
33timestamp_override = "event.ingested"
34type = "eql"
35
36query = '''
37file where host.os.type == "windows" and event.type != "deletion" and
38  file.path : "?:\\Windows\\Tasks\\*" and file.extension : "job" and
39  not (
40    (
41      process.executable : "?:\\Program Files\\CCleaner\\CCleaner64.exe" and
42      file.path : "?:\\Windows\\Tasks\\CCleanerCrashReporting.job"
43    ) or
44    (
45      process.executable : (
46        "?:\\Program Files (x86)\\ManageEngine\\UEMS_Agent\\bin\\dcagentregister.exe",
47        "?:\\Program Files (x86)\\DesktopCentral_Agent\\bin\\dcagentregister.exe"
48      ) and
49      file.path : "?:\\Windows\\Tasks\\DCAgentUpdater.job"
50    )
51  )
52'''
53
54
55[[rule.threat]]
56framework = "MITRE ATT&CK"
57[[rule.threat.technique]]
58id = "T1053"
59name = "Scheduled Task/Job"
60reference = "https://attack.mitre.org/techniques/T1053/"
61[[rule.threat.technique.subtechnique]]
62id = "T1053.005"
63name = "Scheduled Task"
64reference = "https://attack.mitre.org/techniques/T1053/005/"
65
66
67
68[rule.threat.tactic]
69id = "TA0003"
70name = "Persistence"
71reference = "https://attack.mitre.org/tactics/TA0003/"

Related rules

to-top