Adversaries may acquire credentials from Keychain. Keychain (or Keychain Services) is the macOS credential management system that stores account names, passwords, private keys, certificates, sensitive application data, payment data, and secure notes. There are three types of Keychains: Login Keychain, System Keychain, and Local Items (iCloud) Keychain. The default Keychain is the Login Keychain, which stores user passwords and information. The System Keychain stores items accessed by the operating system, such as items shared among users on a host. The Local Items (iCloud) Keychain is used for items synced with Apple’s iCloud service.
Keychains can be viewed and edited through the Keychain Access application or using the command-line utility security. Keychain files are located in ~/Library/Keychains/, /Library/Keychains/, and /Network/Library/Keychains/.[1][2][3]
Adversaries may gather user credentials from Keychain storage/memory. For example, the command security dump-keychain –d will dump all Login Keychain credentials from ~/Library/Keychains/login.keychain-db. Adversaries may also directly read Login Keychain credentials from the ~/Library/Keychains/login.keychain file. Both methods require a password, where the default password for the Login Keychain is the current user’s password to login to the macOS host.[4][5]
| ID | Name | Description |
|---|---|---|
| S1246 | BeaverTail |
BeaverTail has collected keys associated with macOS within |
| S0274 | Calisto |
Calisto collects Keychain storage data and copies those passwords/tokens to a file.[9][10] |
| G1052 | Contagious Interview |
Contagious Interview has leveraged malware variants configured to dump credentials from the macOS keychain.[11][6][7] |
| S1153 | Cuckoo Stealer |
Cuckoo Stealer can capture files from a targeted user's keychain directory.[12] |
| S0363 | Empire |
Empire uses the command |
| S0690 | Green Lambert |
Green Lambert can use Keychain Services API functions to find and collect passwords, such as |
| S0278 | iKitten | |
| S0349 | LaZagne | |
| S1185 | LightSpy |
LightSpy performs an in-memory keychain query via |
| S1016 | MacMa | |
| S0279 | Proton |
| ID | Mitigation | Description |
|---|---|---|
| M1027 | Password Policies |
The password for the user's login keychain can be changed from the user's login password. This increases the complexity for an adversary because they need to know an additional password. |
| ID | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0396 | Detect Access to macOS Keychain for Credential Theft | AN1112 |
Detects suspicious access to macOS Keychain files and APIs. Observes processes invoking the 'security' utility or accessing Keychain databases directly, correlates these with abnormal parent process lineage or unexpected user context. Monitors attempts to dump, unlock, or read credential storage beyond normal application workflows. |