Skip to content

Commit d44966b

Browse files
authored
Merge branch 'sqlmapproject:master' into master
2 parents cf3466d + 03be590 commit d44966b

File tree

6 files changed

+25
-22
lines changed

6 files changed

+25
-22
lines changed

data/txt/sha256sums.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ eed1db5da17eca4c65a8f999166e2246eef84397687ae820bbe4984ef65a09df extra/vulnserv
166166
4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/controller/__init__.py
167167
216c9399853b7454d36dcb552baf9f1169ec7942897ddc46504684325cb6ce00 lib/core/agent.py
168168
fbba89420acafcdb9ba1a95428cf2161b13cfa2d1a7ad7d5e70c14b0e04861f0 lib/core/bigarray.py
169-
e3b8f8cf9607d12f3de5e6bcd5031f21f50d4b331844b8e921493dfde2efe0f7 lib/core/common.py
169+
5b21bafe2eb07466d9751f4d80b21f256d5ffb1bb5a9639f91c09a43ec3fec87 lib/core/common.py
170170
d53a8aecab8af8b8da4dc1c74d868f70a38770d34b1fa50cae4532cae7ce1c87 lib/core/compat.py
171171
ebe518089733722879f5a13e73020ebe55d46fb7410cacf292ca4ea1d9d1c56a lib/core/convert.py
172172
ae500647c4074681749735a4f3b17b7eca44868dd3f39f9cab0a575888ba04a1 lib/core/data.py
@@ -189,7 +189,7 @@ c4bfb493a03caf84dd362aec7c248097841de804b7413d0e1ecb8a90c8550bc0 lib/core/readl
189189
d1bd70c1a55858495c727fbec91e30af267459c8f64d50fabf9e4ee2c007e920 lib/core/replication.py
190190
1d0f80b0193ac5204527bfab4bde1a7aee0f693fd008e86b4b29f606d1ef94f3 lib/core/revision.py
191191
d2eb8e4b05ac93551272b3d4abfaf5b9f2d3ac92499a7704c16ed0b4f200db38 lib/core/session.py
192-
48068ae9ed07335458e0b7a8bee9a30ec955dbb32a34804899c801435e0a26ce lib/core/settings.py
192+
1afb5a037ff09316b651650037f8101f601fd6d193ffc052923494248fb041fe lib/core/settings.py
193193
1c5eab9494eb969bc9ce118a2ea6954690c6851cbe54c18373c723b99734bf09 lib/core/shell.py
194194
4eea6dcf023e41e3c64b210cb5c2efc7ca893b727f5e49d9c924f076bb224053 lib/core/subprocessng.py
195195
cdd352e1331c6b535e780f6edea79465cb55af53aa2114dcea0e8bf382e56d1a lib/core/target.py
@@ -221,7 +221,7 @@ fcab35db1da4ac11d8c5b8291f9c87b8d7bb073c460c438374bc5a71ce5c65a6 lib/request/in
221221
03490bed87a54bf6c42a33ac1a66f7f8504c2398534a211e7e9306f408cd506a lib/request/methodrequest.py
222222
eba8b1638c0c19d497dcbab86c9508b2ce870551b16a40db752a13c697d7d267 lib/request/pkihandler.py
223223
6336a6aba124905dab3e5ff67f76cf9b735c2a2879cc3bc8951cb06bea125895 lib/request/rangehandler.py
224-
14b402c3a927b7fb251622c9f4faf507993e033bd3b1cc281fe2873b9a382a51 lib/request/redirecthandler.py
224+
083b961fcd6957c62b00c69d0435eac4612152b8d66e2358cf860a633fb2b0a8 lib/request/redirecthandler.py
225225
3157d66bb021b71b2e71e355b209578d15f83000f0655bcf0cd7c7eed5d4669b lib/request/templates.py
226226
5f5680c5b1db48ed2a13f47ba9de8b816d9d4f7f4c7abd07a48eb7ecbe9cf3ca lib/takeover/abstraction.py
227227
250782249ee5afbcf3f398c596edbc3a9a1b35b3e11ac182678f6e22c1449852 lib/takeover/icmpsh.py
@@ -231,7 +231,7 @@ eba8b1638c0c19d497dcbab86c9508b2ce870551b16a40db752a13c697d7d267 lib/request/pk
231231
479cf4a9c0733ba62bfa764e465a59277d21661647304fa10f6f80bf6ecc518b lib/takeover/udf.py
232232
08270a96d51339f628683bce58ee53c209d3c88a64be39444be5e2f9d98c0944 lib/takeover/web.py
233233
d40d5d1596d975b4ff258a70ad084accfcf445421b08dcf010d36986895e56cb lib/takeover/xp_cmdshell.py
234-
9b3ccafc39f24000a148484a005226b8ba5ac142f141a8bd52160dfc56941538 lib/techniques/blind/inference.py
234+
3a355d277fa558c90fa040b3a02b99690671bf99a7a4ffb20a9a45878b09ab5e lib/techniques/blind/inference.py
235235
4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/techniques/blind/__init__.py
236236
4608f21a4333c162ab3c266c903fda4793cc5834de30d06affe9b7566dd09811 lib/techniques/dns/__init__.py
237237
d20798551d141b3eb0b1c789ee595f776386469ac3f9aeee612fd7a5607b98cd lib/techniques/dns/test.py
@@ -478,7 +478,7 @@ f5cad477023c8145c4db7aa530976fc75b098cf59a49905f28d02f6771fd9697 README.md
478478
535ab6ac8b8441a3758cee86df3e68abec8b43eee54e32777967252057915acc sqlmapapi.py
479479
168309215af7dd5b0b71070e1770e72f1cbb29a3d8025143fb8aa0b88cd56b62 sqlmapapi.yaml
480480
a40607ce164eb2d21865288d24b863edb1c734b56db857e130ac1aef961c80b9 sqlmap.conf
481-
822b706e791eba9b994b08e7600a3adfc3843d360437edfa0bfd588a1f58a13c sqlmap.py
481+
ee57424aa71fbf2d2d1189304f91e95aac812912b7826ea67cfbc07b11aaa6b6 sqlmap.py
482482
82caac95182ac5cae02eb7d8a2dc07e71389aeae6b838d3d3f402c9597eb086a tamper/0eunion.py
483483
bc8f5e638578919e4e75a5b01a84b47456bac0fd540e600975a52408a3433460 tamper/apostrophemask.py
484484
c9c3d71f11de0140906d7b4f24fadb9926dc8eaf5adab864f8106275f05526ce tamper/apostrophenullencode.py

