Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c35aff

Browse files
committed
Minor refactoring
1 parent 18d78a3 commit 5c35aff

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.1.11.5"
22+
VERSION = "1.1.11.6"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/techniques/blind/inference.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
110110

111111
if partialValue:
112112
firstChar = len(partialValue)
113-
elif "LENGTH(" in expression.upper() or "LEN(" in expression.upper():
113+
elif re.search(r"(?i)\b(LENGTH|LEN)\(", expression):
114114
firstChar = 0
115115
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())):
116116
firstChar = int(conf.firstChar) - 1
@@ -121,7 +121,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
121121
else:
122122
firstChar = 0
123123

124-
if "LENGTH(" in expression.upper() or "LEN(" in expression.upper():
124+
if re.search(r"(?i)\b(LENGTH|LEN)\(", expression):
125125
lastChar = 0
126126
elif dump and conf.lastChar is not None and (isinstance(conf.lastChar, int) or (isinstance(conf.lastChar, basestring) and conf.lastChar.isdigit())):
127127
lastChar = int(conf.lastChar)
@@ -343,15 +343,15 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
343343
if result:
344344
minValue = posValue
345345

346-
if type(charTbl) != xrange:
346+
if not isinstance(charTbl, xrange):
347347
charTbl = charTbl[position:]
348348
else:
349349
# xrange() - extended virtual charset used for memory/space optimization
350350
charTbl = xrange(charTbl[position], charTbl[-1] + 1)
351351
else:
352352
maxValue = posValue
353353

354-
if type(charTbl) != xrange:
354+
if not isinstance(charTbl, xrange):
355355
charTbl = charTbl[:position]
356356
else:
357357
charTbl = xrange(charTbl[0], charTbl[position])
@@ -390,7 +390,7 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
390390
if timeBasedCompare:
391391
if kb.adjustTimeDelay is not ADJUST_TIME_DELAY.DISABLE:
392392
conf.timeSec += 1
393-
warnMsg = "increasing time delay to %d second%s " % (conf.timeSec, 's' if conf.timeSec > 1 else '')
393+
warnMsg = "increasing time delay to %d second%s" % (conf.timeSec, 's' if conf.timeSec > 1 else '')
394394
logger.warn(warnMsg)
395395

396396
if kb.adjustTimeDelay is ADJUST_TIME_DELAY.YES:

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ec6a778b0e74749b916caead78ba88b7 lib/core/option.py
4646
760d9df2a27ded29109b390ab202e72d lib/core/replication.py
4747
a2466b62e67f8b31736bac4dac590e51 lib/core/revision.py
4848
02d4762140a72fd44668d3dab5eabda9 lib/core/session.py
49-
5cfc263d2081144f63918be068e126e3 lib/core/settings.py
49+
131b671b06a10d4fb46daa6c1b9399c4 lib/core/settings.py
5050
35bffbad762eb9e03db9e93b1c991103 lib/core/shell.py
5151
a59ec28371ae067a6fdd8f810edbee3d lib/core/subprocessng.py
5252
7c9f2af3c0a8dd89223cfe07b0a0b826 lib/core/target.py
@@ -87,7 +87,7 @@ ac3f47b2f8d2cd530512405b4a23a9db lib/takeover/metasploit.py
8787
21b6eff33f5d28c5e167a948976817cb lib/takeover/udf.py
8888
916917ef27d12544fdc68265ba28f70e lib/takeover/web.py
8989
d3080bf68b4b85ed2c98af5de74e8b73 lib/takeover/xp_cmdshell.py
90-
4ec8685f767dc2419e46380320273ff9 lib/techniques/blind/inference.py
90+
ab58650253fdad04e7a53a4e4d36df8a lib/techniques/blind/inference.py
9191
5fb9aaf874daa47ea2b672a22740e56b lib/techniques/blind/__init__.py
9292
5fb9aaf874daa47ea2b672a22740e56b lib/techniques/dns/__init__.py
9393
95331b2826f28db9ff962670391aa7d6 lib/techniques/dns/test.py

0 commit comments

Comments
 (0)