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

Function fileExistsThread

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

Source from the content-addressed store, hash-verified

354 threadData.shared.files = []
355
356 def fileExistsThread():
357 threadData = getCurrentThreadData()
358
359 while kb.threadContinue:
360 kb.locks.count.acquire()
361 if threadData.shared.count < threadData.shared.limit:
362 path = ntToPosixSlashes(paths[threadData.shared.count])
363 threadData.shared.count += 1
364 kb.locks.count.release()
365 else:
366 kb.locks.count.release()
367 break
368
369 try:
370 result = unArrayizeValue(conf.dbmsHandler.readFile(path))
371 except SqlmapNoneDataException:
372 result = None
373
374 kb.locks.io.acquire()
375
376 if not isNoneValue(result):
377 threadData.shared.files.append(result)
378
379 if not conf.api:
380 clearConsoleLine(True)
381 infoMsg = "[%s] [INFO] retrieved: '%s'\n" % (time.strftime("%X"), path)
382 dataToStdout(infoMsg, True)
383
384 if conf.verbose in (1, 2):
385 status = '%d/%d items (%d%%)' % (threadData.shared.count, threadData.shared.limit, round(100.0 * threadData.shared.count / threadData.shared.limit))
386 dataToStdout("\r[%s] [INFO] tried %s" % (time.strftime("%X"), status), True)
387
388 kb.locks.io.release()
389
390 try:
391 runThreads(conf.threads, fileExistsThread, threadChoice=True)

Callers

nothing calls this directly

Calls 9

getCurrentThreadDataFunction · 0.90
ntToPosixSlashesFunction · 0.90
unArrayizeValueFunction · 0.90
isNoneValueFunction · 0.90
clearConsoleLineFunction · 0.90
dataToStdoutFunction · 0.90
roundFunction · 0.85
readFileMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…