Keychain

T1555.001

Sub-technique of T1555 Credentials from Password Stores.View on attack.mitre.org

About this technique

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/.

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.

Detection rules2

Rules on DetectionCode tagged with T1555.001.

Sigma1

RuleLevelLog source
Credentials from Password Stores - Keychainmediummacos / process_creation

Splunk1

RuleTypeRiskData source
MacOS Keychains DumpedTTPNULLOsquery Results

Groups1

Software11

Campaigns0

None recorded.

Procedure examples12

Groups1

Software11

Used byProcedure example
MalwareBeaverTail

BeaverTail has collected keys associated with macOS within `/Library/Keychains/login.keychain`.

MalwareCalisto

Calisto collects Keychain storage data and copies those passwords/tokens to a file.

MalwareCuckoo Stealer

Cuckoo Stealer can capture files from a targeted user's keychain directory.

ToolEmpire

Empire uses the command `/usr/bin/security dump-keychain -d` to read the keychain credential.

MalwareGlassWorm

GlassWorm has collected keys stored within `/Library/Keychains/login.keychain-db`.

MalwareGreen Lambert

Green Lambert can use Keychain Services API functions to find and collect passwords, such as `SecKeychainFindInternetPassword` and `SecKeychainItemCopyAttributesAndData`.

MalwareiKitten

iKitten collects the keychains on the system.

ToolLaZagne

LaZagne can obtain credentials from macOS Keychains.

View all 11 software examples

References5

  1. Empire Keychain Decrypt Open source
    Empire. (2018, March 8). Empire keychaindump_decrypt Module. Retrieved April 14, 2022.
  2. External to DA, the OS X Way Open source
    Alex Rymdeko-Harvey, Steve Borosh. (2016, May 14). External to DA, the OS X Way. Retrieved September 12, 2024.
  3. Keychain Decryption Passware Open source
    Yana Gourenko. (n.d.). A Deep Dive into Apple Keychain Decryption. Retrieved April 13, 2022.
  4. Keychain Services Apple Open source
    Apple. (n.d.). Keychain Services. Retrieved April 11, 2022.
  5. OSX Keychain Schaumann Open source
    Jan Schaumann. (2015, November 5). Using the OS X Keychain to store and retrieve passwords. Retrieved March 31, 2022.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.