diff --git a/lib/core/common.py b/lib/core/common.py index 3fd5b53b7..c9e629361 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -56,6 +56,7 @@ from lib.core.convert import unicodeencode from lib.core.convert import utf8encode from lib.core.decorators import cachedmethod from lib.core.dicts import DBMS_DICT +from lib.core.dicts import DEPRECATED_HINTS from lib.core.dicts import SQL_STATEMENTS from lib.core.enums import ADJUST_TIME_DELAY from lib.core.enums import CHARSET_TYPE @@ -86,6 +87,7 @@ from lib.core.settings import DBMS_DIRECTORY_DICT from lib.core.settings import DEFAULT_COOKIE_DELIMITER from lib.core.settings import DEFAULT_GET_POST_DELIMITER from lib.core.settings import DEFAULT_MSSQL_SCHEMA +from lib.core.settings import DEPRECATED_OPTIONS from lib.core.settings import DESCRIPTION from lib.core.settings import DUMMY_SQL_INJECTION_CHARS from lib.core.settings import DUMMY_USER_INJECTION @@ -3133,6 +3135,18 @@ def getHostHeader(url): return retVal +def checkDeprecatedOptions(args): + """ + Checks for deprecated options + """ + + for _ in args: + if _ in DEPRECATED_OPTIONS: + errMsg = "switch/option '%s' is deprecated" % _ + if _ in DEPRECATED_HINTS: + errMsg += " (hint: %s)" % DEPRECATED_HINTS[_] + raise sqlmapSyntaxException, errMsg + def evaluateCode(code, variables=None): """ Executes given python code given in a string form diff --git a/lib/core/dicts.py b/lib/core/dicts.py index 49eaa34d2..8bec7efe1 100644 --- a/lib/core/dicts.py +++ b/lib/core/dicts.py @@ -201,3 +201,5 @@ POST_HINT_CONTENT_TYPES = { POST_HINT.SOAP: "application/soap+xml", POST_HINT.XML: "application/xml" } + +DEPRECATED_HINTS = {"--replicate": "use '--dump-format=SQLITE' instead"} diff --git a/lib/core/settings.py b/lib/core/settings.py index f8b5c4ca8..7c483f983 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -305,6 +305,9 @@ HASH_MOD_ITEM_DISPLAY = 11 # Maximum integer value MAX_INT = sys.maxint +# List of deprecated options +DEPRECATED_OPTIONS = ("--replicate",) + # Parameters to be ignored in detection phase (upper case) IGNORE_PARAMETERS = ("__VIEWSTATE", "__VIEWSTATEENCRYPTED", "__EVENTARGUMENT", "__EVENTTARGET", "__EVENTVALIDATION", "ASPSESSIONID", "ASP.NET_SESSIONID", "JSESSIONID", "CFID", "CFTOKEN") diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 02253bdfc..ac1759d4d 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -12,6 +12,7 @@ from optparse import OptionGroup from optparse import OptionParser from optparse import SUPPRESS_HELP +from lib.core.common import checkDeprecatedOptions from lib.core.common import expandMnemonics from lib.core.common import getUnicode from lib.core.data import logger @@ -716,6 +717,8 @@ def cmdLineParser(): for arg in sys.argv: args.append(getUnicode(arg, system=True)) + checkDeprecatedOptions(args) + # Hide non-basic options in basic help case for i in xrange(len(sys.argv)): if sys.argv[i] == '-hh':