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

References

Related rules

to-top