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.
@kssi Fair enough 😛 Not quite so broken I didn't get a useful scan, but enough that the next person should get a better one. I've updated to use your gist in the markdown file above.