Detection rules › Elastic

Keychain Credential Files Collected via Archive Utility

Source
github.com/elastic/protections-artifacts

Adversaries may collect the keychain storage data from a system to acquire credentials. Keychains are the built-in way for macOS to keep track of users' passwords and credentials for many services and features such as WiFi passwords, websites, secure notes and certificates.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

[rule]
description = """
Adversaries may collect the keychain storage data from a system to acquire credentials. Keychains are the built-in way
for macOS to keep track of users' passwords and credentials for many services and features such as WiFi passwords,
websites, secure notes and certificates.
"""
id = "150f20b4-6b21-460b-8ae4-339695c1c86c"
license = "Elastic License v2"
name = "Keychain Credential Files Collected via Archive Utility"
os_list = ["macos"]
reference = [
    "https://objective-see.com/blog/blog_0x25.html",
    "https://securelist.com/calisto-trojan-for-macos/86543/",
]
version = "1.0.31"

query = '''
process where event.action == "exec" and process.name in ("zip", "tar") and
  process.command_line like~
    (
      "*/Users/*/Library/Keychains/*",
      "*/Library/Keychains/*",
      "*/Network/Library/Keychains/*",
      "*System.keychain*",
      "*login.keychain-db*",
      "*login.keychain*"
    ) and
    not process.args like~
               ("find-certificate",
                "add-trusted-cert",
                "set-keychain-settings",
                "delete-certificate",
                "/Users/*/Library/Keychains/openvpn.keychain-db",
                "show-keychain-info",
                "lock-keychain",
                "set-key-partition-list",
                "import",
                "find-identity") and
    not process.parent.executable like
      (
        "/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect",
        "/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise",
        "/opt/jc/bin/jumpcloud-agent"
      ) and
    not process.executable == "/opt/jc/bin/jumpcloud-agent"
'''

min_endpoint_version = "8.10.2"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.001"
name = "Keychain"
reference = "https://attack.mitre.org/techniques/T1555/001/"



[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "8.10.2"

Stages and Predicates

Stage 1: process

process where event.action == "exec" and process.name in ("zip", "tar") and
  process.command_line like~
    (
      "*/Users/*/Library/Keychains/*",
      "*/Library/Keychains/*",
      "*/Network/Library/Keychains/*",
      "*System.keychain*",
      "*login.keychain-db*",
      "*login.keychain*"
    ) and
    not process.args like~
               ("find-certificate",
                "add-trusted-cert",
                "set-keychain-settings",
                "delete-certificate",
                "/Users/*/Library/Keychains/openvpn.keychain-db",
                "show-keychain-info",
                "lock-keychain",
                "set-key-partition-list",
                "import",
                "find-identity") and
    not process.parent.executable like
      (
        "/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect",
        "/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise",
        "/opt/jc/bin/jumpcloud-agent"
      ) and
    not process.executable == "/opt/jc/bin/jumpcloud-agent"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argswildcardfind-certificate, add-trusted-cert, set-keychain-settings, delete-certificate, /Users/*/Library/Keychains/openvpn.keychain-db, show-keychain-info, lock-keychain, set-key-partition-list, import, find-identityexcludes:process.args
process.executableeq/opt/jc/bin/jumpcloud-agentexcludes:process.executable field:"process.executable" value:"/opt/jc/bin/jumpcloud-agent"
process.parent.executableeq/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect, /Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise, /opt/jc/bin/jumpcloud-agentexcludes:process.parent.executable field:"process.parent.executable" value:"/Applications/OpenVPN Connect/OpenVPN Connect.app/Contents/MacOS/OpenVPN Connect" field:"process.parent.executable" value:"/Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_enterprise.app/Contents/MacOS/wdavdaemon_enterprise" field:"process.parent.executable" value:"/opt/jc/bin/jumpcloud-agent"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec
field:"EventType" kind:eq value:"exec"
process.command_linewildcard
  • */Library/Keychains/*
  • */Network/Library/Keychains/*
  • */Users/*/Library/Keychains/*
  • *System.keychain*
  • *login.keychain*
  • *login.keychain-db*
field:"CommandLine" kind:wildcard
process.namein
  • tar
  • zip
field:"process_name" kind:in