From 5c35aff22ac50c44354d7dc82711725561ea01ac Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 8 Nov 2017 15:47:12 +0100 Subject: [PATCH] Minor refactoring --- lib/core/settings.py | 2 +- lib/techniques/blind/inference.py | 10 +++++----- txt/checksum.md5 | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 724e20358..d083f09ea 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.1.11.5" +VERSION = "1.1.11.6" 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/techniques/blind/inference.py b/lib/techniques/blind/inference.py index 1b49b9cc7..afa88ea38 100644 --- a/lib/techniques/blind/inference.py +++ b/lib/techniques/blind/inference.py @@ -110,7 +110,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if partialValue: firstChar = len(partialValue) - elif "LENGTH(" in expression.upper() or "LEN(" in expression.upper(): + elif re.search(r"(?i)\b(LENGTH|LEN)\(", expression): firstChar = 0 elif (kb.fileReadMode or dump) and conf.firstChar is not None and (isinstance(conf.firstChar, int) or (isinstance(conf.firstChar, basestring) and conf.firstChar.isdigit())): firstChar = int(conf.firstChar) - 1 @@ -121,7 +121,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None else: firstChar = 0 - if "LENGTH(" in expression.upper() or "LEN(" in expression.upper(): + if re.search(r"(?i)\b(LENGTH|LEN)\(", expression): lastChar = 0 elif dump and conf.lastChar is not None and (isinstance(conf.lastChar, int) or (isinstance(conf.lastChar, basestring) and conf.lastChar.isdigit())): lastChar = int(conf.lastChar) @@ -343,7 +343,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if result: minValue = posValue - if type(charTbl) != xrange: + if not isinstance(charTbl, xrange): charTbl = charTbl[position:] else: # xrange() - extended virtual charset used for memory/space optimization @@ -351,7 +351,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None else: maxValue = posValue - if type(charTbl) != xrange: + if not isinstance(charTbl, xrange): charTbl = charTbl[:position] else: charTbl = xrange(charTbl[0], charTbl[position]) @@ -390,7 +390,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None if timeBasedCompare: if kb.adjustTimeDelay is not ADJUST_TIME_DELAY.DISABLE: conf.timeSec += 1 - warnMsg = "increasing time delay to %d second%s " % (conf.timeSec, 's' if conf.timeSec > 1 else '') + warnMsg = "increasing time delay to %d second%s" % (conf.timeSec, 's' if conf.timeSec > 1 else '') logger.warn(warnMsg) if kb.adjustTimeDelay is ADJUST_TIME_DELAY.YES: diff --git a/txt/checksum.md5 b/txt/checksum.md5 index fd3d736db..56e1f796a 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -46,7 +46,7 @@ ec6a778b0e74749b916caead78ba88b7 lib/core/option.py 760d9df2a27ded29109b390ab202e72d lib/core/replication.py a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py 02d4762140a72fd44668d3dab5eabda9 lib/core/session.py -5cfc263d2081144f63918be068e126e3 lib/core/settings.py +131b671b06a10d4fb46daa6c1b9399c4 lib/core/settings.py 35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py 7c9f2af3c0a8dd89223cfe07b0a0b826 lib/core/target.py @@ -87,7 +87,7 @@ ac3f47b2f8d2cd530512405b4a23a9db lib/takeover/metasploit.py 21b6eff33f5d28c5e167a948976817cb lib/takeover/udf.py 916917ef27d12544fdc68265ba28f70e lib/takeover/web.py d3080bf68b4b85ed2c98af5de74e8b73 lib/takeover/xp_cmdshell.py -4ec8685f767dc2419e46380320273ff9 lib/techniques/blind/inference.py +ab58650253fdad04e7a53a4e4d36df8a lib/techniques/blind/inference.py 5fb9aaf874daa47ea2b672a22740e56b lib/techniques/blind/__init__.py 5fb9aaf874daa47ea2b672a22740e56b lib/techniques/dns/__init__.py 95331b2826f28db9ff962670391aa7d6 lib/techniques/dns/test.py