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

Skip to content

Commit a0c8adc

Browse files
committed
Minor bug fix to add the "hinted" request to the total number of requests performed
Minor layout adjustments.
1 parent 5e86087 commit a0c8adc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/techniques/blind/inference.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,34 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
115115
queriesCount = [0] # As list to deal with nested scoping rules
116116

117117
hintlock = threading.Lock()
118+
118119
def tryHint(idx):
119120
hintlock.acquire()
120121
hintValue = kb.hintValue
121122
hintlock.release()
122-
if hintValue and len(hintValue) >= idx:
123+
124+
if hintValue is not None and len(hintValue) >= idx:
123125
if kb.dbms == "SQLite":
124126
posValue = hintValue[idx-1]
125127
else:
126128
posValue = ord(hintValue[idx-1])
127129

130+
queriesCount[0] += 1
128131
forgedPayload = safeStringFormat(payload.replace('%3E', '%3D'), (expressionUnescaped, idx, posValue))
129132
result = Request.queryPage(urlencode(forgedPayload))
133+
130134
if result:
131135
return hintValue[idx-1]
136+
132137
hintlock.acquire()
133138
kb.hintValue = None
134139
hintlock.release()
140+
135141
return None
136142

137143
def getChar(idx, asciiTbl=asciiTbl):
138144
result = tryHint(idx)
145+
139146
if result:
140147
return result
141148

0 commit comments

Comments
 (0)