mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 08:14:24 +03:00
Deprecating --replicate (Issue #254)
This commit is contained in:
parent
f08eb0fd9f
commit
87a92ab330
|
@ -56,6 +56,7 @@ from lib.core.convert import unicodeencode
|
||||||
from lib.core.convert import utf8encode
|
from lib.core.convert import utf8encode
|
||||||
from lib.core.decorators import cachedmethod
|
from lib.core.decorators import cachedmethod
|
||||||
from lib.core.dicts import DBMS_DICT
|
from lib.core.dicts import DBMS_DICT
|
||||||
|
from lib.core.dicts import DEPRECATED_HINTS
|
||||||
from lib.core.dicts import SQL_STATEMENTS
|
from lib.core.dicts import SQL_STATEMENTS
|
||||||
from lib.core.enums import ADJUST_TIME_DELAY
|
from lib.core.enums import ADJUST_TIME_DELAY
|
||||||
from lib.core.enums import CHARSET_TYPE
|
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_COOKIE_DELIMITER
|
||||||
from lib.core.settings import DEFAULT_GET_POST_DELIMITER
|
from lib.core.settings import DEFAULT_GET_POST_DELIMITER
|
||||||
from lib.core.settings import DEFAULT_MSSQL_SCHEMA
|
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 DESCRIPTION
|
||||||
from lib.core.settings import DUMMY_SQL_INJECTION_CHARS
|
from lib.core.settings import DUMMY_SQL_INJECTION_CHARS
|
||||||
from lib.core.settings import DUMMY_USER_INJECTION
|
from lib.core.settings import DUMMY_USER_INJECTION
|
||||||
|
@ -3133,6 +3135,18 @@ def getHostHeader(url):
|
||||||
|
|
||||||
return retVal
|
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):
|
def evaluateCode(code, variables=None):
|
||||||
"""
|
"""
|
||||||
Executes given python code given in a string form
|
Executes given python code given in a string form
|
||||||
|
|
|
@ -201,3 +201,5 @@ POST_HINT_CONTENT_TYPES = {
|
||||||
POST_HINT.SOAP: "application/soap+xml",
|
POST_HINT.SOAP: "application/soap+xml",
|
||||||
POST_HINT.XML: "application/xml"
|
POST_HINT.XML: "application/xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEPRECATED_HINTS = {"--replicate": "use '--dump-format=SQLITE' instead"}
|
||||||
|
|
|
@ -305,6 +305,9 @@ HASH_MOD_ITEM_DISPLAY = 11
|
||||||
# Maximum integer value
|
# Maximum integer value
|
||||||
MAX_INT = sys.maxint
|
MAX_INT = sys.maxint
|
||||||
|
|
||||||
|
# List of deprecated options
|
||||||
|
DEPRECATED_OPTIONS = ("--replicate",)
|
||||||
|
|
||||||
# Parameters to be ignored in detection phase (upper case)
|
# Parameters to be ignored in detection phase (upper case)
|
||||||
IGNORE_PARAMETERS = ("__VIEWSTATE", "__VIEWSTATEENCRYPTED", "__EVENTARGUMENT", "__EVENTTARGET", "__EVENTVALIDATION", "ASPSESSIONID", "ASP.NET_SESSIONID", "JSESSIONID", "CFID", "CFTOKEN")
|
IGNORE_PARAMETERS = ("__VIEWSTATE", "__VIEWSTATEENCRYPTED", "__EVENTARGUMENT", "__EVENTTARGET", "__EVENTVALIDATION", "ASPSESSIONID", "ASP.NET_SESSIONID", "JSESSIONID", "CFID", "CFTOKEN")
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ from optparse import OptionGroup
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from optparse import SUPPRESS_HELP
|
from optparse import SUPPRESS_HELP
|
||||||
|
|
||||||
|
from lib.core.common import checkDeprecatedOptions
|
||||||
from lib.core.common import expandMnemonics
|
from lib.core.common import expandMnemonics
|
||||||
from lib.core.common import getUnicode
|
from lib.core.common import getUnicode
|
||||||
from lib.core.data import logger
|
from lib.core.data import logger
|
||||||
|
@ -716,6 +717,8 @@ def cmdLineParser():
|
||||||
for arg in sys.argv:
|
for arg in sys.argv:
|
||||||
args.append(getUnicode(arg, system=True))
|
args.append(getUnicode(arg, system=True))
|
||||||
|
|
||||||
|
checkDeprecatedOptions(args)
|
||||||
|
|
||||||
# Hide non-basic options in basic help case
|
# Hide non-basic options in basic help case
|
||||||
for i in xrange(len(sys.argv)):
|
for i in xrange(len(sys.argv)):
|
||||||
if sys.argv[i] == '-hh':
|
if sys.argv[i] == '-hh':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user