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

Skip to content

Commit f4e410d

Browse files
committed
minor fix
1 parent 1ec56f9 commit f4e410d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/techniques/blind/inference.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def validateChar(idx, value):
179179

180180
return not result
181181

182-
def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is None, shiftTable=None):
182+
def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None, shiftTable=None):
183183
"""
184184
continuousOrder means that distance between each two neighbour's
185185
numerical values is exactly 1
@@ -190,6 +190,9 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N
190190
if result:
191191
return result
192192

193+
if charTbl is None:
194+
charTbl = list(asciiTbl)
195+
193196
originalTbl = list(charTbl)
194197

195198
if continuousOrder and shiftTable is None:
@@ -199,7 +202,10 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True, expand=charsetType is N
199202
if CHAR_INFERENCE_MARK in payload and ord('\n') in charTbl:
200203
charTbl.remove(ord('\n'))
201204

202-
if len(charTbl) == 1:
205+
if not charTbl:
206+
return None
207+
208+
elif len(charTbl) == 1:
203209
forgedPayload = safeStringFormat(payload.replace(INFERENCE_GREATER_CHAR, INFERENCE_EQUALS_CHAR), (expressionUnescaped, idx, charTbl[0]))
204210
result = Request.queryPage(forgedPayload, timeBasedCompare=timeBasedCompare, raise404=False)
205211
incrementCounter(kb.technique)

0 commit comments

Comments
 (0)