How do I get passwords out of keychain-2.db backup file?

I need to be able to get the passwords out of this file. I no longer have Access to this device or any other iPhone. It looks as if they are encrypted. I have opened the file in text edit. I have also opened it in an SQL program but they are showing as symbols.


Please help!!!!!


Thanks

iPhone 4S

Posted on Oct 20, 2012 4:49 PM

Reply
7 replies

Dec 9, 2013 1:01 AM in response to JRyan2003

i have found a solution and i am already using this and it works like awesome for me in mavericks. i googled and found this solution. here you go...


Instructions:


0) Save keychain.rb and click_allow.scpt in your home directory.


1) Enable full GUI scripting by going to the Universal Access System Preference Pane

and checking "Enable access for assistive devices"


2) Open the Terminal application and run the following command:

security dump-keychain -d login.keychain > keychain.txt


(If you have multiple keychains you should repeat this whole process once from step 2 onwards for

each one. You will have to change 'login.keychain' to 'foo.keychain' or somesuch.)


3) When you run the above command, the system will ask for permission to use your keychain. If you

have a separate keychain password/have paranoid settings on your keychain, you may need to enter

a password now. Otherwise, you will be presented with a dialog box asking you whether you want to

allow permission to access the first item in your keychain. You will be asked this once for every

item in your keychain (zzz). This is where the other file comes in:


4) Find the click_allow.scpt in your home directory using Finder, double click it. It will open in

the AppleScript editor. Click the run button. If all is well, the script will click the "Allow"

button for you lots of times until all of your keychain entries have been exported. Shouldn't

take more than a few minutes even for hundreds of entries.


5) When that finishes, go back to the Terminal window and run the following command:

ruby keychain.rb keychain.txt | sort > keychain.csv


6) If all is well, that command will finish very quickly without any message. If it spouts an error

at you, sorry, you'll have to fix the script, something's broken. Otherwise you should try opening

up keychain.csv in your favourite text editor (TextEdit? <shiver>) to make sure it contains a list

of keychain entries. Now is the time to search for passwords containing a comma (you may need regular

expressions to do this if you have a lot of keychain entries, since it's a comma-separated file)

and delete them to stop them hosing the 1password import. You'll have to enter these manually, hopefully

it isn't too many.


7) Fire up 1password and choose File>Import. You want to import keychain.csv as a "CSV or Delimited Text"

file. The process is fairly self-explanatory, make sure you select "comma" as the delimiter at the

appropriate point. You will have to tell it which columns correspond to which fields (this is pretty

obvious) and you should check that there are exactly five columns. If you're seeing more than five

columns, one of your values contains a rogue comma and you need to fix it manually before you import the

file or it won't work. The 5th column is optional - it's the last modified date for the keychain entry;

unfortunately 1password won't let you import this as the "modified date" for the password but I put

it in a notes field just in case since I often find it helpful to know when a password was set.


8) IMPORTANT: You now have 2 files on your hard disk that contain unencrypted passwords. You need to delete

these securely if you are concerned about the possibility that someone might get your passwords. You have

two options. The easy option is to use Finder to move them to Trash, and then Secure Empty Trash. If you

are one of these funny people who likes to use their Trash Can as a temporary storage location and don't

want to empty it, you can go back to the terminal and issue rm keychain.csv keychain.txt, and then fire up Disk

Utility and use the "Erase Free Space" command on the relevant hard disk to securely blank all the free

space on your drive (this may take some time). NB: If you have an SSD drive in your computer there will be

no Secure Empty Trash (only plain Empty Trash) and there will be no "Erase Free Space" in Disk Utility.

This is because some SSDs delete things much more permanently than traditional hard disks by default, so

these commands are redundant. Simply emptying the trash/rm-ing the file from the terminal will suffice in

this case.


download this two files


http://ul.to/aysx6x4g

http://ul.to/5g6ieukb

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I get passwords out of keychain-2.db backup file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.