From 86ce1c5a5a685546a13b6044e09147ebdb1709e4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 7 May 2019 11:00:50 +0200 Subject: [PATCH] Minor DREI patches --- lib/core/common.py | 4 ++-- lib/core/settings.py | 2 +- lib/request/dns.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index a9d6c6bcb..cdce141ca 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -725,8 +725,8 @@ def paramToDict(place, parameters=None): if value and not value.isdigit(): for encoding in ("hex", "base64"): try: - decoded = value.decode(encoding) - if len(decoded) > MIN_ENCODED_LEN_CHECK and all(_ in string.printable for _ in decoded): + decoded = codecs.decode(value, encoding) + if len(decoded) > MIN_ENCODED_LEN_CHECK and all(_ in getBytes(string.printable) for _ in decoded): warnMsg = "provided parameter '%s' " % parameter warnMsg += "appears to be '%s' encoded" % encoding logger.warn(warnMsg) diff --git a/lib/core/settings.py b/lib/core/settings.py index 9bdd2d232..a88d6cf04 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.3.5.32" +VERSION = "1.3.5.33" 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/request/dns.py b/lib/request/dns.py index 2cff361f6..42004cc9d 100644 --- a/lib/request/dns.py +++ b/lib/request/dns.py @@ -7,6 +7,7 @@ See the file 'LICENSE' for copying permission from __future__ import print_function +import codecs import os import re import socket @@ -78,7 +79,7 @@ class DNSServer(object): try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("", 53)) - s.send("6509012000010000000000010377777706676f6f676c6503636f6d00000100010000291000000000000000".decode("hex")) # A www.google.com + s.send(codecs.decode("6509012000010000000000010377777706676f6f676c6503636f6d00000100010000291000000000000000", "hex")) # A www.google.com response = s.recv(512) except: pass