LaunchDaemon Creation or Modification and Immediate Loading

Indicates the creation or modification of a launch daemon, which adversaries may use to repeatedly execute malicious payloads as part of persistence.

Elastic rule (View on GitHub)

 2creation_date = "2020/12/07"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/11/15"
10author = ["Elastic"]
11description = """
12Indicates the creation or modification of a launch daemon, which adversaries may use to repeatedly execute malicious
13payloads as part of persistence.
15false_positives = ["Trusted applications persisting via LaunchDaemons"]
16from = "now-9m"
17index = ["*"]
18language = "eql"
19license = "Elastic License v2"
20name = "LaunchDaemon Creation or Modification and Immediate Loading"
21references = [
22    "",
24risk_score = 21
25rule_id = "9d19ece6-c20e-481a-90c5-ccca596537de"
26setup = """## Setup
28This rule requires data coming in from Elastic Defend.
30### Elastic Defend Integration Setup
31Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
33#### Prerequisite Requirements:
34- Fleet is required for Elastic Defend.
35- To configure Fleet Server refer to the [documentation](
37#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
38- Go to the Kibana home page and click "Add integrations".
39- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
40- Click "Add Elastic Defend".
41- Configure the integration name and optionally add a description.
42- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
43- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](
44- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
45- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
46For more details on Elastic Agent configuration settings, refer to the [helper guide](
47- Click "Save and Continue".
48- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
49For more details on Elastic Defend refer to the [helper guide](
51severity = "low"
52tags = ["Domain: Endpoint", "OS: macOS", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Defend"]
53type = "eql"
55query = '''
56sequence by with maxspan=1m
57 [file where host.os.type == "macos" and event.type != "deletion" and file.path : ("/System/Library/LaunchDaemons/*", "/Library/LaunchDaemons/*")]
58 [process where host.os.type == "macos" and event.type in ("start", "process_started") and == "launchctl" and process.args == "load"]
63framework = "MITRE ATT&CK"
65id = "T1543"
66name = "Create or Modify System Process"
67reference = ""
71id = "TA0003"
72name = "Persistence"
73reference = ""


Related rules