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

Function _errorFields

lib/techniques/error/use.py:227–270  ·  view source on GitHub ↗
(expression, expressionFields, expressionFieldsList, num=None, emptyFields=None, suppressOutput=False)

Source from the content-addressed store, hash-verified

225 return safecharencode(retVal) if kb.safeCharEncode else retVal
226
227def _errorFields(expression, expressionFields, expressionFieldsList, num=None, emptyFields=None, suppressOutput=False):
228 values = []
229 origExpr = None
230
231 width = getConsoleWidth()
232 threadData = getCurrentThreadData()
233
234 for field in expressionFieldsList:
235 output = None
236
237 if field.startswith("ROWNUM "):
238 continue
239
240 if isinstance(num, int):
241 origExpr = expression
242 expression = agent.limitQuery(num, expression, field, expressionFieldsList[0])
243
244 if "ROWNUM" in expressionFieldsList:
245 expressionReplaced = expression
246 else:
247 expressionReplaced = expression.replace(expressionFields, field, 1)
248
249 output = NULL if emptyFields and field in emptyFields else _oneShotErrorUse(expressionReplaced, field)
250
251 if not kb.threadContinue:
252 return None
253
254 if not any((suppressOutput, kb.bruteMode)):
255 if kb.fileReadMode and output and output.strip():
256 print()
257 elif output is not None and not (threadData.resumed and kb.suppressResumeInfo) and not (emptyFields and field in emptyFields):
258 status = "[%s] [INFO] %s: '%s'" % (time.strftime("%X"), "resumed" if threadData.resumed else "retrieved", output if kb.safeCharEncode else safecharencode(output))
259
260 if len(status) > width and not conf.noTruncate:
261 status = "%s..." % status[:width - 3]
262
263 dataToStdout("%s\n" % status)
264
265 if isinstance(num, int):
266 expression = origExpr
267
268 values.append(output)
269
270 return values
271
272def _errorReplaceChars(value):
273 """

Callers 2

errorThreadFunction · 0.85
errorUseFunction · 0.85

Calls 8

getConsoleWidthFunction · 0.90
getCurrentThreadDataFunction · 0.90
safecharencodeFunction · 0.90
dataToStdoutFunction · 0.90
_oneShotErrorUseFunction · 0.85
limitQueryMethod · 0.80
replaceMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…