Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import old AirPort passwords #13

Open
ballo opened this issue Dec 28, 2019 · 3 comments
Open

How to import old AirPort passwords #13

ballo opened this issue Dec 28, 2019 · 3 comments

Comments

@ballo
Copy link

ballo commented Dec 28, 2019

I didn't know where else to put this, but I thought I'd mention it in case anyone was having the same issue.

There are no built-in tools for decrypting the System keychain, but there is a python script called chainbreaker.py which can:
https://github.com/n0fate/chainbreaker

I did a simple edit of the script around line 848:


            cmd = '/usr/bin/security add-generic-password -a "%s"' % record[8].strip('\0')
            cmd += ' -l "%s"' % record[8].strip('\0')
            cmd += ' -s "%s"' % record[9].strip('\0')
            cmd += ' -D "%s"' % record[3].strip('\0')
            cmd += ' -w "%s"' % passwd.strip('\0')
            cmd += ' -T "/usr/libexec/airportd" "/Library/Keychains/System.keychain"'
            print 'cmd: %s' % cmd
 #           hexdump(cmd)
            print ''
            os.system(cmd)

This will only modify your System keychain if you run it as root. Be careful before you do, and make sure you're well enough versed in how the security program works, particularly the add-generic-password command. You can also copy and paste the individual commands for each wifi password you wish to migrate which is probably the safer option (although I had so many I just dumped it).

No applescript/automator magic needed.

@ballo
Copy link
Author

ballo commented Dec 28, 2019

To get the key in hex form, type this:
sudo hexdump -s 8 -n 24 -e '1/1 "%.2x"' /var/db/SystemKey && echo

@lifepillar
Copy link
Owner

Thanks for pointing out chainbreaker. My script is getting old and, as I have not used Apple Keychain for several years, I am losing interest in keeping my script up to date. It's good that there are other solutions out there!

@booboo299229292992
Copy link

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants