-
Notifications
You must be signed in to change notification settings - Fork 692
Detect CVE-2026-65400 Screen Sharing exploitation via SSFileCopy helpers #6675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
bd4d36e
3944128
4ee25a8
4a570b2
ffe8868
155e86a
9fe1b16
367e568
1b3808f
359c992
b4a0dc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| [metadata] | ||
| creation_date = "2026/08/19" | ||
| integration = ["endpoint"] | ||
| maturity = "production" | ||
| updated_date = "2026/08/19" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| Identifies execution of the macOS Screen Sharing file-copy helper SSFileCopySender with root UID/GID attributes | ||
| (0 80). Under the native Apple authentication path this helper runs in the connecting user's context; execution as | ||
| root is anomalous and consistent with pre-authentication exploitation of the Screen Sharing service (CVE-2026-65400), | ||
| where a flawed SRP validation path lets an unauthenticated attacker reach privileged file operations. Note that the | ||
| 0/80 UID/GID pair reflects only initial exploitation attempts and can be evaded once an attacker enumerates another | ||
| local account. It is advisable to treat this as a tripwire and pair it with | ||
| the SSFileCopyReceiver Writing to Common Persistence Locations rule coverage. | ||
| """ | ||
| from = "now-9m" | ||
| language = "esql" | ||
| license = "Elastic License v2" | ||
| name = "SSFileCopySender Executed as Root" | ||
| note = """ ## 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 SSFileCopySender Executed as Root | ||
|
|
||
| This detects the macOS Screen Sharing file-copy helper starting with root privileges, which is abnormal because legitimate file transfers run in the remote user’s context. That pattern matters because it strongly suggests a pre-authentication Screen Sharing exploit path that lets an unauthenticated attacker invoke privileged file operations, for example by reaching the service over the network and copying a payload into /Library/LaunchDaemons before any user logs in. | ||
|
|
||
| ### Possible investigation steps | ||
|
|
||
| - Correlate the alert time with unified logs, firewall records, and endpoint network telemetry to identify the source IP that reached Screen Sharing and determine whether the connection came from an unexpected internal or external host. | ||
| - Reconstruct the 5–10 minute execution timeline around the event to capture the launch context and any follow-on activity such as shell, scripting, download, archive, permission-change, or service-management commands. | ||
| - Review concurrent and subsequent file activity for newly written or modified items in common staging and persistence paths such as /Library/LaunchDaemons, /Library/LaunchAgents, /Library/PrivilegedHelperTools, /Users/Shared, and temporary directories, and collect hashes for any payloads. | ||
| - Validate whether any legitimate remote administration or support session was expected on the host and compare that with authentication and user-session records to spot execution without a corresponding successful login or a rapid pivot to another local account. | ||
| - Scope for broader exploitation by confirming whether Screen Sharing or Remote Management was enabled, checking the host’s patch status for CVE-2026-65400, and searching for the same source IP or related indicators across other macOS systems. | ||
|
|
||
| ### False positive analysis | ||
|
|
||
| - An authorized administrator may manually invoke SSFileCopySender as root during macOS Screen Sharing troubleshooting or control validation; verify the parent process is an expected local shell or maintenance script, the activity aligns with a documented change window, and there are no unexpected follow-on file writes. | ||
| - A lab or staging Mac used for patch verification or regression testing may intentionally exercise the Screen Sharing file-copy helper with the 0/80 arguments; verify the host’s role, confirm the timing matches approved test activity, and ensure any related network source and copied files are expected. | ||
|
|
||
| ### Related Rules | ||
|
|
||
| - SSFileCopyReceiver Writing to Common Persistence Locations - 5773cef4-11a5-4d51-a40b-0e0a79d68432 | ||
|
|
||
| ### Response and remediation | ||
|
|
||
| - Immediately isolate the affected Mac from the network, disable Screen Sharing and Remote Management on the host, and block the identified source IP or access path while preserving relevant logs and suspicious files for follow-up analysis. | ||
| - Remove attacker footholds by unloading and deleting unauthorized launchd items from /Library/LaunchDaemons and /Library/LaunchAgents, removing rogue binaries from /Library/PrivilegedHelperTools, /Users/Shared, and temporary directories, and deleting any unknown local accounts or added SSH authorized_keys. | ||
| - Restore the system to a known-good state by reimaging the host or recovering from a trusted backup if SSFileCopySender was followed by writes to privileged locations, modified system settings, or execution of additional payloads. | ||
| - Escalate to incident response immediately if you confirm persistence in system-wide paths, evidence of lateral movement, tampering with security tooling, or the same Screen Sharing source interacting with any other macOS endpoints. | ||
| - Harden the environment by applying the vendor patch for CVE-2026-65400, disabling Screen Sharing where it is not required, restricting remote administration to approved management networks or VPN, and rotating passwords for any local or administrative accounts exposed on the host. | ||
| """ | ||
| references = [ | ||
| "https://www.huntress.com/blog/macos-screen-sharing-rce-patched", | ||
| "https://nvd.nist.gov/vuln/detail/CVE-2026-65400", | ||
| "https://support.apple.com/en-us/HT201222", | ||
| ] | ||
| risk_score = 47 | ||
| rule_id = "e54c3f36-e243-402d-9d44-8f7349eb8c88" | ||
| setup = """## Setup | ||
|
|
||
| This rule requires data coming in from Elastic Defend. | ||
|
|
||
| ### Elastic Defend Integration Setup | ||
| Elastic 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. | ||
|
|
||
| #### Prerequisite Requirements: | ||
| - Fleet is required for Elastic Defend. | ||
| - To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html). | ||
|
|
||
| #### The following steps should be executed in order to add the Elastic Defend integration on a macOS System: | ||
| - Go to the Kibana home page and click "Add integrations". | ||
| - In the query bar, search for "Elastic Defend" and select the integration to see more details about it. | ||
| - Click "Add Elastic Defend". | ||
| - Configure the integration name and optionally add a description. | ||
| - Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints". | ||
| - 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). | ||
| - We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions" | ||
| - 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. | ||
| For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html). | ||
| - Click "Save and Continue". | ||
| - 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. | ||
| For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html). | ||
| """ | ||
| severity = "medium" | ||
| tags = [ | ||
| "Domain: Endpoint", | ||
| "OS: macOS", | ||
| "Use Case: Threat Detection", | ||
| "Use Case: Vulnerability", | ||
| "Tactic: Initial Access", | ||
| "Data Source: Elastic Defend", | ||
| "Resources: Investigation Guide" | ||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "esql" | ||
|
|
||
| query = ''' | ||
| from logs-endpoint.events.process-* METADATA _id, _index, _version | ||
| | WHERE host.os.type == "macos" | ||
| AND event.type == "start" | ||
| AND process.name == "SSFileCopySender" | ||
| AND KQL(""" process.args : "0" AND process.args : "80" """) | ||
| | KEEP _id, _version, _index, | ||
|
shashank-elastic marked this conversation as resolved.
|
||
| @timestamp, | ||
| data_stream.namespace, | ||
| host.name, | ||
|
shashank-elastic marked this conversation as resolved.
|
||
| host.id, | ||
| user.id, | ||
| user.name, | ||
| process.name, | ||
| process.entity_id, | ||
| process.parent.name, | ||
| process.command_line | ||
| | SORT @timestamp DESC | ||
| | LIMIT 100 | ||
| ''' | ||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
|
|
||
| [[rule.threat.technique]] | ||
| id = "T1190" | ||
| name = "Exploit Public-Facing Application" | ||
| reference = "https://attack.mitre.org/techniques/T1190/" | ||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0001" | ||
| name = "Initial Access" | ||
| reference = "https://attack.mitre.org/tactics/TA0001/" | ||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
|
|
||
| [[rule.threat.technique]] | ||
| id = "T1068" | ||
| name = "Exploitation for Privilege Escalation" | ||
| reference = "https://attack.mitre.org/techniques/T1068/" | ||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0004" | ||
| name = "Privilege Escalation" | ||
| reference = "https://attack.mitre.org/tactics/TA0004/" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit. Missing EOF newline. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| [metadata] | ||
| creation_date = "2026/08/19" | ||
| integration = ["endpoint"] | ||
| maturity = "production" | ||
| updated_date = "2026/08/19" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| Identifies the macOS Screen Sharing file copy helper SSFileCopyReceiver creating or modifying files in common | ||
| persistence locations such as LaunchDaemons/LaunchAgents, shell profiles, SSH authorized_keys, cron tabs, and hidden paths | ||
| under root's home directory. SSFileCopyReceiver performs file writes with root authority on behalf of a remote viewer. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current logic does not filter by location to just the root's home directory. Should this be updated to match? |
||
| Pre-authentication exploitation of the Screen Sharing service (CVE-2026-65400) abuses this write primitive to | ||
| establish persistence; observed in-the-wild activity dropped LaunchDaemons and modified shell startup files to run a | ||
| cryptocurrency miner as root. | ||
| """ | ||
| from = "now-9m" | ||
| language = "esql" | ||
| license = "Elastic License v2" | ||
| name = "SSFileCopyReceiver Writing to Common Persistence Locations" | ||
| note = """ ## 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 SSFileCopyReceiver Writing to Common Persistence Locations | ||
|
|
||
| This rule spots the macOS Screen Sharing file copy helper writing into locations that commonly grant persistence, such as launch items, shell startup files, SSH access files, scheduled task tabs, and hidden directories under root’s home. It matters because this helper performs writes as root for a remote session, so an attacker can exploit Screen Sharing and drop a LaunchDaemon plist or alter .zshrc to start a miner or backdoor every boot or login. | ||
|
|
||
| ### Possible investigation steps | ||
|
|
||
| - Review the exact contents and recent versions of the written plist, shell startup file, cron tab, hidden root file, or SSH key file for persistence logic such as RunAtLoad or KeepAlive settings, embedded download commands, unexpected SSH public keys, or references to miner, shell, or staging paths. | ||
| - Correlate the file write time with Screen Sharing and VNC access evidence in Unified Logs, authentication records, and inbound network activity to determine whether the change aligns with an approved remote support session or an unsolicited access attempt consistent with exploitation. | ||
| - Confirm whether the persistence has executed by examining loaded launchd jobs, recent root-level child processes, and any binaries or scripts referenced by the modified artifact, prioritizing unknown executables, curl or bash chains, and long-running resource-intensive processes. | ||
| - Validate the dropped or referenced payloads by collecting hashes, code-signing and notarization status, ownership and permissions, and comparing them to known-good administration tools, approved software, and recent change tickets. | ||
| - Scope impact and remediate by hunting fleet-wide for the same plist labels, SSH keys, file hashes, payload paths, and Screen Sharing write patterns, then isolate affected hosts, remove unauthorized persistence, revoke added access, and update or disable exposed Screen Sharing services until patched. | ||
|
|
||
| ### False positive analysis | ||
|
|
||
| - A legitimate administrator using macOS Screen Sharing may copy an approved LaunchDaemon or LaunchAgent plist during remote maintenance or software rollout; verify the session was expected and that the plist label, referenced executable, ownership, and signing details match authorized system changes. | ||
| - A user support session can legitimately update a shell profile or SSH authorized_keys file to restore access or set environment defaults; confirm the request with the user or admin and review the added commands or keys to ensure they belong to known accounts and do not launch unexpected binaries. | ||
|
|
||
| ### Related Rules | ||
|
|
||
| - SSFileCopySender Executed as Root - e54c3f36-e243-402d-9d44-8f7349eb8c88 | ||
|
|
||
| ### Response and remediation | ||
|
|
||
| - Isolate the affected Mac from the network, stop any malicious launchd job, miner, or shell started from the newly written LaunchDaemon, LaunchAgent, shell profile, cron tab, hidden root file, or added SSH key, and preserve the modified files and referenced payloads as evidence. | ||
| - Remove attacker persistence by deleting unauthorized plist files from /Library/LaunchDaemons or LaunchAgents, reverting changes to .zshrc, .bash_profile, and other startup files, removing unapproved entries from authorized_keys and /var/at/tabs, and unloading any matching launchd services. | ||
| - Restore the host to a known-good state by replacing altered configuration files from a trusted backup or gold image, reinstalling any trojanized binaries referenced by the persistence item, and validating ownership, permissions, and code-signing on the restored files. | ||
| - Escalate to incident response immediately if the same plist label, SSH public key, payload hash, or Screen Sharing write pattern is found on additional systems, if root-level processes continue after cleanup, or if you identify signs of credential theft or lateral movement. | ||
| - Harden the environment by patching or disabling Screen Sharing where it is not required, restricting remote management exposure with firewall and access controls, rotating credentials and SSH keys that may have been added or abused, and monitoring for new writes to LaunchDaemons, shell profiles, cron tabs, and hidden paths under root’s home. | ||
| """ | ||
| references = [ | ||
| "https://www.huntress.com/blog/macos-screen-sharing-rce-patched", | ||
| "https://nvd.nist.gov/vuln/detail/CVE-2026-65400", | ||
| "https://support.apple.com/en-us/HT201222", | ||
| ] | ||
| risk_score = 73 | ||
| rule_id = "5773cef4-11a5-4d51-a40b-0e0a79d68432" | ||
| setup = """## Setup | ||
|
|
||
| This rule requires data coming in from Elastic Defend. | ||
|
|
||
| ### Elastic Defend Integration Setup | ||
| Elastic 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. | ||
|
|
||
| #### Prerequisite Requirements: | ||
| - Fleet is required for Elastic Defend. | ||
| - To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html). | ||
|
|
||
| #### The following steps should be executed in order to add the Elastic Defend integration on a macOS System: | ||
| - Go to the Kibana home page and click "Add integrations". | ||
| - In the query bar, search for "Elastic Defend" and select the integration to see more details about it. | ||
| - Click "Add Elastic Defend". | ||
| - Configure the integration name and optionally add a description. | ||
| - Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints". | ||
| - 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). | ||
| - We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions" | ||
| - 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. | ||
| For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html). | ||
| - Click "Save and Continue". | ||
| - 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. | ||
| For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html). | ||
| """ | ||
| severity = "high" | ||
| tags = [ | ||
| "Domain: Endpoint", | ||
| "OS: macOS", | ||
| "Use Case: Threat Detection", | ||
| "Use Case: Vulnerability", | ||
| "Tactic: Persistence", | ||
| "Data Source: Elastic Defend", | ||
| "Resources: Investigation Guide" | ||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "esql" | ||
| query = ''' | ||
| from logs-endpoint.events.file-* METADATA _id, _index, _version | ||
| | WHERE host.os.type == "macos" | ||
| AND event.type != "deletion" | ||
| AND process.name == "SSFileCopyReceiver" | ||
|
shashank-elastic marked this conversation as resolved.
|
||
| AND ( | ||
| file.path LIKE "/Library/LaunchDaemons/*.plist" | ||
| OR file.path LIKE "/Library/LaunchAgents/*.plist" | ||
| OR file.path LIKE "/Users/*/Library/LaunchAgents/*.plist" | ||
| OR file.path LIKE "/private/var/*/Library/LaunchAgents/*.plist" | ||
| OR file.name IN (".zshenv", ".zshrc", ".zprofile", ".zlogin", ".bashrc", ".bash_profile", ".bash_login", ".profile", "config.fish", "environment.plist") | ||
| OR file.path LIKE "/Users/*/.ssh/authorized_keys" | ||
| OR file.path LIKE "/private/var/root/.ssh/authorized_keys" | ||
|
shashank-elastic marked this conversation as resolved.
|
||
| OR file.path LIKE "/private/etc/ssh/sshd_config*" | ||
| OR file.path LIKE "/private/var/at/tabs/*" | ||
| OR file.path LIKE "/var/at/tabs/*" | ||
| OR file.path LIKE "/private/var/root/.*/*" | ||
| OR file.path LIKE "/var/root/.*/*" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Paths like
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ++ |
||
| ) | ||
| | KEEP _id, _index, _version, | ||
|
shashank-elastic marked this conversation as resolved.
|
||
| @timestamp, host.name, host.id, user.id, user.name, process.name, | ||
| event.action, event.type, file.path, file.name, data_stream.namespace | ||
| ''' | ||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
|
|
||
| [[rule.threat.technique]] | ||
| id = "T1543" | ||
| name = "Create or Modify System Process" | ||
| reference = "https://attack.mitre.org/techniques/T1543/" | ||
|
|
||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1543.001" | ||
| name = "Launch Agent" | ||
| reference = "https://attack.mitre.org/techniques/T1543/001/" | ||
|
|
||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1543.004" | ||
| name = "Launch Daemon" | ||
| reference = "https://attack.mitre.org/techniques/T1543/004/" | ||
|
|
||
| [[rule.threat.technique]] | ||
| id = "T1546" | ||
| name = "Event Triggered Execution" | ||
| reference = "https://attack.mitre.org/techniques/T1546/" | ||
|
|
||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1546.004" | ||
| name = "Unix Shell Configuration Modification" | ||
| reference = "https://attack.mitre.org/techniques/T1546/004/" | ||
|
|
||
| [[rule.threat.technique]] | ||
| id = "T1098" | ||
| name = "Account Manipulation" | ||
| reference = "https://attack.mitre.org/techniques/T1098/" | ||
|
|
||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1098.004" | ||
| name = "SSH Authorized Keys" | ||
| reference = "https://attack.mitre.org/techniques/T1098/004/" | ||
|
|
||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0003" | ||
| name = "Persistence" | ||
| reference = "https://attack.mitre.org/tactics/TA0003/" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit. Missing EOF newline. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking, based off reading through https://www.huntress.com/blog/macos-screen-sharing-rce-patched this can also happen on legacy VNC auth where root is expected and not malicious. Should we note that in the FP guidance?