From 77e1b99a2c11ff3758c1102f24856f50ebb8afa6 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 5 Jun 2019 10:37:11 +0200 Subject: [PATCH] Fixes #3739 --- data/xml/queries.xml | 2 +- lib/core/settings.py | 2 +- lib/core/testing.py | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/data/xml/queries.xml b/data/xml/queries.xml index e0c56ae74..db50087b3 100644 --- a/data/xml/queries.xml +++ b/data/xml/queries.xml @@ -421,7 +421,7 @@ - + diff --git a/lib/core/settings.py b/lib/core/settings.py index 4e003baa9..007e77c34 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.16" +VERSION = "1.3.6.17" 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/core/testing.py b/lib/core/testing.py index 20f6e53e0..c63f82c5a 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -36,6 +36,7 @@ from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core.data import paths +from lib.core.data import queries from lib.core.enums import MKSTEMP_PREFIX from lib.core.exception import SqlmapBaseException from lib.core.exception import SqlmapNotVulnerableException @@ -183,6 +184,27 @@ def smokeTest(): status = '%d/%d (%d%%) ' % (count, length, round(100.0 * count / length)) dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status)) + def _(node): + for __ in dir(node): + if not __.startswith('_'): + candidate = getattr(node, __) + if isinstance(candidate, str): + if '\\' in candidate: + try: + re.compile(candidate) + except: + errMsg = "smoke test failed at compiling '%s'" % candidate + logger.error(errMsg) + raise + else: + _(candidate) + + for dbms in queries: + try: + _(queries[dbms]) + except: + retVal = False + clearConsoleLine() if retVal: logger.info("smoke test final result: PASSED")