KEEPASS

De Wiki Clusterlab.com.br
Revisão de 12h06min de 17 de outubro de 2019 por Damato (discussão | contribs) (→‎Code)
Ir para navegação Ir para pesquisar

Preparations

virtualenv -p $(which python3) kp
source kp/bin/activate
cd kp
touch kp.py
chmod +x kp.py
pip install pykeepass

Code

#!/usr/bin/env python

from pykeepass import PyKeePass

with PyKeePass('all-my-secrets.kdbx', password='StrongPass') as kp:
    for entry in kp.entries:
        grupo = str(entry.group).replace("\n", "")
        path = str(entry.path).replace("\n", "")
        title = str(entry.title).replace("\n", "")
        notes = str(entry.notes).replace("\n", "")
        username = str(entry.username).replace("\n", "")
        password = str(entry.password).replace("\n", "")
        print("\"" + grupo + "\";\"" + path + "\";\"" + title + "\";\"" + notes + "\";\"" + username + "\";\"" + password + "\"")