From c81e9633a6ad1fe6e8805050df7f94c8e8e6aee6 Mon Sep 17 00:00:00 2001 From: Albert Date: Thu, 22 Mar 2018 09:42:06 +0100 Subject: [PATCH 1/4] Change logging stream to stdout instead of stderr (default) Now all the logging functions should print to stdout instead of stderr. --- Linux/laZagne.py | 2 +- Mac/laZagne.py | 2 +- Windows/laZagne.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Linux/laZagne.py b/Linux/laZagne.py index 901edbf4..e19e4dfc 100755 --- a/Linux/laZagne.py +++ b/Linux/laZagne.py @@ -72,7 +72,7 @@ def verbosity(): elif args['verbose'] >= 2: level = logging.DEBUG formatter = logging.Formatter(fmt='%(message)s') - stream = logging.StreamHandler() + stream = logging.StreamHandler(sys.stdout) stream.setFormatter(formatter) root = logging.getLogger() root.setLevel(level) diff --git a/Mac/laZagne.py b/Mac/laZagne.py index 1579f05a..7035f2d9 100755 --- a/Mac/laZagne.py +++ b/Mac/laZagne.py @@ -71,7 +71,7 @@ def verbosity(): FORMAT = "%(message)s" formatter = logging.Formatter(fmt=FORMAT) - stream = logging.StreamHandler() + stream = logging.StreamHandler(sys.stdout) stream.setFormatter(formatter) root = logging.getLogger() diff --git a/Windows/laZagne.py b/Windows/laZagne.py index 488baf30..33870b4a 100644 --- a/Windows/laZagne.py +++ b/Windows/laZagne.py @@ -83,7 +83,7 @@ def verbosity(): elif args['verbose'] >= 2: level = logging.DEBUG formatter = logging.Formatter(fmt='%(message)s') - stream = logging.StreamHandler() + stream = logging.StreamHandler(sys.stdout) stream.setFormatter(formatter) root = logging.getLogger() root.setLevel(level) From 260acd14b060ddc4e12bc0b8e2d6cfd7085bf21b Mon Sep 17 00:00:00 2001 From: Albert Date: Thu, 22 Mar 2018 09:43:35 +0100 Subject: [PATCH 2/4] Avoid exception in Linux lazagne if dbus is not installed in the system Installing DBUS dependency is not straighforward. With this change, the execution of Linux laZagne will not crash if DBUS dependency is not installed, the only thing that will happen is that pidgin credentials will not be retrieved. --- Linux/lazagne/softwares/chats/pidgin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Linux/lazagne/softwares/chats/pidgin.py b/Linux/lazagne/softwares/chats/pidgin.py index 2cb2d93e..fe8d894c 100755 --- a/Linux/lazagne/softwares/chats/pidgin.py +++ b/Linux/lazagne/softwares/chats/pidgin.py @@ -5,15 +5,22 @@ from lazagne.config.constant import * import xml.etree.cElementTree as ET from lazagne.config import homes -import dbus import os +try: + import dbus +except ImportError as e: + dbus = None + + class Pidgin(ModuleInfo): def __init__(self): ModuleInfo.__init__(self, 'pidgin', 'chats') # If pidgin is started, use the api to retrieve all passwords def check_if_pidgin_started(self): + if not dbus: + return False try: pwdFound = [] bus = dbus.SessionBus() @@ -38,7 +45,7 @@ def run(self, software_name=None): pwdFound = [] try: pwdTab = self.check_if_pidgin_started() - if pwdTab != False: + if pwdTab: pwdFound = pwdTab except: pass From 9e1fe1e2badd519fc4979b65a94d69c394f6aaa9 Mon Sep 17 00:00:00 2001 From: Albert Date: Thu, 22 Mar 2018 09:45:26 +0100 Subject: [PATCH 3/4] Add necessary psutil requirement to Linux requirement.txt requirement.txt file did not include psutil, however it was required when executing Linuz lazagne. --- Linux/requirement.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Linux/requirement.txt b/Linux/requirement.txt index 4d6ab88e..846b3a06 100644 --- a/Linux/requirement.txt +++ b/Linux/requirement.txt @@ -1,3 +1,4 @@ pycrypto pyasn1 https://github.com/n1nj4sec/memorpy/archive/master.zip +psutil From 3cacdb0c25e995b00941cc739af2fb331ce51484 Mon Sep 17 00:00:00 2001 From: Albert Date: Thu, 22 Mar 2018 09:46:37 +0100 Subject: [PATCH 4/4] Add gitignore to avoid pushing virtualenv and binary artifacts --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5311da51 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea +*.pyc +venv