From 677dd20d6cb8a11136a527de44eb19a9aa5b508e Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 6 Jun 2019 12:13:30 +0200 Subject: [PATCH] Considerable improvement of --parse-errors (and patch) --- lib/core/common.py | 5 ++++- lib/core/settings.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 5fcfc68ee..17980c481 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2651,12 +2651,15 @@ def extractErrorMessage(page): retVal = None if isinstance(page, six.string_types): + if wasLastResponseDBMSError(): + page = re.sub(r"<[^>]+>", "", page) + for regex in ERROR_PARSING_REGEXES: match = re.search(regex, page, re.IGNORECASE) if match: candidate = htmlUnescape(match.group("result")).replace("
", "\n").strip() - if re.search(r"\b([a-z]+ ){5}", candidate) is None: # check for legitimate (e.g. Warning:...) text + if re.search(r"\b([a-z]+ ){5}", candidate) is not None: # check for legitimate (e.g. Warning:...) text retVal = candidate break diff --git a/lib/core/settings.py b/lib/core/settings.py index f0bfbacb5..22b7e19fd 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.22" +VERSION = "1.3.6.23" 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)