process where host.os.type == "macos" and event.type == "start" and
process.name == "defaults" and process.args == "write" and process.args : ("LoginHook", "LogoutHook") and
not process.args :
(
"Support/JAMF/ManagementFrameworkScripts/logouthook.sh",
"Support/JAMF/ManagementFrameworkScripts/loginhook.sh",
"/Library/Application Support/JAMF/ManagementFrameworkScripts/logouthook.sh",
"/Library/Application Support/JAMF/ManagementFrameworkScripts/loginhook.sh"
)
Install detection rules in Elastic Security
Detect Persistence via Login or Logout Hook 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(opens in a new tab or window).