59da2da474
* add unit tests to ensure host type and platform are included * add host.os.name 'linux' to all linux rules * add host.os.name macos to mac rules * add host.os.name to windows rules; fix linux dates * update from host.os.name to host.os.type Co-authored-by: brokensound77 <brokensound77@users.noreply.github.com> Co-authored-by: Jonhnathan <26856693+w0rk3r@users.noreply.github.com>
89 lines
2.9 KiB
TOML
89 lines
2.9 KiB
TOML
[metadata]
|
|
creation_date = "2021/10/05"
|
|
integration = ["endpoint"]
|
|
maturity = "production"
|
|
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
|
|
min_stack_version = "8.3.0"
|
|
updated_date = "2023/02/22"
|
|
|
|
[rule]
|
|
author = ["Elastic"]
|
|
description = """
|
|
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.
|
|
"""
|
|
from = "now-9m"
|
|
index = ["auditbeat-*", "logs-endpoint.events.*"]
|
|
language = "eql"
|
|
license = "Elastic License v2"
|
|
name = "Screensaver Plist File Modified by Unexpected Process"
|
|
note = """## Triage and analysis
|
|
|
|
- Analyze the plist file modification event to identify whether the change was expected or not
|
|
- Investigate the process that modified the plist file for malicious code or other suspicious behavior
|
|
- Identify if any suspicious or known malicious screensaver (.saver) files were recently written to or modified on the host
|
|
|
|
## Setup
|
|
|
|
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
|
|
"""
|
|
references = [
|
|
"https://posts.specterops.io/saving-your-access-d562bf5bf90b",
|
|
"https://github.com/D00MFist/PersistentJXA",
|
|
]
|
|
risk_score = 47
|
|
rule_id = "e6e8912f-283f-4d0d-8442-e0dcaf49944b"
|
|
severity = "medium"
|
|
tags = ["Elastic", "Host", "macOS", "Threat Detection", "Persistence"]
|
|
timestamp_override = "event.ingested"
|
|
type = "eql"
|
|
|
|
query = '''
|
|
file where host.os.type == "macos" and event.type != "deletion" and
|
|
file.name: "com.apple.screensaver.*.plist" and
|
|
file.path : (
|
|
"/Users/*/Library/Preferences/ByHost/*",
|
|
"/Library/Managed Preferences/*",
|
|
"/System/Library/Preferences/*"
|
|
) and
|
|
(
|
|
process.code_signature.trusted == false or
|
|
process.code_signature.exists == false or
|
|
|
|
/* common script interpreters and abused native macOS bins */
|
|
process.name : (
|
|
"curl",
|
|
"mktemp",
|
|
"tail",
|
|
"funzip",
|
|
"python*",
|
|
"osascript",
|
|
"perl"
|
|
)
|
|
) and
|
|
|
|
/* Filter OS processes modifying screensaver plist files */
|
|
not process.executable : (
|
|
"/usr/sbin/cfprefsd",
|
|
"/usr/libexec/xpcproxy",
|
|
"/System/Library/CoreServices/ManagedClient.app/Contents/Resources/MCXCompositor",
|
|
"/System/Library/CoreServices/ManagedClient.app/Contents/MacOS/ManagedClient"
|
|
)
|
|
'''
|
|
|
|
|
|
[[rule.threat]]
|
|
framework = "MITRE ATT&CK"
|
|
[[rule.threat.technique]]
|
|
id = "T1546"
|
|
name = "Event Triggered Execution"
|
|
reference = "https://attack.mitre.org/techniques/T1546/"
|
|
|
|
|
|
[rule.threat.tactic]
|
|
id = "TA0003"
|
|
name = "Persistence"
|
|
reference = "https://attack.mitre.org/tactics/TA0003/"
|
|
|