diff --git a/lib/core/patch.py b/lib/core/patch.py index b1c5773dd..ada695427 100644 --- a/lib/core/patch.py +++ b/lib/core/patch.py @@ -6,6 +6,7 @@ See the file 'LICENSE' for copying permission """ import codecs +import os import random import lib.controller.checks @@ -76,6 +77,15 @@ def dirtyPatches(): # to prevent too much "guessing" in case of binary data retrieval thirdparty.chardet.universaldetector.MINIMUM_THRESHOLD = 0.90 + # https://github.com/sqlmapproject/sqlmap/issues/4314 + try: + os.urandom(1) + except NotImplemented: + if six.PY3: + os.urandom = lambda size: bytes(random.randint(0, 255) for _ in range(size)) + else: + os.urandom = lambda size: "".join(chr(random.randint(0, 255)) for _ in xrange(size)) + def resolveCrossReferences(): """ Place for cross-reference resolution diff --git a/lib/core/settings.py b/lib/core/settings.py index 8b9a05cd4..d1a5d4dc4 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.8.11" +VERSION = "1.4.8.12" 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)