Skip to content

Commit 069c6ac

Browse files
committed
Another update for an Issue sqlmapproject#362
1 parent 8f955b6 commit 069c6ac

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

lib/techniques/blind/inference.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,14 @@ def validateChar(idx, value):
180180
value are not equal there will be a deliberate delay).
181181
"""
182182

183-
forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_NOT_EQUALS_CHAR), (expressionUnescaped, idx, value))
183+
if CHAR_INFERENCE_MARK not in payload:
184+
forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_NOT_EQUALS_CHAR), (expressionUnescaped, idx, value))
185+
else:
186+
# e.g.: ... > '%c' -> ... > ORD(..)
187+
markingValue = "'%s'" % CHAR_INFERENCE_MARK
188+
unescapedCharValue = unescaper.escape("'%s'" % decodeIntToUnicode(value))
189+
forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_NOT_EQUALS_CHAR), (expressionUnescaped, idx)).replace(markingValue, unescapedCharValue)
190+
184191
result = Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False)
185192
incrementCounter(kb.technique)
186193

plugins/dbms/firebird/syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def escaper(value):
2222
if isDBMSVersionAtLeast('2.1'):
2323
retVal = Syntax._escape(expression, quote, escaper)
2424

25-
return retVal
25+
return retVal

plugins/dbms/sqlite/syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ def escaper(value):
2424
if isDBMSVersionAtLeast('3'):
2525
retVal = Syntax._escape(expression, quote, escaper)
2626

27-
return retVal
27+
return retVal

0 commit comments

Comments
 (0)