diff --git a/lib/core/common.py b/lib/core/common.py index f21fb0d6f..57b16ff48 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2703,6 +2703,12 @@ def extractErrorMessage(page): retVal = candidate break + if not retVal and wasLastResponseDBMSError(): + match = re.search(r"[^\n]*SQL[^\n:]*:[^\n]*", page, re.IGNORECASE) + + if match: + retVal = match.group(0) + return retVal def findLocalPort(ports): diff --git a/lib/core/settings.py b/lib/core/settings.py index a11d21a86..c06875c3f 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.2.5" +VERSION = "1.4.2.6" 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/lib/parse/html.py b/lib/parse/html.py index a1e412ebf..9f73c519b 100644 --- a/lib/parse/html.py +++ b/lib/parse/html.py @@ -73,6 +73,10 @@ def htmlParser(page): handler = HTMLHandler(page) key = hash(page) + # generic SQL warning/error messages + if re.search(r"SQL (warning|error|syntax)", page, re.I): + handler._markAsErrorPage() + if key in kb.cache.parsedDbms: retVal = kb.cache.parsedDbms[key] if retVal: @@ -89,8 +93,4 @@ def htmlParser(page): kb.cache.parsedDbms[key] = handler.dbms - # generic SQL warning/error messages - if re.search(r"SQL (warning|error|syntax)", page, re.I): - handler._markAsErrorPage() - return handler.dbms