From 85c6d0d5c1cce67f59a0f37432a35744a5461755 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 17 Dec 2020 13:34:23 +0100 Subject: [PATCH] Fixes #4483 --- lib/core/option.py | 8 ++++++++ lib/core/settings.py | 2 +- plugins/generic/search.py | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index ba5ed87e3..3d6fdf820 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1868,6 +1868,8 @@ def _cleanupOptions(): if conf.exclude: regex = False + original = conf.exclude + if any(_ in conf.exclude for _ in ('+', '*')): try: re.compile(conf.exclude) @@ -1882,6 +1884,12 @@ def _cleanupOptions(): else: conf.exclude = re.sub(r"(\w+)\$", r"\g<1>\$", conf.exclude) + class _(six.text_type): + pass + + conf.exclude = _(conf.exclude) + conf.exclude._original = original + if conf.binaryFields: conf.binaryFields = conf.binaryFields.replace(" ", "") conf.binaryFields = re.split(PARAMETER_SPLITTING_REGEX, conf.binaryFields) diff --git a/lib/core/settings.py b/lib/core/settings.py index 2f88d49ac..eb4c1d909 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.4.12.23" +VERSION = "1.4.12.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/plugins/generic/search.py b/plugins/generic/search.py index 42afd3cfe..bbe35d670 100644 --- a/plugins/generic/search.py +++ b/plugins/generic/search.py @@ -194,6 +194,9 @@ class Search(object): else: whereDbsQuery = "" + if dbCond and conf.exclude: + whereDbsQuery += " AND %s NOT LIKE '%s'" % (dbCond, re.sub(r"\.[*+]", '%', conf.exclude._original)) + logger.info(infoMsg) tblQuery = "%s%s" % (tblCond, tblCondParam) @@ -431,6 +434,9 @@ class Search(object): else: infoMsgDb = " across all databases" + if conf.exclude: + whereDbsQuery += " AND %s NOT LIKE '%s'" % (dbCond, re.sub(r"\.[*+]", '%', conf.exclude._original)) + logger.info("%s%s%s" % (infoMsg, infoMsgTbl, infoMsgDb)) colQuery = "%s%s" % (colCond, colCondParam)