From 6883ea0aa6eafd08307ee4dc9caae91c9ac11170 Mon Sep 17 00:00:00 2001 From: Samirbous <64742097+Samirbous@users.noreply.github.com> Date: Tue, 26 Jan 2021 08:35:16 +0100 Subject: [PATCH] [New Rule] Potential Persistence via Login Hook (#900) * [New Rule] Potential Persistence via Login Hook * Update persistence_loginwindow_plist_modification.toml * Update rules/macos/persistence_loginwindow_plist_modification.toml Co-authored-by: Andrew Pease <7442091+peasead@users.noreply.github.com> * Update rules/macos/persistence_loginwindow_plist_modification.toml Co-authored-by: Andrew Pease <7442091+peasead@users.noreply.github.com> * Update rules/macos/persistence_loginwindow_plist_modification.toml Co-authored-by: Andrew Pease <7442091+peasead@users.noreply.github.com> * Update rules/macos/persistence_loginwindow_plist_modification.toml Co-authored-by: Andrew Pease <7442091+peasead@users.noreply.github.com> * Update persistence_loginwindow_plist_modification.toml * Update rules/macos/persistence_loginwindow_plist_modification.toml Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> Co-authored-by: Andrew Pease <7442091+peasead@users.noreply.github.com> Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> --- ...stence_loginwindow_plist_modification.toml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 rules/macos/persistence_loginwindow_plist_modification.toml diff --git a/rules/macos/persistence_loginwindow_plist_modification.toml b/rules/macos/persistence_loginwindow_plist_modification.toml new file mode 100644 index 000000000..477c43a57 --- /dev/null +++ b/rules/macos/persistence_loginwindow_plist_modification.toml @@ -0,0 +1,47 @@ +[metadata] +creation_date = "2021/01/21" +maturity = "production" +updated_date = "2021/01/21" + +[rule] +author = ["Elastic"] +description = """ +Identifies the creation or modification of the login window property list (plist). Adversaries may modify plist files to run a program during system boot or user login for persistence. +""" +from = "now-9m" +index = ["auditbeat-*", "logs-endpoint.events.*"] +language = "kuery" +license = "Elastic License" +name = "Potential Persistence via Login Hook" +note = "Starting in Mac OS X 10.7 (Lion), users can specify certain applications to be re-opened when a user reboots their machine. This can be abused to establish or maintain persistence on a compromised system." +references = ["https://github.com/D00MFist/PersistentJXA/blob/master/LoginScript.js"] +risk_score = 47 +rule_id = "ac412404-57a5-476f-858f-4e8fbb4f48d8" +severity = "medium" +tags = ["Elastic", "Host", "macOS", "Threat Detection", "Persistence"] +type = "query" + +query = ''' +event.category:"file" and not event.type:"deletion" and + file.name:"com.apple.loginwindow.plist" and + process.name:(* and not (systemmigrationd or DesktopServicesHelper or diskmanagementd or rsync or launchd or cfprefsd or xpcproxy or ManagedClient or MCXCompositor)) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1547" +name = "Boot or Logon Autostart Execution" +reference = "https://attack.mitre.org/techniques/T1547/" +[[rule.threat.technique.subtechnique]] +id = "T1547.011" +name = "Plist Modification" +reference = "https://attack.mitre.org/techniques/T1547/011/" + + + +[rule.threat.tactic] +id = "TA0003" +name = "Persistence" +reference = "https://attack.mitre.org/tactics/TA0003/"