From 196ac25284a32e368792552426b1f653b3a589dd Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 13 Mar 2019 16:49:41 +0100 Subject: [PATCH] Fixes #3534 --- lib/core/common.py | 4 ++++ lib/core/option.py | 8 ++++---- lib/core/settings.py | 2 +- txt/checksum.md5 | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index a08578a31..304d61140 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1810,6 +1810,10 @@ def normalizePath(filepath): return retVal def safeFilepathEncode(filepath): + """ + Returns filepath in (ASCII) format acceptable for OS handling (e.g. reading) + """ + retVal = filepath if filepath and isinstance(filepath, unicode): diff --git a/lib/core/option.py b/lib/core/option.py index 9c432b739..9309e0353 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -773,7 +773,7 @@ def _setTamperingFunctions(): try: module = __import__(safeFilepathEncode(filename[:-3])) except Exception as ex: - raise SqlmapSyntaxException("cannot import tamper module '%s' (%s)" % (filename[:-3], getSafeExString(ex))) + raise SqlmapSyntaxException("cannot import tamper module '%s' (%s)" % (getUnicode(filename[:-3]), getSafeExString(ex))) priority = PRIORITY.NORMAL if not hasattr(module, "__priority__") else module.__priority__ @@ -807,7 +807,7 @@ def _setTamperingFunctions(): function() except Exception as ex: errMsg = "error occurred while checking dependencies " - errMsg += "for tamper module '%s' ('%s')" % (filename[:-3], getSafeExString(ex)) + errMsg += "for tamper module '%s' ('%s')" % (getUnicode(filename[:-3]), getSafeExString(ex)) raise SqlmapGenericException(errMsg) if not found: @@ -870,7 +870,7 @@ def _setPreprocessFunctions(): try: module = __import__(safeFilepathEncode(filename[:-3])) except Exception as ex: - raise SqlmapSyntaxException("cannot import preprocess module '%s' (%s)" % (filename[:-3], getSafeExString(ex))) + 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 ("page", "headers", "code")): @@ -925,7 +925,7 @@ def _setWafFunctions(): del sys.modules[filename[:-3]] module = __import__(safeFilepathEncode(filename[:-3])) except ImportError as ex: - raise SqlmapSyntaxException("cannot import WAF script '%s' (%s)" % (filename[:-3], getSafeExString(ex))) + raise SqlmapSyntaxException("cannot import WAF script '%s' (%s)" % (getUnicode(filename[:-3]), getSafeExString(ex))) _ = dict(inspect.getmembers(module)) if "detect" not in _: diff --git a/lib/core/settings.py b/lib/core/settings.py index 93adee2b0..0dfd0a6a2 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.3.3.24" +VERSION = "1.3.3.26" 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/txt/checksum.md5 b/txt/checksum.md5 index b43dfbf0d..56cf058aa 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -30,7 +30,7 @@ c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py ed7874be0d2d3802f3d20184f2b280d5 lib/core/agent.py a932126e7d80e545c5d44af178d0bc0c lib/core/bigarray.py -35d8ff12885e0a068c9bff647b51062e lib/core/common.py +fc97b958552d9dd0a12feaf42d570f92 lib/core/common.py de8d27ae6241163ff9e97aa9e7c51a18 lib/core/convert.py abcb1121eb56d3401839d14e8ed06b6e lib/core/data.py f89512ef3ebea85611c5dde6c891b657 lib/core/datatype.py @@ -43,14 +43,14 @@ f89512ef3ebea85611c5dde6c891b657 lib/core/datatype.py fb6be55d21a70765e35549af2484f762 lib/core/__init__.py 18c896b157b03af716542e5fe9233ef9 lib/core/log.py 947f41084e551ff3b7ef7dda2f25ef20 lib/core/optiondict.py -3d950fa87b0affe86322ebeea67840b3 lib/core/option.py +63c5c71af3fd05cd0a1c97dbbe7216b5 lib/core/option.py fe370021c6bc99daf44b2bfc0d1effb3 lib/core/patch.py 4b12aa67fbf6c973d12e54cf9cb54ea0 lib/core/profiling.py d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py 7d8a22c582ad201f65b73225e4456170 lib/core/replication.py 3179d34f371e0295dd4604568fb30bcd lib/core/revision.py d6269c55789f78cf707e09a0f5b45443 lib/core/session.py -abff68fd8e863af65ce39b56d460a173 lib/core/settings.py +21939a4ad6513e9f422f89e3bc39c448 lib/core/settings.py 4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py 10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py d9483455ff80d33a55db46ae2fa34a05 lib/core/target.py