From e07c92bce5d195fd029a44d94cb9af9539f66398 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 19 Apr 2016 13:45:49 +0200 Subject: [PATCH] Minor change on banner showing up --- lib/core/common.py | 10 ++++++---- sqlmap.py | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 21ffc015d..4cf8056ae 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1068,10 +1068,12 @@ def banner(): This function prints sqlmap banner with its version """ - _ = BANNER - if not getattr(LOGGER_HANDLER, "is_tty", False): - _ = re.sub("\033.+?m", "", _) - dataToStdout(_, forceOutput=True) + + if not any(_ in sys.argv for _ in ("--version", "--pickled-options")): + _ = BANNER + if not getattr(LOGGER_HANDLER, "is_tty", False): + _ = re.sub("\033.+?m", "", _) + dataToStdout(_, forceOutput=True) def parsePasswordHash(password): """ diff --git a/sqlmap.py b/sqlmap.py index ea3757c74..d316cc762 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -85,6 +85,7 @@ def main(): raise SystemExit setPaths() + banner() # Store original command line options for possible later restoration cmdLineOptions.update(cmdLineParser().__dict__) @@ -97,8 +98,6 @@ def main(): sys.stderr = StdDbOut(conf.taskid, messagetype="stderr") setRestAPILog() - banner() - conf.showTime = True dataToStdout("[!] legal disclaimer: %s\n\n" % LEGAL_DISCLAIMER, forceOutput=True) dataToStdout("[*] starting at %s\n\n" % time.strftime("%X"), forceOutput=True)