diff --git a/lib/core/patch.py b/lib/core/patch.py index 432d6a68c..b23651b57 100644 --- a/lib/core/patch.py +++ b/lib/core/patch.py @@ -36,6 +36,8 @@ from lib.request.templates import getPageTemplate from thirdparty import six from thirdparty.six.moves import http_client as _http_client +_rand = 0 + def dirtyPatches(): """ Place for "dirty" Python related patches diff --git a/lib/core/settings.py b/lib/core/settings.py index ac038b010..124ba2a21 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.4.2.19" +VERSION = "1.4.2.20" 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/core/testing.py b/lib/core/testing.py index 0eff43f49..d703d0f59 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -5,8 +5,6 @@ Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ -from __future__ import division - import doctest import logging import os @@ -35,8 +33,6 @@ from lib.core.data import paths from lib.core.data import queries from lib.core.patch import unisonRandom -_rand = 0 - def vulnTest(): """ Runs the testing against 'vulnserver' diff --git a/lib/request/basic.py b/lib/request/basic.py index 15dd04bc2..09d94d2be 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -4,7 +4,6 @@ Copyright (c) 2006-2020 sqlmap developers (http://sqlmap.org/) See the file 'LICENSE' for copying permission """ -from __future__ import print_function import codecs import gzip @@ -239,12 +238,8 @@ def checkCharEncoding(encoding, warn=True): if encoding: try: - _ = getBytes(randomStr()) - print(repr(_)) - print(encoding) - six.text_type(_, encoding) - except Exception as ex: - print(getSafeExString(ex)) + six.text_type(getBytes(randomStr()), encoding) + except: if warn: warnMsg = "invalid web page charset '%s'" % encoding singleTimeLogMessage(warnMsg, logging.WARN, encoding)