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

Skip to content

Commit 9edd468

Browse files
committed
multithreading save to session on abort
1 parent 6d11f86 commit 9edd468

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

lib/techniques/blind/inference.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,17 @@ def downloadThread():
354354
dataToStdout("\r[%s] [INFO] retrieved: %s" % (time.strftime("%X"), replaceNewlineTabs(output, stdout=True)))
355355
iolock.release()
356356

357+
#TODO: more
358+
if not conf.threadContinue:
359+
if int(threading.currentThread().getName()) == numThreads - 1:
360+
partialValue = unicode()
361+
for v in value:
362+
if isinstance(v, basestring) and v is not None:
363+
partialValue += v
364+
365+
if len(partialValue) > 0:
366+
dataToSessionFile(replaceNewlineTabs(partialValue))
367+
357368
except (sqlmapConnectionException, sqlmapValueException), errMsg:
358369
print
359370
conf.threadException = True
@@ -381,7 +392,7 @@ def downloadThread():
381392

382393
# Start the threads
383394
for numThread in range(numThreads):
384-
thread = threading.Thread(target=downloadThread)
395+
thread = threading.Thread(target=downloadThread, name=str(numThread))
385396
thread.start()
386397
threads.append(thread)
387398

@@ -497,7 +508,6 @@ def downloadThread():
497508
break
498509

499510
finalValue += val
500-
501511
dataToSessionFile(replaceNewlineTabs(val))
502512

503513
if showEta:

0 commit comments

Comments
 (0)