diff --git a/lib/core/option.py b/lib/core/option.py index 33ec158c3..a39989ad8 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -870,13 +870,16 @@ def _setPreprocessFunctions(): raise SqlmapSyntaxException("cannot import preprocess module '%s' (%s)" % (getUnicode(filename[:-3]), getSafeExString(ex))) for name, function in inspect.getmembers(module, inspect.isfunction): - if name == "preprocess" and inspect.getargspec(function).args and all(_ in inspect.getargspec(function).args for _ in ("req",)): - found = True + try: + if name == "preprocess" and inspect.getargspec(function).args and all(_ in inspect.getargspec(function).args for _ in ("req",)): + found = True - kb.preprocessFunctions.append(function) - function.__name__ = module.__name__ + kb.preprocessFunctions.append(function) + function.__name__ = module.__name__ - break + break + except ValueError: # Note: https://github.com/sqlmapproject/sqlmap/issues/4357 + pass if not found: errMsg = "missing function 'preprocess(req)' " @@ -1525,7 +1528,7 @@ def _createHomeDirectories(): if conf.get("purge"): return - for context in "output", "history": + for context in ("output", "history"): directory = paths["SQLMAP_%s_PATH" % context.upper()] try: if not os.path.isdir(directory): diff --git a/lib/core/settings.py b/lib/core/settings.py index fed68f099..ca7a23534 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.9.22" +VERSION = "1.4.9.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)