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

Function columnExistsThread

lib/utils/brute.py:245–278  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

243 threadData.shared.files = []
244
245 def columnExistsThread():
246 threadData = getCurrentThreadData()
247
248 while kb.threadContinue:
249 kb.locks.count.acquire()
250
251 if threadData.shared.count < threadData.shared.limit:
252 column = safeSQLIdentificatorNaming(columns[threadData.shared.count])
253 threadData.shared.count += 1
254 kb.locks.count.release()
255 else:
256 kb.locks.count.release()
257 break
258
259 if Backend.isDbms(DBMS.MCKOI):
260 result = inject.checkBooleanExpression(safeStringFormat("0<(SELECT COUNT(%s) FROM %s)", (column, table)))
261 else:
262 result = inject.checkBooleanExpression(safeStringFormat(BRUTE_COLUMN_EXISTS_TEMPLATE, (column, table)))
263
264 kb.locks.io.acquire()
265
266 if result:
267 threadData.shared.files.append(column)
268
269 if conf.verbose in (1, 2) and not conf.api:
270 clearConsoleLine(True)
271 infoMsg = "[%s] [INFO] retrieved: %s\n" % (time.strftime("%X"), unsafeSQLIdentificatorNaming(column))
272 dataToStdout(infoMsg, True)
273
274 if conf.verbose in (1, 2):
275 status = "%d/%d items (%d%%)" % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
276 dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
277
278 kb.locks.io.release()
279
280 try:
281 runThreads(conf.threads, columnExistsThread, threadChoice=True)

Callers

nothing calls this directly

Calls 9

getCurrentThreadDataFunction · 0.90
safeStringFormatFunction · 0.90
clearConsoleLineFunction · 0.90
dataToStdoutFunction · 0.90
roundFunction · 0.85
isDbmsMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…