From 04b3aefc5d618d4cb8bbce693ef5b41aed3f620d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 25 May 2016 12:24:36 +0200 Subject: [PATCH] Patch for special character output in U and E techniques --- lib/core/settings.py | 2 +- lib/techniques/error/use.py | 2 +- lib/techniques/union/use.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 1bfb58dac..f84266f88 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.5.63" +VERSION = "1.0.5.64" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") diff --git a/lib/techniques/error/use.py b/lib/techniques/error/use.py index cb7fb7f02..b84e526fa 100644 --- a/lib/techniques/error/use.py +++ b/lib/techniques/error/use.py @@ -229,7 +229,7 @@ def _errorFields(expression, expressionFields, expressionFieldsList, num=None, e if kb.fileReadMode and output and output.strip(): print elif output is not None and not (threadData.resumed and kb.suppressResumeInfo) and not (emptyFields and field in emptyFields): - dataToStdout("[%s] [INFO] %s: %s\n" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", safecharencode(output))) + dataToStdout("[%s] [INFO] %s: %s\n" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", output if kb.safeCharEncode else safecharencode(output))) if isinstance(num, int): expression = origExpr diff --git a/lib/techniques/union/use.py b/lib/techniques/union/use.py index 381cd6584..263d00e5b 100644 --- a/lib/techniques/union/use.py +++ b/lib/techniques/union/use.py @@ -328,7 +328,8 @@ def unionUse(expression, unpack=True, dump=False): del threadData.shared.buffered[0] if conf.verbose == 1 and not (threadData.resumed and kb.suppressResumeInfo) and not threadData.shared.showEta: - status = "[%s] [INFO] %s: %s" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", safecharencode(",".join("\"%s\"" % _ for _ in flattenValue(arrayizeValue(items))) if not isinstance(items, basestring) else items)) + _ = ",".join("\"%s\"" % _ for _ in flattenValue(arrayizeValue(items))) if not isinstance(items, basestring) else items + status = "[%s] [INFO] %s: %s" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", _ if kb.safeCharEncode else safecharencode(_)) if len(status) > width: status = "%s..." % status[:width - 3]