Created
February 7, 2025 16:55
-
-
Save EvgeniGordeev/ba93887c08f997b182ca9998a53826be to your computer and use it in GitHub Desktop.
Reveal DataGrip passwords saved in Keychain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import subprocess | |
if __name__ == '__main__': | |
# located in project folder .idea/dataSources.xml | |
with open('dataSources.xml', 'r') as f: | |
data = f.read() | |
data_sources = sorted(re.findall(r".*data-source.*name=\"(.*?)\".*uuid=\"(.*?)\".*", data)) | |
for name, uuid in data_sources: | |
command = f'security find-generic-password -l "IntelliJ Platform DB — {uuid}" -w' | |
result = subprocess.run(command, shell=True, capture_output=True, text=True) | |
print(f"{name}={result.stdout.strip()}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment