From 86392179c3a6b89b594b572bbfe2a96a16a850b6 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 16 Jul 2019 14:02:16 +0200 Subject: [PATCH] Minor patch related to the #3822 --- lib/core/option.py | 4 ++-- lib/core/settings.py | 2 +- lib/parse/cmdline.py | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 0c49093d8..335850ab8 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1448,7 +1448,7 @@ def _createHomeDirectories(): Creates directories inside sqlmap's home directory """ - if conf.purge: + if conf.get("purge"): return for context in "output", "history": @@ -1461,7 +1461,7 @@ def _createHomeDirectories(): open(_, "w+b").close() os.remove(_) - if conf.outputDir and context == "output": + if conf.get("outputDir") and context == "output": warnMsg = "using '%s' as the %s directory" % (directory, context) logger.warn(warnMsg) except (OSError, IOError) as ex: diff --git a/lib/core/settings.py b/lib/core/settings.py index 5580d994c..083a244d2 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.7.25" +VERSION = "1.3.7.26" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 51843d6ad..8e1bb9af5 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -59,6 +59,7 @@ from lib.core.dicts import DEPRECATED_OPTIONS from lib.core.enums import AUTOCOMPLETE_TYPE from lib.core.exception import SqlmapShellQuitException from lib.core.exception import SqlmapSyntaxException +from lib.core.option import _createHomeDirectories from lib.core.settings import BASIC_HELP_ITEMS from lib.core.settings import DUMMY_URL from lib.core.settings import INFERENCE_UNKNOWN_CHAR @@ -829,6 +830,8 @@ def cmdLineParser(argv=None): prompt = "--sqlmap-shell" in argv if prompt: + _createHomeDirectories() + parser.usage = "" cmdLineOptions.sqlmapShell = True