Persistence (TA0003)(external, opens in a new tab or window)
text code block:file where host.os.type == "macos" and event.action == "modification" and file.name like~ "com.apple.screensaver.*.plist" and file.path like ( "/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 like~ ( "curl", "mktemp", "tail", "funzip", "python*", "osascript", "perl" ) ) and /* Filter OS processes modifying screensaver plist files */ not process.executable like ( "/usr/sbin/cfprefsd", "/usr/libexec/xpcproxy", "/System/Library/CoreServices/ManagedClient.app/Contents/Resources/MCXCompositor", "/System/Library/CoreServices/ManagedClient.app/Contents/MacOS/ManagedClient" )
Install detection rules in Elastic Security
Detect Screensaver Plist File Modified by Unexpected Process in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).