Keychain Password Retrieval via Command Line

Adversaries may collect keychain storage data from a system to in order to acquire credentials. Keychains are the built-in way for macOS to keep track of users' passwords and credentials for many services and features, including Wi-Fi and website passwords, secure notes, certificates, and Kerberos.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/01/06"
 3integration = ["endpoint"]
 4maturity = "production"
 5updated_date = "2024/05/21"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Adversaries may collect keychain storage data from a system to in order to acquire credentials. Keychains are the
11built-in way for macOS to keep track of users' passwords and credentials for many services and features, including Wi-Fi
12and website passwords, secure notes, certificates, and Kerberos.
13"""
14false_positives = ["Applications for password management."]
15from = "now-9m"
16index = ["logs-endpoint.events.*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Keychain Password Retrieval via Command Line"
20references = [
21    "https://www.netmeister.org/blog/keychain-passwords.html",
22    "https://github.com/priyankchheda/chrome_password_grabber/blob/master/chrome.py",
23    "https://ss64.com/osx/security.html",
24    "https://www.intezer.com/blog/research/operation-electrorat-attacker-creates-fake-companies-to-drain-your-crypto-wallets/",
25]
26risk_score = 73
27rule_id = "9092cd6c-650f-4fa3-8a8a-28256c7489c9"
28setup = """## Setup
29
30This rule requires data coming in from Elastic Defend.
31
32### Elastic Defend Integration Setup
33Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
34
35#### Prerequisite Requirements:
36- Fleet is required for Elastic Defend.
37- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
38
39#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
40- Go to the Kibana home page and click "Add integrations".
41- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
42- Click "Add Elastic Defend".
43- Configure the integration name and optionally add a description.
44- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
45- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
46- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
47- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
48For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
49- Click "Save and Continue".
50- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
51For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
52"""
53severity = "high"
54tags = [
55    "Domain: Endpoint",
56    "OS: macOS",
57    "Use Case: Threat Detection",
58    "Tactic: Credential Access",
59    "Data Source: Elastic Defend",
60]
61timestamp_override = "event.ingested"
62type = "eql"
63
64query = '''
65process where host.os.type == "macos" and event.action == "exec" and
66 process.name : "security" and
67 process.args : ("-wa", "-ga") and process.args : ("find-generic-password", "find-internet-password") and
68 process.command_line : ("*Chrome*", "*Chromium*", "*Opera*", "*Safari*", "*Brave*", "*Microsoft Edge*", "*Firefox*") and
69 not process.parent.executable : "/Applications/Keeper Password Manager.app/Contents/Frameworks/Keeper Password Manager Helper*/Contents/MacOS/Keeper Password Manager Helper*"
70'''
71
72
73[[rule.threat]]
74framework = "MITRE ATT&CK"
75[[rule.threat.technique]]
76id = "T1555"
77name = "Credentials from Password Stores"
78reference = "https://attack.mitre.org/techniques/T1555/"
79[[rule.threat.technique.subtechnique]]
80id = "T1555.001"
81name = "Keychain"
82reference = "https://attack.mitre.org/techniques/T1555/001/"
83
84
85[[rule.threat.technique]]
86id = "T1555"
87name = "Credentials from Password Stores"
88reference = "https://attack.mitre.org/techniques/T1555/"
89[[rule.threat.technique.subtechnique]]
90id = "T1555.003"
91name = "Credentials from Web Browsers"
92reference = "https://attack.mitre.org/techniques/T1555/003/"
93
94
95
96[rule.threat.tactic]
97id = "TA0006"
98name = "Credential Access"
99reference = "https://attack.mitre.org/tactics/TA0006/"

References

Related rules

to-top