Skip to content

Instantly share code, notes, and snippets.

@lukeross
Created February 18, 2024 16:25
Show Gist options
  • Save lukeross/6023658c54f88dee790ad3c65dbec1d9 to your computer and use it in GitHub Desktop.
Save lukeross/6023658c54f88dee790ad3c65dbec1d9 to your computer and use it in GitHub Desktop.
Extract stored passwords from libsecret
#!/usr/bin/env python
"""
# extract_secret_storage.py
Dumps out the contents of your libsecret storage (eg. gnome-keyring).
Requires:
- <https://www.python.org/>
- <https://pypi.org/project/SecretStorage/>
"""
import secretstorage
connection = secretstorage.dbus_init()
collection = secretstorage.get_default_collection(connection)
for item in collection.get_all_items():
print(repr([item.get_label(), item.get_secret(), item.get_attributes()]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment