From a8a6dce38bfbb593ca8e91c5a3e0be9a532b0e90 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 21 Jan 2017 23:09:15 +0100 Subject: [PATCH] Fixes #2366 --- lib/core/option.py | 22 +++++++++++++--------- lib/core/settings.py | 2 +- txt/checksum.md5 | 4 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 588800af4..dc0530b14 100755 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -899,18 +899,22 @@ def _setTamperingFunctions(): script = script.strip().encode(sys.getfilesystemencoding() or UNICODE_ENCODING) - if not script: - continue + try: + if not script: + continue - elif os.path.exists(os.path.join(paths.SQLMAP_TAMPER_PATH, script if script.endswith(".py") else "%s.py" % script)): - script = os.path.join(paths.SQLMAP_TAMPER_PATH, script if script.endswith(".py") else "%s.py" % script) + elif os.path.exists(os.path.join(paths.SQLMAP_TAMPER_PATH, script if script.endswith(".py") else "%s.py" % script)): + script = os.path.join(paths.SQLMAP_TAMPER_PATH, script if script.endswith(".py") else "%s.py" % script) - elif not os.path.exists(script): - errMsg = "tamper script '%s' does not exist" % script - raise SqlmapFilePathException(errMsg) + elif not os.path.exists(script): + errMsg = "tamper script '%s' does not exist" % script + raise SqlmapFilePathException(errMsg) - elif not script.endswith(".py"): - errMsg = "tamper script '%s' should have an extension '.py'" % script + elif not script.endswith(".py"): + errMsg = "tamper script '%s' should have an extension '.py'" % script + raise SqlmapSyntaxException(errMsg) + except UnicodeDecodeError: + errMsg = "invalid character provided in option '--tamper'" raise SqlmapSyntaxException(errMsg) dirname, filename = os.path.split(script) diff --git a/lib/core/settings.py b/lib/core/settings.py index c28b9ec0a..6e95a01ea 100755 --- 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.1.1.14" +VERSION = "1.1.1.15" 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 5dfea895d..17d616dd5 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -39,13 +39,13 @@ a8143dab9d3a27490f7d49b6b29ea530 lib/core/data.py 310efc965c862cfbd7b0da5150a5ad36 lib/core/__init__.py 9ba39bf66e9ecd469446bdbbeda906c3 lib/core/log.py e544108e2238d756c94a240e8a1ce061 lib/core/optiondict.py -44a61841bcd0bafc4151e31d5a14287d lib/core/option.py +796eb85d5f6e7657e40d584c018d6f5b lib/core/option.py 5f2f56e6c5f274408df61943f1e080c0 lib/core/profiling.py 40be71cd774662a7b420caeb7051e7d5 lib/core/readlineng.py d8e9250f3775119df07e9070eddccd16 lib/core/replication.py 785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py 40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py -2ce52e30cd8111887675e4b847b0a076 lib/core/settings.py +615c9fe6c1ce36972c77f313d8d331e1 lib/core/settings.py d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py 2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py afd0636d2e93c23f4f0a5c9b6023ea17 lib/core/target.py