diff --git a/lib/core/common.py b/lib/core/common.py index 577d6f44d..d057754aa 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -70,6 +70,7 @@ from lib.core.decorators import cachedmethod from lib.core.defaults import defaults from lib.core.dicts import DBMS_DICT from lib.core.dicts import DEFAULT_DOC_ROOTS +from lib.core.dicts import DEPRECATED_OPTIONS from lib.core.dicts import OBSOLETE_OPTIONS from lib.core.dicts import SQL_STATEMENTS from lib.core.enums import ADJUST_TIME_DELAY @@ -4466,9 +4467,9 @@ def getHostHeader(url): return retVal -def checkObsoleteOptions(args): +def checkOldOptions(args): """ - Checks for obsolete options + Checks for obsolete/deprecated options """ for _ in args: @@ -4478,6 +4479,11 @@ def checkObsoleteOptions(args): if OBSOLETE_OPTIONS[_]: errMsg += " (hint: %s)" % OBSOLETE_OPTIONS[_] raise SqlmapSyntaxException(errMsg) + elif _ in DEPRECATED_OPTIONS: + warnMsg = "switch/option '%s' is deprecated" % _ + if DEPRECATED_OPTIONS[_]: + warnMsg += " (hint: %s)" % DEPRECATED_OPTIONS[_] + logger.warn(warnMsg) def checkSystemEncoding(): """ diff --git a/lib/core/dicts.py b/lib/core/dicts.py index d0b85ff0c..21861f1f5 100644 --- a/lib/core/dicts.py +++ b/lib/core/dicts.py @@ -290,10 +290,13 @@ OBSOLETE_OPTIONS = { "--purge-output": "use '--purge' instead", "--check-payload": None, "--check-waf": None, - "--identify-waf": "functionality being done automatically", "--pickled-options": "use '--api -c ...' instead", } +DEPRECATED_OPTIONS = { + "--identify-waf": "functionality being done automatically", +} + DUMP_DATA_PREPROCESS = { DBMS.ORACLE: {"XMLTYPE": "(%s).getStringVal()"}, # Reference: https://www.tibcommunity.com/docs/DOC-3643 DBMS.MSSQL: {"IMAGE": "CONVERT(VARBINARY(MAX),%s)"}, diff --git a/lib/core/settings.py b/lib/core/settings.py index 19ad3316a..3e51e271a 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.6.24" +VERSION = "1.3.6.25" 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 a5ba73f65..ebd6b7ab1 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -17,7 +17,7 @@ from optparse import OptionGroup from optparse import OptionParser from optparse import SUPPRESS_HELP -from lib.core.common import checkObsoleteOptions +from lib.core.common import checkOldOptions from lib.core.common import checkSystemEncoding from lib.core.common import dataToStdout from lib.core.common import expandMnemonics @@ -28,6 +28,7 @@ from lib.core.data import cmdLineOptions from lib.core.data import conf from lib.core.data import logger from lib.core.defaults import defaults +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 @@ -789,7 +790,7 @@ def cmdLineParser(argv=None): _.append(getUnicode(arg, encoding=sys.stdin.encoding)) argv = _ - checkObsoleteOptions(argv) + checkOldOptions(argv) prompt = "--sqlmap-shell" in argv @@ -854,6 +855,8 @@ def cmdLineParser(argv=None): elif re.search(r"\A-\w=.+", argv[i]): dataToStdout("[!] potentially miswritten (illegal '=') short option detected ('%s')\n" % argv[i]) raise SystemExit + elif argv[i] in DEPRECATED_OPTIONS: + argv[i] = "" elif argv[i].startswith("--tamper"): if tamperIndex is None: tamperIndex = i if '=' in argv[i] else (i + 1 if i + 1 < len(argv) and not argv[i + 1].startswith('-') else None)