Third-Party Security Software Unload or Tamper via Launchctl
Identifies attempts to unload, boot out or disable the launch daemons and agents of third-party endpoint detection and response (EDR) software, consumer antivirus and endpoint telemetry or device-control tools via launchctl, or to disable protection through a vendor command-line utility (mdatp, falconctl, sentinelctl). Adversaries disable these tools prior to deploying payloads or performing actions on objective in order to avoid detection and prevention.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/11/10"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2026/11/10"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies attempts to unload, boot out or disable the launch daemons and agents of third-party endpoint
11detection and response (EDR) software, consumer antivirus and endpoint telemetry or device-control tools
12via launchctl, or to disable protection through a vendor command-line utility (mdatp, falconctl, sentinelctl).
13Adversaries disable these tools prior to deploying payloads or performing actions on objective in order to
14avoid detection and prevention.
15"""
16from = "now-9m"
17index = ["logs-endpoint.events.process-*"]
18language = "eql"
19license = "Elastic License v2"
20name = "Third-Party Security Software Unload or Tamper via Launchctl"
21note = """## Triage and analysis
22
23> **Disclaimer**:
24> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
25
26### Investigating Third-Party Security Software Unload or Tamper via Launchctl
27
28On macOS, EDR sensors, consumer antivirus agents, and endpoint telemetry or device-control tools run as launch daemons registered under `/Library/LaunchDaemons`. An adversary with administrative rights can stop them with `launchctl unload` or `launchctl bootout`, or disable protection through the vendor CLI (for example `mdatp config real-time-protection --value disabled` or `falconctl unload`). This rule alerts when such a command targets a known vendor label and the responsible process is not a known MDM agent, uninstaller or package install script.
29
30### Possible investigation steps
31
32- Review `process.command_line` to identify which vendor label or utility was targeted and whether the command would have succeeded (unload requires root).
33- Inspect `process.parent.executable` and `process.Ext.effective_parent.executable` to determine whether the action came from an interactive terminal, a script, a remote session (SSH, RMM) or an application.
34- Check for a vendor uninstall or upgrade on the same host in the surrounding minutes (package install logs, `installer` or `pkgutil` activity, change tickets).
35- Look for preceding privilege escalation (`sudo`, `osascript ... with administrator privileges`) and for follow-on activity after the unload: new launch agents or daemons, downloads via `curl`, archive or credential access, outbound connections.
36- Confirm with the vendor console whether the sensor on this host went offline at the time of the alert.
37
38### False positive analysis
39
40- Vendor uninstallers, upgrade scripts and `package_script_service` legitimately unload their own daemons. If a specific uninstaller path is observed, add it to the parent or effective-parent exclusions rather than excluding the vendor label.
41- A code-signed, trusted application under `/Applications` or `/Library/PrivilegedHelperTools` that invokes `launchctl` or a vendor utility directly is excluded. Unsigned or untrusted binaries in that folder still match. A shell or Terminal session is not excluded, because the parent in that case is the shell rather than the application.
42- MDM and RMM agents (Jamf, Kandji, Mosyle, Intune, JumpCloud, Addigy, NinjaOne) performing managed removals are excluded; add other management agents in use in your environment by their full executable path.
43- Administrators manually removing a decommissioned product from a terminal will trigger the rule. Treat these as true-positive-benign and close with a note rather than excluding Terminal, since an interactive shell is also the most common attacker path.
44
45### Response and remediation
46
47- Isolate the host if the unload was not part of a sanctioned change and the security sensor is confirmed offline.
48- Reload the affected daemon (`launchctl bootstrap system /Library/LaunchDaemons/<label>.plist`) or re-enable protection through the vendor console, and verify the sensor reports healthy.
49- Investigate how administrative privileges were obtained and whether other defenses (Gatekeeper, SIP, TCC, Elastic Agent) were tampered with on the same host.
50- Collect the process tree, shell history and any dropped files for the responsible process and search the environment for the same command line on other hosts.
51- Reset credentials for the user account involved if the activity originated from a compromised session.
52"""
53references = [
54 "https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1685/T1685.md",
55 "https://www.loobins.io/binaries/launchctl/",
56]
57risk_score = 73
58rule_id = "40a17220-c926-4776-b396-c66c12076480"
59setup = """## Setup
60
61This rule requires data coming in from Elastic Defend.
62
63### Elastic Defend Integration Setup
64Elastic 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.
65
66#### Prerequisite Requirements:
67- Fleet is required for Elastic Defend.
68- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
69
70#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
71- Go to the Kibana home page and click "Add integrations".
72- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
73- Click "Add Elastic Defend".
74- Configure the integration name and optionally add a description.
75- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
76- 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](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
77- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
78- 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.
79For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
80- Click "Save and Continue".
81- 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.
82For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
83"""
84severity = "high"
85tags = [
86 "Domain: Endpoint",
87 "OS: macOS",
88 "Use Case: Threat Detection",
89 "Tactic: Defense Evasion",
90 "Data Source: Elastic Defend",
91 "Resources: Investigation Guide",
92 "Rule Type: Event Correlation (EQL)",
93 "Platform: macOS",
94]
95timestamp_override = "event.ingested"
96type = "eql"
97
98query = '''
99process where host.os.type == "macos" and event.type == "start" and event.action == "exec" and
100 (
101 (
102 process.name == "launchctl" and
103 process.args in ("unload", "bootout", "remove", "disable") and
104 process.command_line like~ (
105 "*com.crowdstrike.*", "*com.carbonblack.*", "*com.vmware.carbonblack.*", "*com.microsoft.fresno*",
106 "*com.microsoft.wdav*", "*com.sentinelone.*", "*com.jamf.protect*", "*com.paloaltonetworks.cortex*",
107 "*com.trendmicro.*", "*com.sophos.*", "*com.eset.*", "*com.kaspersky.*", "*com.bitdefender.*",
108 "*com.malwarebytes.*", "*com.cylance.*", "*com.mcafee.*", "*com.trellix.*", "*com.symantec.*",
109 "*com.fortinet.fortiedr*", "*com.checkpoint.*", "*com.cybereason.*", "*com.huntress.*",
110 "*com.withsecure.*", "*com.f-secure.*", "*com.avast.*", "*com.avg.*", "*com.norton.*",
111 "*com.webroot.*", "*com.objective-see.*", "*com.facebook.osquery*", "*io.kolide.*",
112 "*com.fleetdm.*", "*com.absolute.*", "*at.obdev.*", "*com.opendns.*"
113 )
114 ) or
115 (process.name == "mdatp" and process.args == "config" and process.args == "real-time-protection" and process.args == "disabled") or
116 (process.name == "falconctl" and process.args in ("unload", "uninstall")) or
117 (process.name == "sentinelctl" and process.args in ("unload", "unprotect", "uninstall"))
118 ) and
119 not (
120 process.parent.executable like~ "/Library/PrivilegedHelperTools/*" and
121 process.parent.code_signature.trusted == true
122 ) and
123 not process.parent.executable like~ "/usr/local/jamf/bin/jamf" and
124 not process.Ext.effective_parent.executable like~ (
125 "/usr/local/jamf/bin/jamf",
126 "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfManagementService.app/Contents/MacOS/JamfManagementService",
127 "/Library/Application Support/JAMF/Jamf.app/Contents/MacOS/JamfDaemon.app/Contents/MacOS/JamfDaemon",
128 "/Library/Application Support/Mosyle/MosyleMDM.app/Contents/MacOS/MosyleMDM",
129 "/Library/Intune/Microsoft Intune Agent.app/Contents/MacOS/IntuneMdmDaemon",
130 "/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent"
131 )
132'''
133
134
135[[rule.threat]]
136framework = "MITRE ATT&CK"
137
138[[rule.threat.technique]]
139id = "T1562"
140name = "Impair Defenses"
141reference = "https://attack.mitre.org/techniques/T1562/"
142
143[[rule.threat.technique.subtechnique]]
144id = "T1562.001"
145name = "Disable or Modify Tools"
146reference = "https://attack.mitre.org/techniques/T1562/001/"
147
148[rule.threat.tactic]
149id = "TA0005"
150name = "Defense Evasion"
151reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Third-Party Security Software Unload or Tamper via Launchctl
On macOS, EDR sensors, consumer antivirus agents, and endpoint telemetry or device-control tools run as launch daemons registered under /Library/LaunchDaemons. An adversary with administrative rights can stop them with launchctl unload or launchctl bootout, or disable protection through the vendor CLI (for example mdatp config real-time-protection --value disabled or falconctl unload). This rule alerts when such a command targets a known vendor label and the responsible process is not a known MDM agent, uninstaller or package install script.
Possible investigation steps
- Review
process.command_lineto identify which vendor label or utility was targeted and whether the command would have succeeded (unload requires root). - Inspect
process.parent.executableandprocess.Ext.effective_parent.executableto determine whether the action came from an interactive terminal, a script, a remote session (SSH, RMM) or an application. - Check for a vendor uninstall or upgrade on the same host in the surrounding minutes (package install logs,
installerorpkgutilactivity, change tickets). - Look for preceding privilege escalation (
sudo,osascript ... with administrator privileges) and for follow-on activity after the unload: new launch agents or daemons, downloads viacurl, archive or credential access, outbound connections. - Confirm with the vendor console whether the sensor on this host went offline at the time of the alert.
False positive analysis
- Vendor uninstallers, upgrade scripts and
package_script_servicelegitimately unload their own daemons. If a specific uninstaller path is observed, add it to the parent or effective-parent exclusions rather than excluding the vendor label. - A code-signed, trusted application under
/Applicationsor/Library/PrivilegedHelperToolsthat invokeslaunchctlor a vendor utility directly is excluded. Unsigned or untrusted binaries in that folder still match. A shell or Terminal session is not excluded, because the parent in that case is the shell rather than the application. - MDM and RMM agents (Jamf, Kandji, Mosyle, Intune, JumpCloud, Addigy, NinjaOne) performing managed removals are excluded; add other management agents in use in your environment by their full executable path.
- Administrators manually removing a decommissioned product from a terminal will trigger the rule. Treat these as true-positive-benign and close with a note rather than excluding Terminal, since an interactive shell is also the most common attacker path.
Response and remediation
- Isolate the host if the unload was not part of a sanctioned change and the security sensor is confirmed offline.
- Reload the affected daemon (
launchctl bootstrap system /Library/LaunchDaemons/<label>.plist) or re-enable protection through the vendor console, and verify the sensor reports healthy. - Investigate how administrative privileges were obtained and whether other defenses (Gatekeeper, SIP, TCC, Elastic Agent) were tampered with on the same host.
- Collect the process tree, shell history and any dropped files for the responsible process and search the environment for the same command line on other hosts.
- Reset credentials for the user account involved if the activity originated from a compromised session.
References
Related rules
- macOS Guest Account or Guest Access Enabled
- Persistence via Suspicious Launch Agent or Launch Daemon
- Quarantine Attrib Removed by Unsigned or Untrusted Process
- Potential Impersonation Attempt via Kubectl
- Potential Kubectl Masquerading via Unexpected Process