From f437a545618ea1cab81e6d3f474d22c9cadf6b30 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 27 Sep 2019 21:59:20 +0200 Subject: [PATCH] Update regarding #3944 --- lib/core/settings.py | 2 +- lib/parse/cmdline.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index ecef88f6f..8f20e0db3 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.9.23" +VERSION = "1.3.9.24" 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 579ca3f3e..71feedad2 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -902,6 +902,7 @@ def cmdLineParser(argv=None): raise SqlmapSyntaxException("something went wrong during command line parsing ('%s')" % getSafeExString(ex)) for i in xrange(len(argv)): + longOptions = set(re.findall(r"\-\-([^= ]+?)=", parser.format_help())) if argv[i] == "-hh": argv[i] = "-h" elif len(argv[i]) > 1 and all(ord(_) in xrange(0x2018, 0x2020) for _ in ((argv[i].split('=', 1)[-1].strip() or ' ')[0], argv[i][-1])): @@ -949,6 +950,9 @@ def cmdLineParser(argv=None): found = True if not found: get_groups(parser).remove(group) + elif '=' in argv[i] and not argv[i].startswith('-') and argv[i].split('=')[0] in longOptions and re.search(r"\A-\w\Z", argv[i - 1]) is None: + dataToStdout("[!] detected usage of long-option without a starting hyphen ('%s')\n" % argv[i]) + raise SystemExit for verbosity in (_ for _ in argv if re.search(r"\A\-v+\Z", _)): try: