diff --git a/Windows/src/LaZagne/config/manageModules.py b/Windows/src/LaZagne/config/manageModules.py deleted file mode 100755 index e6ac9b90..00000000 --- a/Windows/src/LaZagne/config/manageModules.py +++ /dev/null @@ -1,94 +0,0 @@ -# browsers -from softwares.browsers.mozilla import Mozilla -from softwares.browsers.chrome import Chrome -from softwares.browsers.opera import Opera -from softwares.browsers.ie import IE -# windows -from softwares.windows.network import Network -from softwares.windows.dot_net import Dot_net -from softwares.windows.secrets import Secrets -# sysadmin -from softwares.sysadmin.filezilla import Filezilla -from softwares.sysadmin.cyberduck import Cyberduck -from softwares.sysadmin.puttycm import Puttycm -from softwares.sysadmin.winscp import WinSCP -from softwares.sysadmin.coreftp import CoreFTP -from softwares.sysadmin.ftpnavigator import FtpNavigator -from softwares.sysadmin.apachedirectorystudio import ApacheDirectoryStudio -from softwares.sysadmin.opensshforwindows import OpenSSHForWindows -# svn -from softwares.svn.tortoise import Tortoise -# git -from softwares.git.gitforwindows import GitForWindows -# maven -from softwares.maven.mavenrepositories import MavenRepositories -# chats -from softwares.chats.skype import Skype -from softwares.chats.pidgin import Pidgin -from softwares.chats.jitsi import Jitsi -# wifi -from softwares.wifi.wifi import Wifi -from softwares.wifi.wifipass import WifiPass -# mails -from softwares.mails.outlook import Outlook -# databases -from softwares.databases.sqldeveloper import SQLDeveloper -from softwares.databases.squirrel import Squirrel -from softwares.databases.dbvis import Dbvisualizer -# games -from softwares.games.roguestale import RoguesTale -from softwares.games.kalypsomedia import KalypsoMedia -from softwares.games.galconfusion import GalconFusion -from softwares.games.turba import Turba - -def get_categories(): - category = { - 'chats': {'help': 'Chat clients supported'}, - 'sysadmin': {'help': 'SCP/SSH/FTP/FTPS clients supported'}, - 'database': {'help': 'SQL clients supported'}, - 'svn': {'help': 'SVN clients supported'}, - 'git': {'help': 'GIT clients supported'}, - 'maven': {'help': 'Maven java build tool'}, - 'mails': {'help': 'Email clients supported'}, - 'wifi': {'help': 'Wifi'}, - 'browsers': {'help': 'Web browsers supported'}, - 'windows': {'help': 'Windows credentials (credential manager, etc.)'}, - 'games': {'help': 'Games etc.'} - } - return category - -def get_modules(): - moduleNames = [ - Dbvisualizer(), - Dot_net(), - Chrome(), - CoreFTP(), - Cyberduck(), - Filezilla(), - FtpNavigator(), - IE(), - GalconFusion(), - Jitsi(), - KalypsoMedia(), - Mozilla(), - Network(), - Opera(), - Outlook(), - Pidgin(), - Puttycm(), - RoguesTale(), - Tortoise(), - Secrets(), - Skype(), - SQLDeveloper(), - Squirrel(), - Turba(), - Wifi(), - WifiPass(), - WinSCP(), - GitForWindows(), - MavenRepositories(), - ApacheDirectoryStudio(), - OpenSSHForWindows() - ] - return moduleNames diff --git a/Windows/src/LaZagne/config/write_output.py b/Windows/src/LaZagne/config/write_output.py deleted file mode 100755 index 527f8cb6..00000000 --- a/Windows/src/LaZagne/config/write_output.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- from constant import constant from time import gmtime, strftime import os, getpass, socket import logging import json import tempfile from config.header import Header from colorama import init, Fore, Back, Style init() # init the colorama function # --------------------------- Functions used to write --------------------------- def write_header(): time = strftime("%Y-%m-%d %H:%M:%S", gmtime()) header = '''|====================================================================|\r\n | |\r\n | Credentsials discovery |\r\n | |\r\n | ! BANG BANG ! |\r\n | |\r\n |====================================================================|\r\n\r\n - Date: ''' + time + '''\n\r - Username: ''' + getpass.getuser() + ''' \r\n - Hostname: ''' + socket.gethostname() + ''' \r\n\r\n ------------------------------ Results ------------------------------\r\n\r\n''' open(constant.folder_name + os.sep + constant.file_name_results + '.txt',"a+b").write(header) def write_footer(): footer = '\n[+] %s passwords have been found.\r\n\r\n' % str(constant.nbPasswordFound) open(constant.folder_name + os.sep + constant.file_name_results + '.txt',"a+b").write(footer) def write_credentials(pwdFound, category, filePath): tmp = "############ %s passwords ############\r\n\r\n" % category for pwd in pwdFound: for p in pwd.keys(): tmp = str(tmp) + str(p) + ": " + str(pwd[p].encode('utf-8')) + "\r\n" tmp = str(tmp) + "\r\n" open(filePath,"a+b").write(tmp) def checks_write(values, category): if values: if "Passwords" not in constant.finalResults: constant.finalResults["Passwords"] = [] constant.finalResults["Passwords"].append([{"Category": category}, values]) # --------------------------- End of functions used to write --------------------------- # --------------------------- Output functions --------------------------- def print_footer(): footer = '\n[+] %s passwords have been found.\n' % str(constant.nbPasswordFound) if logging.getLogger().isEnabledFor(logging.INFO) == False: footer += 'For more information launch it again with the -v option\n' print footer # print output if passwords have been found def print_output(software_name, pwdFound, title1 = False): if pwdFound: # if the debug logging level is not apply => print the title if logging.getLogger().isEnabledFor(logging.INFO) == False: if not title1: Header().title(software_name) toWrite = [] password_category = False for pwd in pwdFound: # detect which kinds of password has been found lower_list = [s.lower() for s in pwd.keys()] password = [s for s in lower_list if "password" in s] if password: password_category = password else: key = [s for s in lower_list if "key" in s] # for the wifi if key: password_category = key else: hash = [s for s in lower_list if "hash" in s] if hash: password_category = hash # No password found if not password_category: print_debug("FAILED", "Password not found !!!") else: print_debug("OK", '%s found !!!' % password_category[0].title()) toWrite.append(pwd) # Store all passwords found on a table => for dictionary attack if master password set constant.nbPasswordFound += 1 try: constant.passwordFound.append(pwd[password_category[0]]) except: pass for p in pwd.keys(): try: print '%s: %s' % (p, pwd[p]) except Exception,e: print_debug('DEBUG', '{0}'.format(e)) print '%s: %s' % (p.encode('utf-8'), pwd[p].encode('utf-8')) print # write credentials into a text file checks_write(toWrite, software_name) else: logging.info("[!] No passwords found\n") def print_debug(error_level, message): # print when password is found if error_level == 'OK': print Fore.GREEN + message + Style.RESET_ALL # print when password is not found elif error_level == 'FAILED': print Style.BRIGHT + Fore.RED + message + Style.RESET_ALL # print messages depending of their criticism elif error_level == 'CRITICAL': logging.critical(Style.BRIGHT + Fore.RED + '[CRITICAL] %s\n' % message + Style.RESET_ALL) elif error_level == 'ERROR': logging.error(Style.BRIGHT + Fore.RED + '[ERROR] %s\n' % message + Style.RESET_ALL) elif error_level == 'WARNING': logging.warning(Fore.CYAN + '[WARNING] %s\n' % message + Style.RESET_ALL) elif error_level == 'DEBUG': logging.debug('[DEBUG] %s\n' % message) elif error_level == 'INFO': logging.info('%s\n' % message) else: logging.info('[%s] %s' % (error_level, message)) # --------------------------- End of output functions --------------------------- def parseJsonResult(jsonString): try: for json in jsonString: if json: print '\n\n########## User: %s ##########\n' % json['User'] if 'Passwords' not in json: print 'No passwords found for this user !' else: for all_passwords in json['Passwords']: # print '- Category: %s' % all_passwords[0]['Category'] print '------------------- %s -----------------' % all_passwords[0]['Category'] for password_by_category in all_passwords[1]: print '\nPassword found !!!' for dic in password_by_category.keys(): try: print '%s: %s' % (dic, password_by_category[dic]) except: print '%s: %s' % (dic, password_by_category[dic].encode('utf-8')) print except Exception as e: print_debug('ERROR', 'Error parsing the json results: %s' % e) print_debug('ERROR', 'json content: %s' % jsonString) def parseJsonResultToBuffer(jsonString): buffer = '' try: for json in jsonString: if json: buffer += '\r\n\r\n########## User: %s ##########\r\n' % json['User'] if 'Passwords' not in json: buffer += 'No passwords found for this user !' else: for all_passwords in json['Passwords']: # print '- Category: %s' % all_passwords[0]['Category'] buffer += '------------------- %s -----------------\r\n' % all_passwords[0]['Category'] for password_by_category in all_passwords[1]: buffer += '\r\nPassword found !!!\r\n' for dic in password_by_category.keys(): try: buffer += '%s: %s\r\n' % (dic, password_by_category[dic]) except: buffer += '%s: %s\r\n' % (dic, password_by_category[dic].encode('utf-8')) buffer += '\r\n' except Exception as e: print_debug('ERROR', 'Error parsing the json results: %s' % e) print_debug('ERROR', 'json content: %s' % jsonString) return buffer \ No newline at end of file diff --git a/Windows/src/LaZagne/laZagne.py b/Windows/src/LaZagne/laZagne.py index 3625c7a5..f5e68c9d 100755 --- a/Windows/src/LaZagne/laZagne.py +++ b/Windows/src/LaZagne/laZagne.py @@ -18,25 +18,24 @@ import getpass # Softwares that passwords can be retrieved without needed to be in the user environmment -from softwares.browsers.mozilla import Mozilla -from softwares.wifi.wifipass import WifiPass -from softwares.windows.secrets import Secrets -from softwares.chats.jitsi import Jitsi -from softwares.chats.pidgin import Pidgin -from softwares.databases.dbvis import Dbvisualizer -from softwares.databases.sqldeveloper import SQLDeveloper -from softwares.games.kalypsomedia import KalypsoMedia -from softwares.games.roguestale import RoguesTale -from softwares.sysadmin.filezilla import Filezilla - +from lazagne.softwares.browsers.mozilla import Mozilla +from lazagne.softwares.wifi.wifipass import WifiPass +from lazagne.softwares.windows.secrets import Secrets +from lazagne.softwares.chats.jitsi import Jitsi +from lazagne.softwares.chats.pidgin import Pidgin +from lazagne.softwares.databases.dbvis import Dbvisualizer +from lazagne.softwares.databases.sqldeveloper import SQLDeveloper +from lazagne.softwares.games.kalypsomedia import KalypsoMedia +from lazagne.softwares.games.roguestale import RoguesTale +from lazagne.softwares.sysadmin.filezilla import Filezilla # Configuration -from config.header import Header -from config.write_output import write_header, write_footer, print_footer, print_debug, parseJsonResult, parseJsonResultToBuffer -from config.constant import * -from config.manageModules import get_categories, get_modules -from config.changePrivileges import ListSids, GetUserName, create_proc_as_sid, rev2self, getsystem, isChildProcess, isProcessStillAlive -from config.get_system_priv import get_system_priv +from lazagne.config.header import Header +from lazagne.config.write_output import write_header, write_footer, print_footer, print_debug, parseJsonResult, parseJsonResultToBuffer, print_output +from lazagne.config.constant import * +from lazagne.config.manageModules import get_categories, get_modules +from lazagne.config.changePrivileges import ListSids, GetUserName, create_proc_as_sid, rev2self, getsystem, isChildProcess, isProcessStillAlive +from lazagne.config.get_system_priv import get_system_priv category = get_categories() moduleNames = get_modules() @@ -95,16 +94,20 @@ def verbosity(): def launch_module(b): ok = False + modulesToLaunch = [] # Launch only a specific module for i in args: if args[i] and i in b: - b[i].run() - ok = True - + modulesToLaunch.append(i) + # Launch all modules - if not ok: - for i in b: - b[i].run() + if not modulesToLaunch: + modulesToLaunch = b + + for i in modulesToLaunch: + Header().title_info(i.capitalize()) # print title + pwdFound = b[i].run(i.capitalize()) # run the module + print_output(i.capitalize(), pwdFound) # print the results def manage_advanced_options(): # File used for dictionary attacks @@ -398,7 +401,7 @@ def error(self, message): constant.finalResults = {} constant.finalResults['User'] = user_selected - # Try to retrieve all passwords from softwares which do not need to be in the user session + # Try to retrieve all passwords from lazagne.softwares which do not need to be in the user session constant.mozilla_software = 'Firefox' Mozilla(False).run() constant.mozilla_software = 'Thunderbird' diff --git a/Windows/src/LaZagne/config/__init__.py b/Windows/src/LaZagne/lazagne/__init__.py similarity index 100% rename from Windows/src/LaZagne/config/__init__.py rename to Windows/src/LaZagne/lazagne/__init__.py diff --git a/Windows/src/LaZagne/softwares/__init__.py b/Windows/src/LaZagne/lazagne/config/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/__init__.py rename to Windows/src/LaZagne/lazagne/config/__init__.py diff --git a/Windows/src/LaZagne/config/changePrivileges.py b/Windows/src/LaZagne/lazagne/config/changePrivileges.py similarity index 99% rename from Windows/src/LaZagne/config/changePrivileges.py rename to Windows/src/LaZagne/lazagne/config/changePrivileges.py index ed51ffbe..8848d1c2 100755 --- a/Windows/src/LaZagne/config/changePrivileges.py +++ b/Windows/src/LaZagne/lazagne/config/changePrivileges.py @@ -3,7 +3,7 @@ from ctypes import * import subprocess import psutil -from config.write_output import print_debug +from lazagne.config.write_output import print_debug LPVOID = c_void_p PVOID = LPVOID diff --git a/Windows/src/LaZagne/config/constant.py b/Windows/src/LaZagne/lazagne/config/constant.py similarity index 100% rename from Windows/src/LaZagne/config/constant.py rename to Windows/src/LaZagne/lazagne/config/constant.py diff --git a/Windows/src/LaZagne/config/dico.py b/Windows/src/LaZagne/lazagne/config/dico.py similarity index 100% rename from Windows/src/LaZagne/config/dico.py rename to Windows/src/LaZagne/lazagne/config/dico.py diff --git a/Windows/src/LaZagne/config/get_system_priv.py b/Windows/src/LaZagne/lazagne/config/get_system_priv.py similarity index 100% rename from Windows/src/LaZagne/config/get_system_priv.py rename to Windows/src/LaZagne/lazagne/config/get_system_priv.py diff --git a/Windows/src/LaZagne/config/header.py b/Windows/src/LaZagne/lazagne/config/header.py similarity index 100% rename from Windows/src/LaZagne/config/header.py rename to Windows/src/LaZagne/lazagne/config/header.py diff --git a/Windows/src/LaZagne/lazagne/config/manageModules.py b/Windows/src/LaZagne/lazagne/config/manageModules.py new file mode 100755 index 00000000..559503c9 --- /dev/null +++ b/Windows/src/LaZagne/lazagne/config/manageModules.py @@ -0,0 +1,94 @@ +# browsers +from lazagne.softwares.browsers.mozilla import Mozilla +from lazagne.softwares.browsers.chrome import Chrome +from lazagne.softwares.browsers.opera import Opera +from lazagne.softwares.browsers.ie import IE +# windows +from lazagne.softwares.windows.network import Network +from lazagne.softwares.windows.dot_net import Dot_net +from lazagne.softwares.windows.secrets import Secrets +# sysadmin +from lazagne.softwares.sysadmin.filezilla import Filezilla +from lazagne.softwares.sysadmin.cyberduck import Cyberduck +from lazagne.softwares.sysadmin.puttycm import Puttycm +from lazagne.softwares.sysadmin.winscp import WinSCP +from lazagne.softwares.sysadmin.coreftp import CoreFTP +from lazagne.softwares.sysadmin.ftpnavigator import FtpNavigator +from lazagne.softwares.sysadmin.apachedirectorystudio import ApacheDirectoryStudio +from lazagne.softwares.sysadmin.opensshforwindows import OpenSSHForWindows +# svn +from lazagne.softwares.svn.tortoise import Tortoise +# git +from lazagne.softwares.git.gitforwindows import GitForWindows +# maven +from lazagne.softwares.maven.mavenrepositories import MavenRepositories +# chats +from lazagne.softwares.chats.skype import Skype +from lazagne.softwares.chats.pidgin import Pidgin +from lazagne.softwares.chats.jitsi import Jitsi +# wifi +from lazagne.softwares.wifi.wifi import Wifi +from lazagne.softwares.wifi.wifipass import WifiPass +# mails +from lazagne.softwares.mails.outlook import Outlook +# databases +from lazagne.softwares.databases.sqldeveloper import SQLDeveloper +from lazagne.softwares.databases.squirrel import Squirrel +from lazagne.softwares.databases.dbvis import Dbvisualizer +# games +from lazagne.softwares.games.roguestale import RoguesTale +from lazagne.softwares.games.kalypsomedia import KalypsoMedia +from lazagne.softwares.games.galconfusion import GalconFusion +from lazagne.softwares.games.turba import Turba + +def get_categories(): + category = { + 'chats': {'help': 'Chat clients supported'}, + 'sysadmin': {'help': 'SCP/SSH/FTP/FTPS clients supported'}, + 'database': {'help': 'SQL clients supported'}, + 'svn': {'help': 'SVN clients supported'}, + 'git': {'help': 'GIT clients supported'}, + 'maven': {'help': 'Maven java build tool'}, + 'mails': {'help': 'Email clients supported'}, + 'wifi': {'help': 'Wifi'}, + 'browsers': {'help': 'Web browsers supported'}, + 'windows': {'help': 'Windows credentials (credential manager, etc.)'}, + 'games': {'help': 'Games etc.'} + } + return category + +def get_modules(): + moduleNames = [ + Dbvisualizer(), + Dot_net(), + Chrome(), + CoreFTP(), + Cyberduck(), + Filezilla(), + FtpNavigator(), + IE(), + GalconFusion(), + Jitsi(), + KalypsoMedia(), + Mozilla(), + Network(), + Opera(), + Outlook(), + Pidgin(), + Puttycm(), + RoguesTale(), + Tortoise(), + Secrets(), + Skype(), + SQLDeveloper(), + Squirrel(), + Turba(), + Wifi(), + WifiPass(), + WinSCP(), + GitForWindows(), + MavenRepositories(), + ApacheDirectoryStudio(), + OpenSSHForWindows() + ] + return moduleNames diff --git a/Windows/src/LaZagne/config/moduleInfo.py b/Windows/src/LaZagne/lazagne/config/moduleInfo.py similarity index 100% rename from Windows/src/LaZagne/config/moduleInfo.py rename to Windows/src/LaZagne/lazagne/config/moduleInfo.py diff --git a/Windows/src/LaZagne/lazagne/config/write_output.py b/Windows/src/LaZagne/lazagne/config/write_output.py new file mode 100755 index 00000000..30cd117a --- /dev/null +++ b/Windows/src/LaZagne/lazagne/config/write_output.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- from constant import constant from time import gmtime, strftime import os, getpass, socket import logging import json import tempfile from lazagne.config.header import Header from colorama import init, Fore, Back, Style init() # init the colorama function # --------------------------- Functions used to write --------------------------- def write_header(): time = strftime("%Y-%m-%d %H:%M:%S", gmtime()) header = '''|====================================================================|\r\n | |\r\n | Credentsials discovery |\r\n | |\r\n | ! BANG BANG ! |\r\n | |\r\n |====================================================================|\r\n\r\n - Date: ''' + time + '''\n\r - Username: ''' + getpass.getuser() + ''' \r\n - Hostname: ''' + socket.gethostname() + ''' \r\n\r\n ------------------------------ Results ------------------------------\r\n\r\n''' open(constant.folder_name + os.sep + constant.file_name_results + '.txt',"a+b").write(header) def write_footer(): footer = '\n[+] %s passwords have been found.\r\n\r\n' % str(constant.nbPasswordFound) open(constant.folder_name + os.sep + constant.file_name_results + '.txt',"a+b").write(footer) def write_credentials(pwdFound, category, filePath): tmp = "############ %s passwords ############\r\n\r\n" % category for pwd in pwdFound: for p in pwd.keys(): tmp = str(tmp) + str(p) + ": " + str(pwd[p].encode('utf-8')) + "\r\n" tmp = str(tmp) + "\r\n" open(filePath,"a+b").write(tmp) def checks_write(values, category): if values: if "Passwords" not in constant.finalResults: constant.finalResults["Passwords"] = [] constant.finalResults["Passwords"].append([{"Category": category}, values]) # --------------------------- End of functions used to write --------------------------- # --------------------------- Output functions --------------------------- def print_footer(): footer = '\n[+] %s passwords have been found.\n' % str(constant.nbPasswordFound) if logging.getLogger().isEnabledFor(logging.INFO) == False: footer += 'For more information launch it again with the -v option\n' print footer # print output if passwords have been found def print_output(software_name, pwdFound, title1 = False): if pwdFound: # if the debug logging level is not apply => print the title if logging.getLogger().isEnabledFor(logging.INFO) == False: if not title1: Header().title(software_name) toWrite = [] password_category = False for pwd in pwdFound: # detect which kinds of password has been found lower_list = [s.lower() for s in pwd.keys()] password = [s for s in lower_list if "password" in s] if password: password_category = password else: key = [s for s in lower_list if "key" in s] # for the wifi if key: password_category = key else: hash = [s for s in lower_list if "hash" in s] if hash: password_category = hash # No password found if not password_category: print_debug("FAILED", "Password not found !!!") else: print_debug("OK", '%s found !!!' % password_category[0].title()) toWrite.append(pwd) # Store all passwords found on a table => for dictionary attack if master password set constant.nbPasswordFound += 1 try: constant.passwordFound.append(pwd[password_category[0]]) except: pass for p in pwd.keys(): try: print '%s: %s' % (p, pwd[p]) except Exception,e: print_debug('DEBUG', '{0}'.format(e)) print '%s: %s' % (p.encode('utf-8'), pwd[p].encode('utf-8')) print # write credentials into a text file checks_write(toWrite, software_name) else: logging.info("[!] No passwords found\n") def print_debug(error_level, message): # print when password is found if error_level == 'OK': print Fore.GREEN + message + Style.RESET_ALL # print when password is not found elif error_level == 'FAILED': print Style.BRIGHT + Fore.RED + message + Style.RESET_ALL # print messages depending of their criticism elif error_level == 'CRITICAL': logging.critical(Style.BRIGHT + Fore.RED + '[CRITICAL] %s\n' % message + Style.RESET_ALL) elif error_level == 'ERROR': logging.error(Style.BRIGHT + Fore.RED + '[ERROR] %s\n' % message + Style.RESET_ALL) elif error_level == 'WARNING': logging.warning(Fore.CYAN + '[WARNING] %s\n' % message + Style.RESET_ALL) elif error_level == 'DEBUG': logging.debug('[DEBUG] %s\n' % message) elif error_level == 'INFO': logging.info('%s\n' % message) else: logging.info('[%s] %s' % (error_level, message)) # --------------------------- End of output functions --------------------------- def parseJsonResult(jsonString): try: for json in jsonString: if json: print '\n\n########## User: %s ##########\n' % json['User'] if 'Passwords' not in json: print 'No passwords found for this user !' else: for all_passwords in json['Passwords']: # print '- Category: %s' % all_passwords[0]['Category'] print '------------------- %s -----------------' % all_passwords[0]['Category'] for password_by_category in all_passwords[1]: print '\nPassword found !!!' for dic in password_by_category.keys(): try: print '%s: %s' % (dic, password_by_category[dic]) except: print '%s: %s' % (dic, password_by_category[dic].encode('utf-8')) print except Exception as e: print_debug('ERROR', 'Error parsing the json results: %s' % e) print_debug('ERROR', 'json content: %s' % jsonString) def parseJsonResultToBuffer(jsonString): buffer = '' try: for json in jsonString: if json: buffer += '\r\n\r\n########## User: %s ##########\r\n' % json['User'] if 'Passwords' not in json: buffer += 'No passwords found for this user !' else: for all_passwords in json['Passwords']: # print '- Category: %s' % all_passwords[0]['Category'] buffer += '------------------- %s -----------------\r\n' % all_passwords[0]['Category'] for password_by_category in all_passwords[1]: buffer += '\r\nPassword found !!!\r\n' for dic in password_by_category.keys(): try: buffer += '%s: %s\r\n' % (dic, password_by_category[dic]) except: buffer += '%s: %s\r\n' % (dic, password_by_category[dic].encode('utf-8')) buffer += '\r\n' except Exception as e: print_debug('ERROR', 'Error parsing the json results: %s' % e) print_debug('ERROR', 'json content: %s' % jsonString) return buffer \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/browsers/__init__.py b/Windows/src/LaZagne/lazagne/softwares/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/browsers/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/__init__.py diff --git a/Windows/src/LaZagne/softwares/chats/__init__.py b/Windows/src/LaZagne/lazagne/softwares/browsers/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/chats/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/browsers/__init__.py diff --git a/Windows/src/LaZagne/softwares/browsers/chrome.py b/Windows/src/LaZagne/lazagne/softwares/browsers/chrome.py similarity index 88% rename from Windows/src/LaZagne/softwares/browsers/chrome.py rename to Windows/src/LaZagne/lazagne/softwares/browsers/chrome.py index b27030c0..b5562788 100755 --- a/Windows/src/LaZagne/softwares/browsers/chrome.py +++ b/Windows/src/LaZagne/lazagne/softwares/browsers/chrome.py @@ -2,22 +2,18 @@ import shutil import win32crypt import sys, os, platform -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo import getpass class Chrome(ModuleInfo): def __init__(self): options = {'command': '-c', 'action': 'store_true', 'dest': 'chrome', 'help': 'chrome'} - ModuleInfo.__init__(self, 'chrome', 'browsers', options) + ModuleInfo.__init__(self, 'chroaaaame', 'browsers', options) # main function - def run(self): - # print title - Header().title_info('Chrome') - + def run(self, software_name = None): database_path = '' homedrive = '' homepath = '' @@ -87,10 +83,9 @@ def run(self): values['Password'] = password pwdFound.append(values) - # print the results - print_output("Chrome", pwdFound) - conn.close() if database_path.endswith('tmp_db'): os.remove(database_path) + + return pwdFound \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/browsers/ie.py b/Windows/src/LaZagne/lazagne/softwares/browsers/ie.py similarity index 97% rename from Windows/src/LaZagne/softwares/browsers/ie.py rename to Windows/src/LaZagne/lazagne/softwares/browsers/ie.py index 0e16623a..c5b53b89 100755 --- a/Windows/src/LaZagne/softwares/browsers/ie.py +++ b/Windows/src/LaZagne/lazagne/softwares/browsers/ie.py @@ -2,10 +2,9 @@ import struct, hashlib, os, base64 from ctypes import * from ctypes.wintypes import DWORD -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo memcpy = cdll.msvcrt.memcpy LocalFree = windll.kernel32.LocalFree @@ -291,10 +290,7 @@ def decipher_password(self, cipher_text, u): except Exception,e: print_debug('DEBUG', '{0}'.format(e)) - def run(self, historic=''): - # print title - Header().title_info('Internet Explorer') - + def run(self, historic=''): # write the binary file try: self.write_binary_file() @@ -341,9 +337,6 @@ def run(self, historic=''): self.decipher_password(cipher_text, h[0]) break - # print the results - print_output("Internet Explorer", pwdFound) - # manage errors if nb_site == 0: print_debug('INFO', 'No credentials stored in the IE browser.') @@ -356,4 +349,6 @@ def run(self, historic=''): # Clean up if os.path.exists(dll_name): - os.remove(dll_name) \ No newline at end of file + os.remove(dll_name) + + return pwdFound \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/browsers/mozilla.py b/Windows/src/LaZagne/lazagne/softwares/browsers/mozilla.py similarity index 97% rename from Windows/src/LaZagne/softwares/browsers/mozilla.py rename to Windows/src/LaZagne/lazagne/softwares/browsers/mozilla.py index c79b9851..ca34a432 100755 --- a/Windows/src/LaZagne/softwares/browsers/mozilla.py +++ b/Windows/src/LaZagne/lazagne/softwares/browsers/mozilla.py @@ -9,7 +9,7 @@ import sqlite3 import json import shutil -from config.dico import get_dico +from lazagne.config.dico import get_dico from itertools import product #https://pypi.python.org/pypi/pyasn1/ from pyasn1.codec.der import decoder @@ -19,10 +19,9 @@ import hmac from Crypto.Util.number import long_to_bytes from Crypto.Cipher import DES3 -from config.header import Header -from config.constant import * -from config.write_output import print_debug, print_output -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo # Database classes database_find = False @@ -430,18 +429,16 @@ def found_masterpassword(self): # ------------------------------ End of Master Password Functions ------------------------------ # main function - def run(self): + def run(self, software_name = None): global database_find database_find = False self.manage_advanced_options() - software_name = constant.mozilla_software + if constant.mozilla_software: + software_name = constant.mozilla_software specific_path = constant.specific_path - # print the title - Header().title_info(software_name) - # get the installation path path = self.get_path(software_name) if not path: @@ -535,6 +532,4 @@ def run(self): if len(values): pwdFound.append(values) - # print the results - print_output(software_name, pwdFound) - + return pwdFound \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/browsers/opera.py b/Windows/src/LaZagne/lazagne/softwares/browsers/opera.py similarity index 92% rename from Windows/src/LaZagne/softwares/browsers/opera.py rename to Windows/src/LaZagne/lazagne/softwares/browsers/opera.py index 9da658fe..7e607122 100755 --- a/Windows/src/LaZagne/softwares/browsers/opera.py +++ b/Windows/src/LaZagne/lazagne/softwares/browsers/opera.py @@ -2,10 +2,9 @@ from Crypto.Cipher import DES3 from ConfigParser import RawConfigParser import sqlite3, win32crypt -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo CIPHERED_FILE = '' @@ -14,10 +13,7 @@ def __init__(self): options = {'command': '-o', 'action': 'store_true', 'dest': 'opera', 'help': 'opera'} ModuleInfo.__init__(self, 'opera', 'browsers', options) - def run(self): - # print title - Header().title_info('Opera') - + def run(self, software_name = None): # retrieve opera folder path = self.get_path() @@ -44,12 +40,12 @@ def run(self): passwords = self.decipher_old_version(path) if passwords: - self.parse_results(passwords) + return self.parse_results(passwords) else: print_debug('INFO', 'The wand.dat seems to be empty') # new versions else: - passwords = self.decipher_new_version(path) + return self.decipher_new_version(path) def get_path(self): global CIPHERED_FILE @@ -152,9 +148,8 @@ def decipher_new_version(self, path): values['Username'] = result[1] values['Password'] = password pwdFound.append(values) - - # print the results - print_output("Opera", pwdFound) + + return pwdFound else: print_debug('INFO', 'No passwords stored\nThe database Login Data is not present.') @@ -213,6 +208,5 @@ def parse_results(self, passwords): values['URL'] = tmp_url pwdFound.append(values) - # print the results - print_output("Opera", pwdFound) + return pwdFound diff --git a/Windows/src/LaZagne/softwares/databases/__init__.py b/Windows/src/LaZagne/lazagne/softwares/chats/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/databases/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/chats/__init__.py diff --git a/Windows/src/LaZagne/softwares/chats/jitsi.py b/Windows/src/LaZagne/lazagne/softwares/chats/jitsi.py similarity index 87% rename from Windows/src/LaZagne/softwares/chats/jitsi.py rename to Windows/src/LaZagne/lazagne/softwares/chats/jitsi.py index febb7922..3b1d8b8a 100755 --- a/Windows/src/LaZagne/softwares/chats/jitsi.py +++ b/Windows/src/LaZagne/lazagne/softwares/chats/jitsi.py @@ -2,10 +2,9 @@ from base64 import b64decode import binascii, array from Crypto.Cipher import AES -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo # From https://github.com/mitsuhiko/python-pbkdf2 from pbkdf2 import pbkdf2_bin @@ -83,9 +82,8 @@ def get_info(self, file_properties): if len(values) != 0: pwdFound.append(values) - # print the results - print_output('Jitsi', pwdFound) f.close() + return pwdFound def decrypt_password(self, encrypted_pass): salt = self.get_salt() @@ -106,10 +104,7 @@ def decrypt_password(self, encrypted_pass): return plaintext.strip() # main function - def run(self): - # print title - Header().title_info('Jitsi') - + def run(self, software_name = None): file_properties = self.get_path() if file_properties == 'Error': print_debug('ERROR', 'The APPDATA environment variable is not defined') @@ -118,5 +113,5 @@ def run(self): print_debug('INFO', 'Jitsi not installed.') else: - self.get_info(file_properties) + return self.get_info(file_properties) diff --git a/Windows/src/LaZagne/softwares/chats/pbkdf2.py b/Windows/src/LaZagne/lazagne/softwares/chats/pbkdf2.py similarity index 100% rename from Windows/src/LaZagne/softwares/chats/pbkdf2.py rename to Windows/src/LaZagne/lazagne/softwares/chats/pbkdf2.py diff --git a/Windows/src/LaZagne/softwares/chats/pidgin.py b/Windows/src/LaZagne/lazagne/softwares/chats/pidgin.py similarity index 79% rename from Windows/src/LaZagne/softwares/chats/pidgin.py rename to Windows/src/LaZagne/lazagne/softwares/chats/pidgin.py index 42690d33..73a1a207 100755 --- a/Windows/src/LaZagne/softwares/chats/pidgin.py +++ b/Windows/src/LaZagne/lazagne/softwares/chats/pidgin.py @@ -1,19 +1,15 @@ import xml.etree.cElementTree as ET import os -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class Pidgin(ModuleInfo): def __init__(self): options = {'command': '-p', 'action': 'store_true', 'dest': 'pidgin', 'help': 'pidgin'} ModuleInfo.__init__(self, 'pidgin', 'chats', options) - def run(self): - # print title - Header().title_info('Pidgin') - + def run(self, software_name = None): if constant.appdata: directory = '%s\.purple' % constant.appdata path = os.path.join(directory, 'accounts.xml') @@ -48,9 +44,8 @@ def run(self): if noPass == False: pwdFound.append(values) - - # print the results - print_output("Pidgin", pwdFound) + + return pwdFound else: print_debug('INFO', 'Pidgin not installed.') diff --git a/Windows/src/LaZagne/softwares/chats/skype.py b/Windows/src/LaZagne/lazagne/softwares/chats/skype.py similarity index 89% rename from Windows/src/LaZagne/softwares/chats/skype.py rename to Windows/src/LaZagne/lazagne/softwares/chats/skype.py index 90da9d1d..ea55f457 100755 --- a/Windows/src/LaZagne/softwares/chats/skype.py +++ b/Windows/src/LaZagne/lazagne/softwares/chats/skype.py @@ -3,11 +3,10 @@ import win32con, win32api, win32crypt import base64, hashlib, os import binascii, struct -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo -from config.dico import get_dico +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo +from lazagne.config.dico import get_dico class Skype(ModuleInfo): def __init__(self): @@ -41,7 +40,7 @@ def get_regkey(self): print_debug('DEBUG', '{0}'.format(e)) return 'failed' - # get hash from configuration file + # get hash from lazagne.configuration file def get_hash_credential(self, xml_file): tree = ET.ElementTree(file=xml_file) encrypted_hash = tree.find('Lib/Account/Credentials3') @@ -105,10 +104,7 @@ def dictionary_attack(self, login, md5): return False # main function - def run(self): - # print title - Header().title_info('Skype') - + def run(self, software_name = None): if 'APPDATA' in os.environ: directory = os.environ['APPDATA'] + '\Skype' @@ -144,8 +140,8 @@ def run(self): pwdFound.append(values) except Exception,e: print_debug('DEBUG', '{0}'.format(e)) - # print the results - print_output("Skype", pwdFound) + + return pwdFound else: print_debug('INFO', 'Skype not installed.') else: diff --git a/Windows/src/LaZagne/softwares/games/__init__.py b/Windows/src/LaZagne/lazagne/softwares/databases/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/games/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/databases/__init__.py diff --git a/Windows/src/LaZagne/softwares/databases/dbvis.py b/Windows/src/LaZagne/lazagne/softwares/databases/dbvis.py similarity index 89% rename from Windows/src/LaZagne/softwares/databases/dbvis.py rename to Windows/src/LaZagne/lazagne/softwares/databases/dbvis.py index e75566cc..7fa23253 100755 --- a/Windows/src/LaZagne/softwares/databases/dbvis.py +++ b/Windows/src/LaZagne/lazagne/softwares/databases/dbvis.py @@ -3,11 +3,9 @@ import binascii, array, hashlib import base64, re, os import xml.etree.cElementTree as ET - -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo class Dbvisualizer(ModuleInfo): def __init__(self): @@ -96,8 +94,7 @@ def get_infos(self, path, passphrase, salt): if len(values) > 0: pwdFound.append(values) - # print the results - print_output("DbVisualizer", pwdFound) + return pwdFound def get_mainPath(self): path = '' @@ -114,10 +111,7 @@ def get_mainPath(self): return 'DBVIS_NOT_EXISTS' - def run(self): - # print title - Header().title_info('Dbvisualizer') - + def run(self, software_name = None): mainPath = self.get_mainPath() if mainPath == 'DBVIS_NOT_EXISTS': @@ -130,5 +124,5 @@ def run(self): passphrase = self.get_passphrase() salt = self.get_salt() - self.get_infos(mainPath, passphrase, salt) + return self.get_infos(mainPath, passphrase, salt) diff --git a/Windows/src/LaZagne/softwares/databases/sqldeveloper.py b/Windows/src/LaZagne/lazagne/softwares/databases/sqldeveloper.py similarity index 92% rename from Windows/src/LaZagne/softwares/databases/sqldeveloper.py rename to Windows/src/LaZagne/lazagne/softwares/databases/sqldeveloper.py index 1f9228f1..37b1b501 100755 --- a/Windows/src/LaZagne/softwares/databases/sqldeveloper.py +++ b/Windows/src/LaZagne/lazagne/softwares/databases/sqldeveloper.py @@ -2,10 +2,9 @@ from Crypto.Cipher import DES import hashlib, re, os import xml.etree.cElementTree as ET -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class SQLDeveloper(ModuleInfo): def __init__(self): @@ -125,15 +124,12 @@ def get_infos(self, path, passphrase, salt): # password found pwdFound.append(values) - # print the results - print_output("SQL Developer", pwdFound) + return pwdFound else: print_debug('ERROR', 'The xml file connections.xml containing the passwords has not been found.') - def run(self): - # print title - Header().title_info('SQL Developer') - + def run(self, software_name = None): + mainPath = self.get_mainPath() if mainPath == 'Error': print_debug('ERROR', 'The APPDATA environment variable is not defined.') @@ -154,4 +150,4 @@ def run(self): else: salt = self.get_salt() - self.get_infos(mainPath, passphrase, salt) + return self.get_infos(mainPath, passphrase, salt) diff --git a/Windows/src/LaZagne/softwares/databases/squirrel.py b/Windows/src/LaZagne/lazagne/softwares/databases/squirrel.py similarity index 78% rename from Windows/src/LaZagne/softwares/databases/squirrel.py rename to Windows/src/LaZagne/lazagne/softwares/databases/squirrel.py index 4f7bed7e..25b6c03b 100755 --- a/Windows/src/LaZagne/softwares/databases/squirrel.py +++ b/Windows/src/LaZagne/lazagne/softwares/databases/squirrel.py @@ -1,9 +1,8 @@ import xml.etree.cElementTree as ET import os -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo class Squirrel(ModuleInfo): def __init__(self): @@ -24,7 +23,6 @@ def get_path(self): return path else: return 'Not_Found' - def parse_xml(self, xml_file): tree = ET.ElementTree(file=xml_file) @@ -47,14 +45,10 @@ def parse_xml(self, xml_file): if len(values): pwdFound.append(values) - # print the results - print_output("Squirrel", pwdFound) + return pwdFound # Main function - def run(self): - # print title - Header().title_info('Squirrel') - + def run(self, software_name = None): path = self.get_path() if path == 'Not_Found': print_debug('INFO', 'Squirrel not installed') @@ -63,7 +57,7 @@ def run(self): else: path += os.sep + 'SQLAliases23.xml' if os.path.exists(path): - self.parse_xml(path) + return self.parse_xml(path) else: print_debug('WARNING', 'xml fil SQLAliases23.xml containing passwords has not be found') \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/git/__init__.py b/Windows/src/LaZagne/lazagne/softwares/games/__init__.py old mode 100644 new mode 100755 similarity index 100% rename from Windows/src/LaZagne/softwares/git/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/games/__init__.py diff --git a/Windows/src/LaZagne/softwares/games/galconfusion.py b/Windows/src/LaZagne/lazagne/softwares/games/galconfusion.py similarity index 84% rename from Windows/src/LaZagne/softwares/games/galconfusion.py rename to Windows/src/LaZagne/lazagne/softwares/games/galconfusion.py index d1264c38..c2df9bec 100755 --- a/Windows/src/LaZagne/softwares/games/galconfusion.py +++ b/Windows/src/LaZagne/lazagne/softwares/games/galconfusion.py @@ -1,18 +1,15 @@ import os from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class GalconFusion(ModuleInfo): def __init__(self): options = {'command': '-g', 'action': 'store_true', 'dest': 'galconfusion', 'help': 'galconfusion'} ModuleInfo.__init__(self, 'galconfusion', 'games', options) - def run(self): - # print title - Header().title_info('Galcon Fusion') + def run(self, software_name = None): creds = [] # Find the location of steam - to make it easier we're going to use a try block @@ -54,6 +51,6 @@ def run(self): values['Password'] = data[0x24:0x43] creds.append(values) - print_output("Galcon Fusion", creds) + return creds diff --git a/Windows/src/LaZagne/softwares/games/kalypsomedia.py b/Windows/src/LaZagne/lazagne/softwares/games/kalypsomedia.py similarity index 81% rename from Windows/src/LaZagne/softwares/games/kalypsomedia.py rename to Windows/src/LaZagne/lazagne/softwares/games/kalypsomedia.py index 36e88cde..65046010 100755 --- a/Windows/src/LaZagne/softwares/games/kalypsomedia.py +++ b/Windows/src/LaZagne/lazagne/softwares/games/kalypsomedia.py @@ -1,8 +1,7 @@ import os, re, base64 -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo import ConfigParser class KalypsoMedia(ModuleInfo): @@ -15,9 +14,7 @@ def __init__(self): def xorstring(self, s, k): return "".join(chr(ord(x) ^ ord(y)) for x, y in zip(s,k)) - def run(self): - # print title - Header().title_info('Kalypso Media Launcher') + def run(self, software_name = None): creds = [] key = 'lwSDFSG34WE8znDSmvtwGSDF438nvtzVnt4IUv89' @@ -47,7 +44,7 @@ def run(self): creds.append(values) - print_output("Kalypso Media Launcher", creds) + return creds diff --git a/Windows/src/LaZagne/softwares/games/roguestale.py b/Windows/src/LaZagne/lazagne/softwares/games/roguestale.py similarity index 84% rename from Windows/src/LaZagne/softwares/games/roguestale.py rename to Windows/src/LaZagne/lazagne/softwares/games/roguestale.py index 33621fd1..7593bca8 100755 --- a/Windows/src/LaZagne/softwares/games/roguestale.py +++ b/Windows/src/LaZagne/lazagne/softwares/games/roguestale.py @@ -1,18 +1,15 @@ import xml.etree.cElementTree as ET import os, re -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class RoguesTale(ModuleInfo): def __init__(self): options = {'command': '-r', 'action': 'store_true', 'dest': 'roguestale', 'help': 'Extract Rogue\'s Tale SHA1 password hashes.'} ModuleInfo.__init__(self, 'roguestale', 'games', options) - def run(self): - # print title - Header().title_info('Rogue\'s Tale') + def run(self, software_name = None): creds = [] if constant.userprofile: @@ -49,6 +46,6 @@ def run(self): values['Hash'] = root.attrib['password'] creds.append(values) - print_output("Rogue's Tale", creds) + return creds diff --git a/Windows/src/LaZagne/softwares/games/turba.py b/Windows/src/LaZagne/lazagne/softwares/games/turba.py similarity index 84% rename from Windows/src/LaZagne/softwares/games/turba.py rename to Windows/src/LaZagne/lazagne/softwares/games/turba.py index 60fa150c..4538e3a2 100755 --- a/Windows/src/LaZagne/softwares/games/turba.py +++ b/Windows/src/LaZagne/lazagne/softwares/games/turba.py @@ -1,18 +1,16 @@ import os from _winreg import HKEY_CURRENT_USER, OpenKey, QueryValueEx -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.header import Header +from lazagne.config.moduleInfo import ModuleInfo class Turba(ModuleInfo): def __init__(self): options = {'command': '-t', 'action': 'store_true', 'dest': 'turba', 'help': 'turba'} ModuleInfo.__init__(self, 'turba', 'games', options) - def run(self): - # print title - Header().title_info('Turba') + def run(self, software_name = None): creds = [] # Find the location of steam - to make it easier we're going to use a try block @@ -53,6 +51,6 @@ def run(self): values['Password'] = chunk[1] creds.append(values) - print_output("Turba", creds) + return creds diff --git a/Windows/src/LaZagne/softwares/mails/__init__.py b/Windows/src/LaZagne/lazagne/softwares/git/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/mails/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/git/__init__.py diff --git a/Windows/src/LaZagne/softwares/git/gitforwindows.py b/Windows/src/LaZagne/lazagne/softwares/git/gitforwindows.py old mode 100644 new mode 100755 similarity index 86% rename from Windows/src/LaZagne/softwares/git/gitforwindows.py rename to Windows/src/LaZagne/lazagne/softwares/git/gitforwindows.py index c0401ae1..479b2f5a --- a/Windows/src/LaZagne/softwares/git/gitforwindows.py +++ b/Windows/src/LaZagne/lazagne/softwares/git/gitforwindows.py @@ -1,8 +1,7 @@ import os -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo from urlparse import urlparse class GitForWindows(ModuleInfo): @@ -34,14 +33,11 @@ def extract_credentials(self, location): return pwd_found - def run(self): + def run(self, software_name = None): """ Main function """ - # Print title - title = "GitForWindows" - Header().title_info(title) - + # According to the "git-credential-store" documentation: # Build a list of locations in which git credentials can be stored locations = [] @@ -64,5 +60,4 @@ def run(self): final_pwd_found.append(pwd) duplicates_track.append(pwd_id) - # Print the results - print_output(title, final_pwd_found) + return final_pwd_found diff --git a/Windows/src/LaZagne/softwares/maven/__init__.py b/Windows/src/LaZagne/lazagne/softwares/mails/__init__.py old mode 100644 new mode 100755 similarity index 100% rename from Windows/src/LaZagne/softwares/maven/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/mails/__init__.py diff --git a/Windows/src/LaZagne/softwares/mails/outlook.py b/Windows/src/LaZagne/lazagne/softwares/mails/outlook.py similarity index 87% rename from Windows/src/LaZagne/softwares/mails/outlook.py rename to Windows/src/LaZagne/lazagne/softwares/mails/outlook.py index b62aa405..0cb78bc1 100755 --- a/Windows/src/LaZagne/softwares/mails/outlook.py +++ b/Windows/src/LaZagne/lazagne/softwares/mails/outlook.py @@ -1,18 +1,14 @@ import win32api, win32con, win32crypt -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo class Outlook(ModuleInfo): def __init__(self): options = {'command': '-o', 'action': 'store_true', 'dest': 'outlook', 'help': 'outlook - IMAP, POP3, HTTP, SMTP, LDPAP (not Exchange)'} ModuleInfo.__init__(self, 'outlook', 'mails', options) - def run(self): - # print title - Header().title_info('Outlook') - + def run(self, software_name = None): accessRead = win32con.KEY_READ | win32con.KEY_ENUMERATE_SUB_KEYS | win32con.KEY_QUERY_VALUE keyPath = 'Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles\\Outlook' @@ -42,9 +38,7 @@ def run(self): # write credentials into a text file if len(values) != 0: pwdFound.append(values) - - # print the results - print_output("Outlook", pwdFound) + return pwdFound def retrieve_info(self, hkey, name_key): values = {} diff --git a/Windows/src/LaZagne/softwares/svn/__init__.py b/Windows/src/LaZagne/lazagne/softwares/maven/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/svn/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/maven/__init__.py diff --git a/Windows/src/LaZagne/softwares/maven/mavenrepositories.py b/Windows/src/LaZagne/lazagne/softwares/maven/mavenrepositories.py old mode 100644 new mode 100755 similarity index 94% rename from Windows/src/LaZagne/softwares/maven/mavenrepositories.py rename to Windows/src/LaZagne/lazagne/softwares/maven/mavenrepositories.py index 5d8da62e..31222fb9 --- a/Windows/src/LaZagne/softwares/maven/mavenrepositories.py +++ b/Windows/src/LaZagne/lazagne/softwares/maven/mavenrepositories.py @@ -1,8 +1,7 @@ import os -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo import xml.etree.ElementTree as ET class MavenRepositories(ModuleInfo): @@ -81,7 +80,7 @@ def use_key_auth(self, creds_dict): return state - def run(self): + def run(self, software_name = None): """ Main function: @@ -95,9 +94,6 @@ def run(self): See https://github.com/jelmerk/maven-settings-decoder See https://github.com/sonatype/plexus-cipher/blob/master/src/main/java/org/sonatype/plexus/components/cipher/PBECipher.java """ - # Print title - title = "MavenRepositories" - Header().title_info(title) # Extract the master password master_password = self.extract_master_password() @@ -133,5 +129,4 @@ def run(self): values["Passphrase"] = creds["passphrase"] pwd_found.append(values) - # Print the results - print_output(title, pwd_found) + return pwd_found diff --git a/Windows/src/LaZagne/softwares/sysadmin/__init__.py b/Windows/src/LaZagne/lazagne/softwares/svn/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/sysadmin/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/svn/__init__.py diff --git a/Windows/src/LaZagne/softwares/svn/tortoise.py b/Windows/src/LaZagne/lazagne/softwares/svn/tortoise.py similarity index 85% rename from Windows/src/LaZagne/softwares/svn/tortoise.py rename to Windows/src/LaZagne/lazagne/softwares/svn/tortoise.py index 9f131507..20c4962f 100755 --- a/Windows/src/LaZagne/softwares/svn/tortoise.py +++ b/Windows/src/LaZagne/lazagne/softwares/svn/tortoise.py @@ -1,9 +1,8 @@ import sqlite3, win32crypt import sys, os, platform, base64 -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo class Tortoise(ModuleInfo): def __init__(self): @@ -11,10 +10,7 @@ def __init__(self): ModuleInfo.__init__(self, 'tortoise', 'svn', options) # main function - def run(self): - # print title - Header().title_info('Tortoise') - + def run(self, software_name = None): file_path = '' if 'APPDATA' in os.environ: file_path = os.environ.get('APPDATA') + '\\Subversion\\auth\\svn.simple' @@ -78,8 +74,8 @@ def run(self): values['Password'] = password pwdFound.append(values) - # print the results - print_output("Tortoise", pwdFound) + + return pwdFound else: print_debug('INFO', 'Tortoise not installed.') diff --git a/Windows/src/LaZagne/softwares/wifi/__init__.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/wifi/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/__init__.py diff --git a/Windows/src/LaZagne/softwares/sysadmin/apachedirectorystudio.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/apachedirectorystudio.py old mode 100644 new mode 100755 similarity index 87% rename from Windows/src/LaZagne/softwares/sysadmin/apachedirectorystudio.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/apachedirectorystudio.py index 75c41caf..b1e0206d --- a/Windows/src/LaZagne/softwares/sysadmin/apachedirectorystudio.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/apachedirectorystudio.py @@ -1,8 +1,7 @@ import os -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo import xml.etree.ElementTree as ET class ApacheDirectoryStudio(ModuleInfo): @@ -40,14 +39,10 @@ def extract_connections_credentials(self): return repos_creds - def run(self): + def run(self, software_name = None): """ Main function """ - # Print title - title = "ApacheDirectoryStudio" - Header().title_info(title) - # Extract all available connections credentials repos_creds = self.extract_connections_credentials() @@ -62,5 +57,4 @@ def run(self): values["AuthenticationMethod"] = creds["authMethod"] pwd_found.append(values) - # Print the results - print_output(title, pwd_found) + return pwd_found diff --git a/Windows/src/LaZagne/softwares/sysadmin/coreftp.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/coreftp.py similarity index 81% rename from Windows/src/LaZagne/softwares/sysadmin/coreftp.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/coreftp.py index f1c51278..fea752d2 100755 --- a/Windows/src/LaZagne/softwares/sysadmin/coreftp.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/coreftp.py @@ -1,9 +1,8 @@ import binascii from Crypto.Cipher import AES import win32con, win32api -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class CoreFTP(ModuleInfo): def __init__(self): @@ -53,12 +52,12 @@ def get_key_info(self): except Exception,e: print_debug('DEBUG', '{0}'.format(e)) values['Password'] = 'N/A' - # print the results - print_output('CoreFTP', pwdFound) - def run(self): - # print title - Header().title_info('CoreFTP') + return pwdFound - if self.get_key_info() == False: + def run(self, software_name = None): + pwdFound = self.get_key_info() + if pwdFound == False: print_debug('INFO', 'CoreFTP not installed') + else: + return pwdFound diff --git a/Windows/src/LaZagne/softwares/sysadmin/cyberduck.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/cyberduck.py similarity index 86% rename from Windows/src/LaZagne/softwares/sysadmin/cyberduck.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/cyberduck.py index 56c92346..8928d6bd 100755 --- a/Windows/src/LaZagne/softwares/sysadmin/cyberduck.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/cyberduck.py @@ -2,10 +2,9 @@ import win32crypt import sys, os, platform, base64 import xml.etree.cElementTree as ET -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo class Cyberduck(ModuleInfo): def __init__(self): @@ -49,14 +48,10 @@ def parse_xml(self, xml_file): except Exception,e: print_debug('DEBUG', '{0}'.format(e)) - # print the results - print_output("Cyberduck", pwdFound) + return pwdFound # main function - def run(self): - # print title - Header().title_info('Cyberduck') - + def run(self, software_name = None): path = self.get_path() if path == 'CYBERDUCK_NOT_EXISTS': print_debug('INFO', 'Cyberduck not installed.') @@ -65,5 +60,5 @@ def run(self): elif path == 'APPDATA_NOT_FOUND': print_debug('ERROR', 'The APPDATA environment variable is not defined.') else: - self.parse_xml(path) + return self.parse_xml(path) \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/sysadmin/filezilla.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/filezilla.py similarity index 89% rename from Windows/src/LaZagne/softwares/sysadmin/filezilla.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/filezilla.py index c65a5b09..18c22a84 100755 --- a/Windows/src/LaZagne/softwares/sysadmin/filezilla.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/filezilla.py @@ -1,19 +1,15 @@ import xml.etree.cElementTree as ET import os, base64 -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class Filezilla(ModuleInfo): def __init__(self): options = {'command': '-f', 'action': 'store_true', 'dest': 'filezilla', 'help': 'filezilla'} ModuleInfo.__init__(self, 'filezilla', 'sysadmin', options) - def run(self): - # print title - Header().title_info('Filezilla') - + def run(self, software_name = None): if constant.appdata: directory = '%s\FileZilla' % constant.appdata elif 'APPDATA' in os.environ: @@ -80,9 +76,7 @@ def run(self): # password found if len(values) != 0: pwdFound.append(values) - # print the results - print_output("Filezilla", pwdFound) - + return pwdFound else: print_debug('INFO', 'Filezilla not installed.') \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/sysadmin/ftpnavigator.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/ftpnavigator.py similarity index 79% rename from Windows/src/LaZagne/softwares/sysadmin/ftpnavigator.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/ftpnavigator.py index fe6427c7..f879c26d 100755 --- a/Windows/src/LaZagne/softwares/sysadmin/ftpnavigator.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/ftpnavigator.py @@ -1,7 +1,6 @@ import struct, os -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class FtpNavigator(ModuleInfo): def __init__(self): @@ -39,18 +38,15 @@ def read_file(self, filepath): values['Password'] = 'anonymous' pwdFound.append(values) - # print the results - print_output('FTP Navigator', pwdFound) - def run(self): - # print title - Header().title_info('FTP Navigator') - + return pwdFound + + def run(self, software_name = None): if 'HOMEDRIVE' in os.environ: path = os.environ.get('HOMEDRIVE') + os.sep + 'FTP Navigator\\Ftplist.txt' if os.path.exists(path): - self.read_file(path) + return self.read_file(path) else: print_debug('INFO', 'Paht %s does not exist.\nFTP Navigator not installed or not found.' % path) diff --git a/Windows/src/LaZagne/softwares/sysadmin/opensshforwindows.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/opensshforwindows.py old mode 100644 new mode 100755 similarity index 91% rename from Windows/src/LaZagne/softwares/sysadmin/opensshforwindows.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/opensshforwindows.py index e66d1f4d..3eeedcd4 --- a/Windows/src/LaZagne/softwares/sysadmin/opensshforwindows.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/opensshforwindows.py @@ -1,9 +1,8 @@ from os import environ, walk from os.path import isdir, isfile, join -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo from Crypto.PublicKey import RSA from Crypto.PublicKey import DSA @@ -73,13 +72,10 @@ def extract_private_keys_unprotected(self): return keys - def run(self): + def run(self, software_name = None): """ Main function """ - # Print title - title = "OpenSSHForWindows" - Header().title_info(title) # Extract all DSA/RSA private keys that are not protected with a passphrase unprotected_private_keys = self.extract_private_keys_unprotected() @@ -90,5 +86,4 @@ def run(self): values = {"PrivateKey": key} key_found.append(values) - # Print the results - print_output(title, key_found) + return key_found diff --git a/Windows/src/LaZagne/softwares/sysadmin/puttycm.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/puttycm.py similarity index 81% rename from Windows/src/LaZagne/softwares/sysadmin/puttycm.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/puttycm.py index a96440c8..d96952e6 100755 --- a/Windows/src/LaZagne/softwares/sysadmin/puttycm.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/puttycm.py @@ -1,20 +1,16 @@ import xml.etree.cElementTree as ET import win32con, win32api import os -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo class Puttycm(ModuleInfo): def __init__(self): options = {'command': '-p', 'action': 'store_true', 'dest': 'puttycm', 'help': 'puttycm'} ModuleInfo.__init__(self, 'puttycm', 'sysadmin', options) - def run(self): - # print title - Header().title_info('Puttycm') - + def run(self, software_name = None): try: database_path = self.get_default_database() except Exception,e: @@ -23,7 +19,7 @@ def run(self): return if os.path.exists(database_path): - self.parse_xml(database_path) + return self.parse_xml(database_path) else: print_debug('WARNING', 'Default database does not exist: %s' % database_path) @@ -72,6 +68,5 @@ def parse_xml(self, database_path): if len(values) != 0: pwdFound.append(values) - # print the results - print_output("Puttycm", pwdFound) + return pwdFound \ No newline at end of file diff --git a/Windows/src/LaZagne/softwares/sysadmin/winscp.py b/Windows/src/LaZagne/lazagne/softwares/sysadmin/winscp.py similarity index 89% rename from Windows/src/LaZagne/softwares/sysadmin/winscp.py rename to Windows/src/LaZagne/lazagne/softwares/sysadmin/winscp.py index 81271a90..3d0be4e1 100755 --- a/Windows/src/LaZagne/softwares/sysadmin/winscp.py +++ b/Windows/src/LaZagne/lazagne/softwares/sysadmin/winscp.py @@ -1,8 +1,7 @@ import win32con, win32api -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo class WinSCP(ModuleInfo): def __init__(self): @@ -119,8 +118,7 @@ def get_logins_info(self): pwdFound.append(values) - # print the results - print_output("WinSCP", pwdFound) + return pwdFound def decrypt_password(self): hex_flag = 0xFF @@ -153,15 +151,15 @@ def decrypt_password(self): return result # --------- Main function --------- - def run(self): - # print title - Header().title_info('WinSCP') - + def run(self, software_name = None): + if self.check_winscp_installed(): if not self.check_masterPassword(): r = self.get_logins_info() if r == False: print_debug('INFO', 'WinSCP not installed.') + else: + return r else: print_debug('WARNING', 'A master password is used. Passwords cannot been retrieved') else: diff --git a/Windows/src/LaZagne/softwares/windows/__init__.py b/Windows/src/LaZagne/lazagne/softwares/wifi/__init__.py similarity index 100% rename from Windows/src/LaZagne/softwares/windows/__init__.py rename to Windows/src/LaZagne/lazagne/softwares/wifi/__init__.py diff --git a/Windows/src/LaZagne/softwares/wifi/wifi.py b/Windows/src/LaZagne/lazagne/softwares/wifi/wifi.py similarity index 82% rename from Windows/src/LaZagne/softwares/wifi/wifi.py rename to Windows/src/LaZagne/lazagne/softwares/wifi/wifi.py index 4af7bc1e..a49291d5 100755 --- a/Windows/src/LaZagne/softwares/wifi/wifi.py +++ b/Windows/src/LaZagne/lazagne/softwares/wifi/wifi.py @@ -1,22 +1,18 @@ -from config.write_output import print_output, print_debug -from config.header import Header -from config.get_system_priv import get_system_priv +from lazagne.config.write_output import print_debug +from lazagne.config.get_system_priv import get_system_priv from ctypes import * import time, tempfile from ConfigParser import RawConfigParser import os -from config.moduleInfo import ModuleInfo +from lazagne.config.moduleInfo import ModuleInfo class Wifi(ModuleInfo): def __init__(self): options = {'command': '-wi', 'action': 'store_true', 'dest': 'wifi', 'help': 'Vista and higher - Need System Privileges'} ModuleInfo.__init__(self, 'Wifi', 'wifi', options) - def run(self): - - # print title - Header().title_info('Wifi') - + def run(self, software_name = None): + if not windll.Shell32.IsUserAnAdmin(): print_debug('WARNING', '[!] This script should be run as admin!') return @@ -62,7 +58,6 @@ def run(self): # remove file on the temporary directory os.remove(filepath) - # print the results - print_output("Wifi", pwdFound) + return pwdFound else: print_debug('INFO', 'No passwords found') diff --git a/Windows/src/LaZagne/softwares/wifi/wifipass.py b/Windows/src/LaZagne/lazagne/softwares/wifi/wifipass.py similarity index 91% rename from Windows/src/LaZagne/softwares/wifi/wifipass.py rename to Windows/src/LaZagne/lazagne/softwares/wifi/wifipass.py index e7e6ae06..f320fdbd 100755 --- a/Windows/src/LaZagne/softwares/wifi/wifipass.py +++ b/Windows/src/LaZagne/lazagne/softwares/wifi/wifipass.py @@ -3,7 +3,7 @@ import binascii import tempfile, socket from ctypes import * -from config.moduleInfo import ModuleInfo +from lazagne.config.moduleInfo import ModuleInfo import argparse class WifiPass(ModuleInfo): @@ -12,7 +12,7 @@ def __init__(self): ModuleInfo.__init__(self, 'wifipass', 'wifi', options) # used when launched with a system account - def run(self): + def run(self, software_name = None): # need to be admin privilege, to find passwords if not windll.Shell32.IsUserAnAdmin(): return @@ -64,7 +64,8 @@ def run(self): if len(values) != 0: pwdFound.append(values) # print the results - print_output('Wifi', pwdFound) + # print_output('Wifi', pwdFound) + return pwdFound # If at least one password has been found, we create the file in temp directory # if passwordFound: diff --git a/Windows/src/LaZagne/lazagne/softwares/windows/__init__.py b/Windows/src/LaZagne/lazagne/softwares/windows/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/Windows/src/LaZagne/softwares/windows/dot_net.py b/Windows/src/LaZagne/lazagne/softwares/windows/dot_net.py similarity index 84% rename from Windows/src/LaZagne/softwares/windows/dot_net.py rename to Windows/src/LaZagne/lazagne/softwares/windows/dot_net.py index a2ba1847..8930a2bc 100755 --- a/Windows/src/LaZagne/softwares/windows/dot_net.py +++ b/Windows/src/LaZagne/lazagne/softwares/windows/dot_net.py @@ -2,10 +2,9 @@ from ctypes import * from ctypes.wintypes import DWORD import win32cred -from config.constant import * -from config.write_output import print_output, print_debug -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.constant import * +from lazagne.config.write_output import print_debug +from lazagne.config.moduleInfo import ModuleInfo memcpy = cdll.msvcrt.memcpy LocalFree = windll.kernel32.LocalFree @@ -58,10 +57,7 @@ def Win32CryptUnprotectData(self, cipherText, entropy): else: return 'failed' - def run(self): - # print title - Header().title_info('Dot Net Passport') - + def run(self, software_name = None): a = self.get_creds() pwd = '' pwdFound = [] @@ -82,9 +78,8 @@ def run(self): values['INFO'] = 'Error decoding the password' pwdFound.append(values) - - # print the results - print_output('Dot Net Passport', pwdFound) + + return pwdFound else: print_debug('INFO', 'No credentials listed with the enum cred function') diff --git a/Windows/src/LaZagne/softwares/windows/network.py b/Windows/src/LaZagne/lazagne/softwares/windows/network.py similarity index 89% rename from Windows/src/LaZagne/softwares/windows/network.py rename to Windows/src/LaZagne/lazagne/softwares/windows/network.py index 89f6df42..d0f3bcc2 100755 --- a/Windows/src/LaZagne/softwares/windows/network.py +++ b/Windows/src/LaZagne/lazagne/softwares/windows/network.py @@ -1,10 +1,9 @@ import struct, platform, win32cred from ctypes import * from ctypes.wintypes import DWORD -from config.write_output import print_output, print_debug -from config.constant import * -from config.header import Header -from config.moduleInfo import ModuleInfo +from lazagne.config.write_output import print_debug +from lazagne.config.constant import * +from lazagne.config.moduleInfo import ModuleInfo memcpy = cdll.msvcrt.memcpy LocalFree = windll.kernel32.LocalFree @@ -59,10 +58,7 @@ def Win32CryptUnprotectData(self, cipherText, entropy): else: return 'failed' - def run(self): - # print title - Header().title_info('Generic Network') - + def run(self, software_name = None): os_plateform = platform.release() a = self.get_creds() @@ -98,8 +94,7 @@ def run(self): pwdFound.append(values) - # print the results - print_output("Generic Network", pwdFound) + return pwdFound else: print_debug('INFO', 'No credentials listed with the enum cred function') diff --git a/Windows/src/LaZagne/softwares/windows/secrets.py b/Windows/src/LaZagne/lazagne/softwares/windows/secrets.py similarity index 86% rename from Windows/src/LaZagne/softwares/windows/secrets.py rename to Windows/src/LaZagne/lazagne/softwares/windows/secrets.py index 92255dd2..b1fa4aaa 100755 --- a/Windows/src/LaZagne/softwares/windows/secrets.py +++ b/Windows/src/LaZagne/lazagne/softwares/windows/secrets.py @@ -1,11 +1,11 @@ import subprocess import os, sys from secretsdump import retrieve_hash -from config.header import Header -from config.write_output import print_debug +from lazagne.config.header import Header +from lazagne.config.write_output import print_debug from ctypes import * import logging -from config.moduleInfo import ModuleInfo +from lazagne.config.moduleInfo import ModuleInfo class Secrets(ModuleInfo): def __init__(self): @@ -17,7 +17,7 @@ def __init__(self): self.ntds = os.environ['systemroot'] + os.sep + 'ntds' + os.sep + 'ntds.dit' if not os.path.exists(self.ntds): self.ntds = None - self.history = True + self.history = True # check if files have been saved def check_existing_systemFiles(self): @@ -30,7 +30,7 @@ def delete_existing_systemFiles(self): for f in self.sysFile: os.remove('%s.save' % f) - def run(self): + def run(self, software_name = None): # Need admin privileges if not windll.Shell32.IsUserAnAdmin(): if logging.getLogger().isEnabledFor(logging.INFO) == True: @@ -38,9 +38,6 @@ def run(self): print_debug('WARNING', '[!] This script should be run as admin!') return - # print the title - Header().title('Windows Secrets') - # if hives already exists if self.check_existing_systemFiles(): self.delete_existing_systemFiles() # delete it diff --git a/Windows/src/LaZagne/softwares/windows/secretsdump.py b/Windows/src/LaZagne/lazagne/softwares/windows/secretsdump.py similarity index 99% rename from Windows/src/LaZagne/softwares/windows/secretsdump.py rename to Windows/src/LaZagne/lazagne/softwares/windows/secretsdump.py index ab0577b0..5a6f5e27 100755 --- a/Windows/src/LaZagne/softwares/windows/secretsdump.py +++ b/Windows/src/LaZagne/lazagne/softwares/windows/secretsdump.py @@ -48,11 +48,11 @@ from collections import OrderedDict import win32con, win32security, win32net import binascii -from config.dico import get_dico -from config.write_output import print_debug, print_output +from lazagne.config.dico import get_dico +from lazagne.config.write_output import print_debug, print_output # import logging -from config.constant import * -from config.header import Header +from lazagne.config.constant import * +from lazagne.config.header import Header import sys import random