diff --git a/lib/controller/checks.py b/lib/controller/checks.py index f81764ab3..20c0654d8 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -46,6 +46,7 @@ from lib.core.exception import sqlmapSiteTooDynamic from lib.core.exception import sqlmapUserQuitException from lib.core.session import setString from lib.core.session import setRegexp +from lib.core.settings import DYNAMICITY_MARK_LENGTH from lib.core.unescaper import unescaper from lib.request.connect import Connect as Request from lib.request.templates import getPageTemplate @@ -519,7 +520,7 @@ def checkDynamicContent(firstPage, secondPage): block = blocks[i] (_, _, length) = block - if length <= conf.dynMarkLength: + if length <= DYNAMICITY_MARK_LENGTH: blocks.remove(block) else: @@ -543,7 +544,7 @@ def checkDynamicContent(firstPage, secondPage): prefix = trimAlphaNum(prefix) suffix = trimAlphaNum(suffix) - kb.dynamicMarkings.append((re.escape(prefix[-conf.dynMarkLength/2:]) if prefix else None, re.escape(suffix[:conf.dynMarkLength/2]) if suffix else None)) + kb.dynamicMarkings.append((re.escape(prefix[-DYNAMICITY_MARK_LENGTH/2:]) if prefix else None, re.escape(suffix[:DYNAMICITY_MARK_LENGTH/2]) if suffix else None)) if len(kb.dynamicMarkings) > 0: infoMsg = "dynamic content marked for removal (%d region%s)" % (len(kb.dynamicMarkings), 's' if len(kb.dynamicMarkings) > 1 else '') diff --git a/lib/core/option.py b/lib/core/option.py index 258e251d0..14408929c 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1091,7 +1091,6 @@ def __setConfAttributes(): conf.dbmsConnector = None conf.dbmsHandler = None conf.dumpPath = None - conf.dynMarkLength = 32 conf.httpHeaders = [] conf.hostname = None conf.loggedToOut = None diff --git a/lib/core/settings.py b/lib/core/settings.py index 59f94649d..69ccaa521 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -71,6 +71,9 @@ UNKNOWN_DBMS_VERSION = "Unknown" LOWER_RATIO_BOUND = 0.02 UPPER_RATIO_BOUND = 0.98 +# dynamicity mark length used in dynamicity removal engine +DYNAMICITY_MARK_LENGTH = 32 + # System variables IS_WIN = subprocess.mswindows # The name of the operating system dependent module imported. The following diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 392cb5bf0..dac1882e8 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -18,7 +18,8 @@ from lib.core.data import kb from lib.core.data import logger from lib.core.settings import CONSTANT_RATIO from lib.core.settings import DIFF_TOLERANCE -from lib.core.settings import LOWER_RATIO_BOUND, UPPER_RATIO_BOUND +from lib.core.settings import LOWER_RATIO_BOUND +from lib.core.settings import UPPER_RATIO_BOUND def comparison(page, headers=None, getSeqMatcher=False, pageLength=None): if page is None and pageLength is None: