need to recover keychain from apfs

Using TestDisk to undelete files
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
rakali
Posts: 3
Joined: 29 Dec 2019, 11:42

need to recover keychain from apfs

#1 Post by rakali »

long story short! i keep encrypted .dmg of my boot disk. i thought i had saved the password, but apparently. ow.

if i can recover the keychain from unencrypted apfs volume, i hope my password is inside. i know my keychain password of course

the ssd has already been overwritten with debian and several gigabytes.

i am dd’ing the disk now... any advice? will testdisk help with apfs?

or is it up to photorec? will it find mac keychain files?

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: need to recover keychain from apfs

#2 Post by cgrenier »

TestDisk will probably not work as too much data has been overwritten.

I don't know which format is used by mac keychain.
You can try with a known keychain file using fidentify or online via https://www.cgsecurity.org/photorec/

rakali
Posts: 3
Joined: 29 Dec 2019, 11:42

Re: need to recover keychain from apfs

#3 Post by rakali »

thanks for getting back to me.

fidentify says 'login.keychain-db: unknown'. Is it necessary to upload a keychain file? I would prefer not to.

from a little cursory searching, it looks like an encrypted sqlite database. i can read some of the schema in a hex editor, such as "CSSM_DL_DB_SCHEMA_INFO".

one fact that might help, when reading with hex editor, the two files i tested both start with '6B 79 63 68' which is 'kych'

can i use this information with photorec somehow?

thanks

rakali
Posts: 3
Joined: 29 Dec 2019, 11:42

Re: need to recover keychain from apfs

#4 Post by rakali »

I've tried recovery with a couple of other tools and they both have the same behaviour. The login.keychain file is all 0000. I am wondering if this is a security element at play here?

Locked