lib/core/common.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,19 +2204,19 @@ def safeStringFormat(format_, params):
22042204
while True:
22052205
match = re.search(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", retVal)
22062206
if match:
2207-
if count >= len(params):
2208-
warnMsg = "wrong number of parameters during string formatting. "
2209-
warnMsg += "Please report by e-mail content \"%r | %r | %r\" to '%s'" % (format_, params, retVal, DEV_EMAIL_ADDRESS)
2210-
raise SqlmapValueException(warnMsg)
2211-
else:
2212-
try:
2213-
retVal = re.sub(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>" % params[count], retVal, 1)
2214-
except re.error:
2215-
retVal = retVal.replace(match.group(0), match.group(0) % params[count], 1)
2216-
count += 1
2207+
try:
2208+
retVal = re.sub(r"(\A|[^A-Za-z0-9])(%s)([^A-Za-z0-9]|\Z)", r"\g<1>%s\g<3>" % params[count % len(params)], retVal, 1)
2209+
except re.error:
2210+
retVal = retVal.replace(match.group(0), match.group(0) % params[count % len(params)], 1)
2211+
count += 1
22172212
else:
22182213
break
22192214

2215+
if count > len(params) and count % len(params):
2216+
warnMsg = "wrong number of parameters during string formatting. "
2217+
warnMsg += "Please report by e-mail content \"%r | %r | %r\" to '%s'" % (format_, params, retVal, DEV_EMAIL_ADDRESS)
2218+
raise SqlmapValueException(warnMsg)
2219+
22202220
retVal = getText(retVal).replace(PARAMETER_PERCENTAGE_MARKER, '%')
22212221

22222222
return retVal

lib/core/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from thirdparty import six
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.9.10.0"
22+
VERSION = "1.9.10.5"
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)
@@ -61,7 +61,7 @@
6161
UPPER_RATIO_BOUND = 0.98
6262

6363
# For filling in case of dumb push updates
64-
DUMMY_JUNK = "ahy9Ouge"
64+
DUMMY_JUNK = "Aich8ooT"
6565

6666
# Markers for special cases when parameter values contain html encoded characters
6767
PARAMETER_AMP_MARKER = "__PARAMETER_AMP__"

lib/request/redirecthandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def _(self, length=None):
194194
result.redurl = getUnicode(redurl) if six.PY3 else redurl
195195
return result
196196

197-
http_error_301 = http_error_303 = http_error_307 = http_error_302
197+
http_error_301 = http_error_303 = http_error_307 = http_error_308 = http_error_302
198198

199199
def _infinite_loop_check(self, req):
200200
if hasattr(req, 'redirect_dict') and (req.redirect_dict.get(req.get_full_url(), 0) >= MAX_SINGLE_URL_REDIRECTIONS or len(req.redirect_dict) >= MAX_TOTAL_REDIRECTIONS):

lib/techniques/blind/inference.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ def tryHint(idx):
221221
markingValue = "'%s'" % CHAR_INFERENCE_MARK
222222
unescapedCharValue = unescaper.escape("'%s'" % decodeIntToUnicode(posValue))
223223
forgedPayload = agent.extractPayload(payload) or ""
224-
forgedPayload = safeStringFormat(forgedPayload.replace(INFERENCE_GREATER_CHAR, INFERENCE_EQUALS_CHAR), (expressionUnescaped, idx, posValue)).replace(markingValue, unescapedCharValue)
224+
forgedPayload = forgedPayload.replace(markingValue, unescapedCharValue)
225+
forgedPayload = safeStringFormat(forgedPayload.replace(INFERENCE_GREATER_CHAR, INFERENCE_EQUALS_CHAR), (expressionUnescaped, idx, posValue))
225226
result = Request.queryPage(agent.replacePayload(payload, forgedPayload), timeBasedCompare=timeBasedCompare, raise404=False)
226227
incrementCounter(getTechnique())
227228

@@ -246,7 +247,8 @@ def validateChar(idx, value):
246247
# e.g.: ... > '%c' -> ... > ORD(..)
247248
markingValue = "'%s'" % CHAR_INFERENCE_MARK
248249
unescapedCharValue = unescaper.escape("'%s'" % decodeIntToUnicode(value))
249-
forgedPayload = safeStringFormat(validationPayload, (expressionUnescaped, idx)).replace(markingValue, unescapedCharValue)
250+
forgedPayload = validationPayload.replace(markingValue, unescapedCharValue)
251+
forgedPayload = safeStringFormat(forgedPayload, (expressionUnescaped, idx))
250252

251253
result = not Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False)
252254

@@ -352,7 +354,8 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
352354
# e.g.: ... > '%c' -> ... > ORD(..)
353355
markingValue = "'%s'" % CHAR_INFERENCE_MARK
354356
unescapedCharValue = unescaper.escape("'%s'" % decodeIntToUnicode(posValue))
355-
forgedPayload = safeStringFormat(payload, (expressionUnescaped, idx)).replace(markingValue, unescapedCharValue)
357+
forgedPayload = payload.replace(markingValue, unescapedCharValue)
358+
forgedPayload = safeStringFormat(forgedPayload, (expressionUnescaped, idx))
356359
falsePayload = safeStringFormat(payload, (expressionUnescaped, idx)).replace(markingValue, NULL)
357360

358361
if timeBasedCompare:

sqlmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ def main():
601601

602602
# short delay for thread finalization
603603
_ = time.time()
604-
while threading.active_count() > 1 and (time.time() - _) > THREAD_FINALIZATION_TIMEOUT:
604+
while threading.active_count() > 1 and (time.time() - _) < THREAD_FINALIZATION_TIMEOUT:
605605
time.sleep(0.01)
606606

607607
if cmdLineOptions.get("sqlmapShell"):

0 commit comments

Comments
 (0)