I found it difficult to search through the iCloud keychain for thousands of potentially breached domain names, like the Cit0day dump.
Turns out iCloud keychain is especially difficult to search through for website domains compared to the login or System keychains.
I made this script to open up the keychain app on macOS and search for any number of domains in a giant file, then print out the possibly affected domains.
It certainly isn't perfect. It's slow and makes many assumptions about the Keychain Access app (for macOS 10.15). Despite that, this script should help anyone trying to search through the Cit0day domain list (or similar breaches) automatically.
Just run the following, where ~/Downloads/Cit0day.sites.lst
is your file containing the domain name list
and keychain-search.sh
is the path to the below script file.
I got my domain list file from this gist: https://gist.github.com/kssi/a476cb0467fea59ca826ab380710a2b4
xargs keychain-search.sh < ~/Downloads/Cit0day.sites.lst | tee affected-domains.txt
The extra tee
at the end will helpfully save a copy of the script output to the file affected-domains.txt
for later use.
Always verify the scripts you run on your computer. I'm not liable for anything that happens as a result of using this script.
Thanks for your reply @kssi. That’s alright if there’s some extra malformed data, I’ll just have a few extra items to ignore in the output! 😄
I presume your gist filters out any malformed or duplicate lines?