User Keychain copied via Shell interpreter


Description

Detects when the copy command is used to copy the user keychain database via a shell interpreter. Some recent malware stealer samples have been seen using this technique to retrieve sensitive files prior to exfiltration. The copying of the user keychain database is not normal activity under almost any circumstance and should be considered highly suspicious if not malicious.

Query · eql

process where event.type == "start" and event.action == "exec" and process.name == "cp" and 
 process.command_line like~ "*/Users/*/Library/Keychains/login.keychain-db*" and 
 process.parent.name in~ ("bash", "zsh", "sh", "Terminal")
Raw source User Keychain copied via Shell interpreter · Elastic TOML
Esc
Published by elastic/protections-artifacts ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[rule]
description = """
Detects when the copy command is used to copy the user keychain database via a shell interpreter. Some recent malware
stealer samples have been seen using this technique to retrieve sensitive files prior to exfiltration. The copying of
the user keychain database is not normal activity under almost any circumstance and should be considered highly
suspicious if not malicious.
"""
id = "8b0e22e0-dfee-46fa-8695-be94334d34f1"
license = "Elastic License v2"
name = "User Keychain copied via Shell interpreter"
os_list = ["macos"]
reference = ["https://hunt.io/blog/macos-malware-impersonates-the-unarchiver-app-to-steal-user-data"]
version = "1.0.3"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "cp" and 
 process.command_line like~ "*/Users/*/Library/Keychains/login.keychain-db*" and 
 process.parent.name in~ ("bash", "zsh", "sh", "Terminal")
'''

min_endpoint_version = "8.11.0"
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.11.0"

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.