From 094cfee30d9de930d48e87b5201057e1b22e8771 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 16 May 2019 01:41:26 +0200 Subject: [PATCH] Couple of minor patches --- lib/core/common.py | 4 +++- lib/core/settings.py | 2 +- lib/utils/har.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 811ce5759..4567b10a1 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -4551,6 +4551,8 @@ def decodeDbmsHexValue(value, raw=False): True >>> decodeDbmsHexValue(['0x31', '0x32']) == [u'1', u'2'] True + >>> decodeDbmsHexValue('5.1.41') == u'5.1.41' + True """ retVal = value @@ -4559,7 +4561,7 @@ def decodeDbmsHexValue(value, raw=False): retVal = value if value and isinstance(value, six.string_types): if len(value) % 2 != 0: - retVal = b"%s?" % decodeHex(value[:-1]) if len(value) > 1 else value + retVal = (decodeHex(value[:-1]) + b'?') if len(value) > 1 else value singleTimeWarnMessage("there was a problem decoding value '%s' from expected hexadecimal form" % value) else: retVal = decodeHex(value) diff --git a/lib/core/settings.py b/lib/core/settings.py index e4e1799e4..939527eeb 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.5.95" +VERSION = "1.3.5.96" 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/utils/har.py b/lib/utils/har.py index 1328ed826..2d9519d09 100644 --- a/lib/utils/har.py +++ b/lib/utils/har.py @@ -154,9 +154,9 @@ class Response: stream = io.BytesIO(raw) first_line = stream.readline() parts = cls.extract_status.search(first_line) - status_line = b"HTTP/1.0 %s %s" % (parts.group(1), parts.group(2)) + status_line = "HTTP/1.0 %s %s" % (getText(parts.group(1)), getText(parts.group(2))) remain = stream.read() - altered = status_line + b"\r\n" + remain + altered = getBytes(status_line) + b"\r\n" + remain comment = first_line response = _http_client.HTTPResponse(FakeSocket(altered))