Screensaver Plist File Modified by Unexpected Process

Identifies when a screensaver plist file is modified by an unexpected process. An adversary can maintain persistence on a macOS endpoint by creating a malicious screensaver (.saver) file and configuring the screensaver plist file to execute code each time the screensaver is activated.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/10/05"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2026/10/26"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies when a screensaver plist file is modified by an unexpected process. An adversary can maintain persistence on
 11a macOS endpoint by creating a malicious screensaver (.saver) file and configuring the screensaver plist file to execute
 12code each time the screensaver is activated.
 13"""
 14from = "now-9m"
 15index = ["logs-endpoint.events.file*"]
 16language = "eql"
 17license = "Elastic License v2"
 18name = "Screensaver Plist File Modified by Unexpected Process"
 19note = """## Triage and analysis
 20
 21> **Disclaimer**:
 22> 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.
 23
 24### Investigating Screensaver Plist File Modified by Unexpected Process
 25
 26The `com.apple.screensaver.*.plist` files define the active screensaver module and its settings. Adversaries can drop a malicious `.saver` bundle and update these plist files so that the bundle is loaded and executes code every time the screensaver activates. This rule alerts when a screensaver plist file is modified by an unsigned or untrusted process, or by a script interpreter or native utility commonly abused by attackers.
 27
 28### Possible investigation steps
 29
 30- Identify the process that modified the plist (`process.executable`, `process.code_signature.*`) and determine why an untrusted process or interpreter changed screensaver settings. Review the process's execution event for its command line and parent.
 31- Review the plist file (`file.path`) and its current contents on the host to identify the configured screensaver module and its path.
 32- Locate the referenced `.saver` bundle and check its code signature, creation time, origin, and contents.
 33- Review recent file events for `.saver` bundles written to `~/Library/Screen Savers/`, `/Library/Screen Savers/`, or unusual locations around the time of the alert.
 34- Analyze the process tree of the modifying process for signs of initial access or execution, such as downloads, script interpreters, or other persistence activity.
 35- Check for child processes of `ScreenSaverEngine` or `legacyScreenSaver` on the host after the modification, which may indicate the payload has already executed.
 36
 37### False positive analysis
 38
 39- Device management solutions or administrative scripts may configure screensaver settings with script interpreters. Verify the script and its origin with the team responsible for endpoint management.
 40- Unsigned or ad hoc signed third-party utilities may change screensaver preferences. Confirm the tool is approved in the environment.
 41- When the activity is confirmed benign, create an exception for the specific process executable or script rather than for the plist file path.
 42
 43### Response and remediation
 44
 45- Isolate the affected host from the network if the modification is determined to be malicious.
 46- Revert the screensaver plist to a known good configuration and remove any malicious `.saver` bundle after preserving a copy for analysis.
 47- Terminate the modifying process and any processes started by the malicious screensaver.
 48- Investigate how the attacker gained access to the host and remediate the initial access vector.
 49- Escalate to the incident response team and search for the same plist modification or `.saver` bundle on other macOS hosts.
 50"""
 51references = [
 52    "https://posts.specterops.io/saving-your-access-d562bf5bf90b",
 53    "https://github.com/D00MFist/PersistentJXA",
 54]
 55risk_score = 47
 56rule_id = "e6e8912f-283f-4d0d-8442-e0dcaf49944b"
 57setup = """## Setup
 58
 59This rule requires data coming in from Elastic Defend.
 60
 61### Elastic Defend Integration Setup
 62Elastic 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.
 63
 64#### Prerequisite Requirements:
 65- Fleet is required for Elastic Defend.
 66- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 67
 68#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
 69- Go to the Kibana home page and click "Add integrations".
 70- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 71- Click "Add Elastic Defend".
 72- Configure the integration name and optionally add a description.
 73- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
 74- 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).
 75- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 76- 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.
 77For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
 78- Click "Save and Continue".
 79- 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.
 80For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 81"""
 82severity = "medium"
 83tags = [
 84    "Domain: Endpoint",
 85    "OS: macOS",
 86    "Use Case: Threat Detection",
 87    "Tactic: Persistence",
 88    "Data Source: Elastic Defend",
 89    "Resources: Investigation Guide",
 90    "Noise: Low",
 91    "Performance: Normal",
 92    "Rule Type: Event Correlation (EQL)",
 93    "Platform: macOS",
 94]
 95timestamp_override = "event.ingested"
 96type = "eql"
 97
 98query = '''
 99file where host.os.type == "macos" and event.action == "modification" and
100  file.name like~ "com.apple.screensaver.*.plist" and
101   file.path like (
102      "/Users/*/Library/Preferences/ByHost/*",
103      "/Library/Managed Preferences/*",
104      "/System/Library/Preferences/*"
105      ) and
106  (
107    process.code_signature.trusted == false or
108    process.code_signature.exists == false or
109
110    /* common script interpreters and abused native macOS bins */
111    process.name like~ (
112      "curl",
113      "mktemp",
114      "tail",
115      "funzip",
116      "python*",
117      "osascript",
118      "perl"
119      )
120   ) and
121
122  /* Filter OS processes modifying screensaver plist files */
123  not process.executable like (
124    "/usr/sbin/cfprefsd",
125    "/usr/libexec/xpcproxy",
126    "/System/Library/CoreServices/ManagedClient.app/Contents/Resources/MCXCompositor",
127    "/System/Library/CoreServices/ManagedClient.app/Contents/MacOS/ManagedClient"
128    )
129'''
130
131
132[[rule.threat]]
133framework = "MITRE ATT&CK"
134
135[[rule.threat.technique]]
136id = "T1546"
137name = "Event Triggered Execution"
138reference = "https://attack.mitre.org/techniques/T1546/"
139
140[[rule.threat.technique.subtechnique]]
141id = "T1546.002"
142name = "Screensaver"
143reference = "https://attack.mitre.org/techniques/T1546/002/"
144
145[rule.threat.tactic]
146id = "TA0003"
147name = "Persistence"
148reference = "https://attack.mitre.org/tactics/TA0003/"

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 Screensaver Plist File Modified by Unexpected Process

The com.apple.screensaver.*.plist files define the active screensaver module and its settings. Adversaries can drop a malicious .saver bundle and update these plist files so that the bundle is loaded and executes code every time the screensaver activates. This rule alerts when a screensaver plist file is modified by an unsigned or untrusted process, or by a script interpreter or native utility commonly abused by attackers.

Possible investigation steps

  • Identify the process that modified the plist (process.executable, process.code_signature.*) and determine why an untrusted process or interpreter changed screensaver settings. Review the process's execution event for its command line and parent.
  • Review the plist file (file.path) and its current contents on the host to identify the configured screensaver module and its path.
  • Locate the referenced .saver bundle and check its code signature, creation time, origin, and contents.
  • Review recent file events for .saver bundles written to ~/Library/Screen Savers/, /Library/Screen Savers/, or unusual locations around the time of the alert.
  • Analyze the process tree of the modifying process for signs of initial access or execution, such as downloads, script interpreters, or other persistence activity.
  • Check for child processes of ScreenSaverEngine or legacyScreenSaver on the host after the modification, which may indicate the payload has already executed.

False positive analysis

  • Device management solutions or administrative scripts may configure screensaver settings with script interpreters. Verify the script and its origin with the team responsible for endpoint management.
  • Unsigned or ad hoc signed third-party utilities may change screensaver preferences. Confirm the tool is approved in the environment.
  • When the activity is confirmed benign, create an exception for the specific process executable or script rather than for the plist file path.

Response and remediation

  • Isolate the affected host from the network if the modification is determined to be malicious.
  • Revert the screensaver plist to a known good configuration and remove any malicious .saver bundle after preserving a copy for analysis.
  • Terminate the modifying process and any processes started by the malicious screensaver.
  • Investigate how the attacker gained access to the host and remediate the initial access vector.
  • Escalate to the incident response team and search for the same plist modification or .saver bundle on other macOS hosts.

References

Related rules

to-top