MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / tryHint

Function tryHint

lib/techniques/blind/inference.py:211–235  ·  view source on GitHub ↗
(idx)

Source from the content-addressed store, hash-verified

209 dataToStdout("\r[%s] [INFO] retrieved: " % time.strftime("%X"))
210
211 def tryHint(idx):
212 with kb.locks.hint:
213 hintValue = kb.hintValue
214
215 if payload is not None and len(hintValue or "") > 0 and len(hintValue) >= idx:
216 if "'%s'" % CHAR_INFERENCE_MARK in payload:
217 posValue = hintValue[idx - 1]
218 else:
219 posValue = ord(hintValue[idx - 1])
220
221 markingValue = "'%s'" % CHAR_INFERENCE_MARK
222 unescapedCharValue = unescaper.escape("'%s'" % decodeIntToUnicode(posValue))
223 forgedPayload = agent.extractPayload(payload) or ""
224 forgedPayload = forgedPayload.replace(markingValue, unescapedCharValue)
225 forgedPayload = safeStringFormat(forgedPayload.replace(INFERENCE_GREATER_CHAR, INFERENCE_EQUALS_CHAR), (expressionUnescaped, idx, posValue))
226 result = Request.queryPage(agent.replacePayload(payload, forgedPayload), timeBasedCompare=timeBasedCompare, raise404=False)
227 incrementCounter(getTechnique())
228
229 if result:
230 return hintValue[idx - 1]
231
232 with kb.locks.hint:
233 kb.hintValue = ""
234
235 return None
236
237 def validateChar(idx, value):
238 """

Callers 1

getCharFunction · 0.85

Calls 9

decodeIntToUnicodeFunction · 0.90
safeStringFormatFunction · 0.90
incrementCounterFunction · 0.90
getTechniqueFunction · 0.90
extractPayloadMethod · 0.80
queryPageMethod · 0.80
replacePayloadMethod · 0.80
escapeMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…