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

Skip to content

Commit af2f184

Browse files
committed
some comments regarding inference.py
1 parent 6df2d98 commit af2f184

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/techniques/blind/inference.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def tryHint(idx):
144144

145145
return None
146146

147-
def getChar(idx, charTbl=asciiTbl, continuousOrder=True):
147+
def getChar(idx, charTbl=asciiTbl, continuousOrder=True): # continuousOrder means that distance between each two neighbour's numerical values is exactly 1
148148
result = tryHint(idx)
149149

150150
if result:
@@ -190,21 +190,21 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True):
190190

191191
if type(charTbl) != xrange:
192192
charTbl = charTbl[position:]
193-
else:
193+
else: # xrange - extended virtual charset used for memory/space optimization
194194
charTbl = xrange(charTbl[position], charTbl[-1] + 1)
195195
else:
196196
maxValue = posValue
197197

198198
if type(charTbl) != xrange:
199199
charTbl = charTbl[:position]
200-
else:
200+
else: # xrange - extended set (e.g. Unicode)
201201
charTbl = xrange(charTbl[0], charTbl[position])
202202

203203
if len(charTbl) == 1:
204204
if continuousOrder:
205205
if maxValue == 1:
206206
return None
207-
elif minValue == maxChar:
207+
elif minValue == maxChar: # if we hit the maxChar then extend the working set with xrange (virtual charset used because of memory/space optimization) and continue tests with new set
208208
charTbl = xrange(maxChar + 1, (maxChar + 1) << 8)
209209
maxChar = maxValue = charTbl[-1]
210210
minChar = minValue = charTbl[0]
@@ -215,7 +215,7 @@ def getChar(idx, charTbl=asciiTbl, continuousOrder=True):
215215
if minValue == maxChar or maxValue == minChar:
216216
return None
217217

218-
for retVal in (originalTbl[originalTbl.index(minValue)], originalTbl[originalTbl.index(minValue) + 1]):
218+
for retVal in (originalTbl[originalTbl.index(minValue)], originalTbl[originalTbl.index(minValue) + 1]): # if we are working with non-continuous set both minValue and character afterwards are possible candidates
219219
forgedPayload = safeStringFormat(payload.replace('%3E', '%3D'), (expressionUnescaped, idx, retVal))
220220
queriesCount[0] += 1
221221
result = Request.queryPage(urlencode(forgedPayload))

0 commit comments

Comments
 (0)