Skip to content

Commit 9ff2dcf

Browse files
committed
Fixes #2228
1 parent 6c4e9ae commit 9ff2dcf

3 files changed

Lines changed: 9 additions & 5 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.0.10.34"
22+
VERSION = "1.0.10.35"
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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
See the file 'doc/COPYING' for copying permission
66
"""
77

8+
import re
89
import threading
910
import time
1011

@@ -45,6 +46,7 @@
4546
from lib.core.settings import NULL
4647
from lib.core.settings import PARTIAL_HEX_VALUE_MARKER
4748
from lib.core.settings import PARTIAL_VALUE_MARKER
49+
from lib.core.settings import PAYLOAD_DELIMITER
4850
from lib.core.settings import RANDOM_INTEGER_MARKER
4951
from lib.core.settings import VALID_TIME_CHARS_RUN_THRESHOLD
5052
from lib.core.threads import getCurrentThreadData
@@ -201,13 +203,15 @@ def validateChar(idx, value):
201203
Used in inference - in time-based SQLi if original and retrieved value are not equal there will be a deliberate delay
202204
"""
203205

206+
validationPayload = re.sub(r"(%s.*?)%s(.*?%s)" % (PAYLOAD_DELIMITER, INFERENCE_GREATER_CHAR, PAYLOAD_DELIMITER), r"\g<1>%s\g<2>" % INFERENCE_NOT_EQUALS_CHAR, payload)
207+
204208
if "'%s'" % CHAR_INFERENCE_MARK not in payload:
205-
forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_NOT_EQUALS_CHAR), (expressionUnescaped, idx, value))
209+
forgedPayload = safeStringFormat(validationPayload, (expressionUnescaped, idx, value))
206210
else:
207211
# e.g.: ... > '%c' -> ... > ORD(..)
208212
markingValue = "'%s'" % CHAR_INFERENCE_MARK
209213
unescapedCharValue = unescaper.escape("'%s'" % decodeIntToUnicode(value))
210-
forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_NOT_EQUALS_CHAR), (expressionUnescaped, idx)).replace(markingValue, unescapedCharValue)
214+
forgedPayload = safeStringFormat(validationPayload, (expressionUnescaped, idx)).replace(markingValue, unescapedCharValue)
211215

212216
result = not Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False)
213217

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
a63ccc57884b5d715abfeabb595ba32d lib/core/settings.py
48+
ebb5826abf7715ff85c4c55de3f0a12f lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
c3ace7874a536d801f308cf1fd03df99 lib/core/target.py
@@ -86,7 +86,7 @@ cc9c82cfffd8ee9b25ba3af6284f057e lib/takeover/__init__.py
8686
7d6cd7bdfc8f4bc4e8aed60c84cdf87f lib/takeover/udf.py
8787
d9bdcc17091374c53ad2eea7fd72a909 lib/takeover/web.py
8888
9af83a62de360184f1c14e69b8a95cfe lib/takeover/xp_cmdshell.py
89-
27d41f38de7348600309e1cb6741fb2e lib/techniques/blind/inference.py
89+
c066bd01bd02135841e4f6875644ebd2 lib/techniques/blind/inference.py
9090
cc9c82cfffd8ee9b25ba3af6284f057e lib/techniques/blind/__init__.py
9191
cc9c82cfffd8ee9b25ba3af6284f057e lib/techniques/brute/__init__.py
9292
d36effffe64e63ef9b3be490f850e2cc lib/techniques/brute/use.py

0 commit comments

Comments
 (0)