Search K
Appearance
Appearance
Other ways to support HackTricks:
WhiteIntel is a dark-web fueled search engine that offers free functionalities to check if a company or its customers have been compromised by stealer malwares.
Their primary goal of WhiteIntel is to combat account takeovers and ransomware attacks resulting from information-stealing malware.
You can check their website and try their engine for free at:
~/Library/Keychains/login.keycahin-db
), which is used to store user-specific credentials like application passwords, internet passwords, user-generated certificates, network passwords, and user-generated public/private keys./Library/Keychains/System.keychain
), which stores system-wide credentials such as WiFi passwords, system root certificates, system private keys, and system application passwords.These files, while they do not have inherent protection and can be downloaded, are encrypted and require the user's plaintext password to be decrypted. A tool like Chainbreaker could be used for decryption.
Each entry in the keychain is governed by Access Control Lists (ACLs) which dictate who can perform various actions on the keychain entry, including:
The ACLs are further accompanied by a list of trusted applications that can perform these actions without prompting. This could be:
il
(no authorization required, everyone is trusted)Also the entry might contain the key ACLAuthorizationPartitionID
, which is use to identify the teamid, apple, and cdhash.
When a new entry is created using Keychain Access.app
, the following rules apply:
apple
.When an application creates an entry in the keychain, the rules are slightly different:
teamid:[teamID here]
.security
โ# Dump all metadata and decrypted secrets (a lot of pop-ups)
security dump-keychain -a -d
# Find generic password for the "Slack" account and print the secrets
security find-generic-password -a "Slack" -g
# Change the specified entrys PartitionID entry
security set-generic-password-parition-list -s "test service" -a "test acount" -S
โ
The keychain enumeration and dumping of secrets that won't generate a prompt can be done with the tool LockSmith
List and get info about each keychain entry:
SecItemCopyMatching
gives info about each entry and there are some attributes you can set when using it: kSecReturnData
: If true, it will try to decrypt the data (set to false to avoid potential pop-ups)kSecReturnRef
: Get also reference to keychain item (set to true in case later you see you can decrypt without pop-up)kSecReturnAttributes
: Get metadata about entrieskSecMatchLimit
: How many results to returnkSecClass
: What kind of keychain entryGet ACLs of each entry:
SecAccessCopyACLList
you can get the ACL for the keychain item, and it will return a list of ACLs (like ACLAuhtorizationExportClear
and the others previously mentioned) where each list has: Export the data:
SecKeychainItemCopyContent
gets the plaintextSecItemExport
exports the keys and certificates but might have to set passwords to export the content encryptedAnd these are the requirements to be able to export a secret without a prompt:
Nil
, or be part of the allowed list of apps in the authorization to access the secret info)โ
Therefore, if there is 1 application listed, you need to inject code in that application.
If apple is indicated in the partitionID, you could access it with osascript
so anything that is trusting all applications with apple in the partitionID. Python
could also be used for this.
WhiteIntel is a dark-web fueled search engine that offers free functionalities to check if a company or its customers have been compromised by stealer malwares.
Their primary goal of WhiteIntel is to combat account takeovers and ransomware attacks resulting from information-stealing malware.
You can check their website and try their engine for free at:
Other ways to support HackTricks: