From 0500712a0374e010e9de7d8ff819ccdbdccdbb5c Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Mon, 17 Dec 2012 13:29:19 +0000 Subject: [PATCH] removed unuseful prints --- lib/core/option.py | 6 ++++-- lib/utils/hash.py | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 1b98f7e84..1f70bedb4 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -615,13 +615,15 @@ def _setMetasploit(): if not conf.msfPath: def _(key, value): retVal = None + try: from _winreg import ConnectRegistry, OpenKey, QueryValueEx, HKEY_LOCAL_MACHINE _ = ConnectRegistry(None, HKEY_LOCAL_MACHINE) _ = OpenKey(_, key) retVal = QueryValueEx(_, value)[0] - except Exception, ex: - print ex + except Exception: + logger.debug("unable to identify Metasploit installation path via registry key") + return retVal conf.msfPath = _(r"SOFTWARE\Rapid7\Metasploit", "Location") diff --git a/lib/utils/hash.py b/lib/utils/hash.py index 485e50b41..e19c91a34 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -500,8 +500,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc except (UnicodeEncodeError, UnicodeDecodeError): pass # ignore possible encoding problems caused by some words in custom dictionaries - except Exception, ex: - print ex + except Exception, e: warnMsg = "there was a problem while hashing entry: %s. " % repr(word) warnMsg += "Please report by e-mail to %s" % ML logger.critical(warnMsg) @@ -568,9 +567,8 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found except (UnicodeEncodeError, UnicodeDecodeError): pass # ignore possible encoding problems caused by some words in custom dictionaries - except Exception, ex: - print ex - warnMsg = "there was a problem while hashing entry: %s. " % repr(word) + except Exception, e: + warnMsg = "there was a problem while hashing entry: %s (%s). " % (repr(word), e) warnMsg += "Please report by e-mail to %s" % ML logger.critical(warnMsg)