This commit is contained in:
Miroslav Stampar 2022-04-06 22:41:12 +02:00
parent d5fb92ee42
commit 52f2faf2cf
3 changed files with 11 additions and 3 deletions

View File

@ -20,7 +20,7 @@ from thirdparty import six
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.6.4.2" VERSION = "1.6.4.3"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -119,6 +119,13 @@ def setDaemon(thread):
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True): def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True):
threads = [] threads = []
def _threadFunction():
try:
threadFunction()
finally:
if conf.hashDB:
conf.hashDB.close()
kb.multipleCtrlC = False kb.multipleCtrlC = False
kb.threadContinue = True kb.threadContinue = True
kb.threadException = False kb.threadException = False
@ -154,14 +161,14 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
infoMsg = "starting %d threads" % numThreads infoMsg = "starting %d threads" % numThreads
logger.info(infoMsg) logger.info(infoMsg)
else: else:
threadFunction() _threadFunction()
return return
kb.multiThreadMode = True kb.multiThreadMode = True
# Start the threads # Start the threads
for numThread in xrange(numThreads): for numThread in xrange(numThreads):
thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[threadFunction]) thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[_threadFunction])
setDaemon(thread) setDaemon(thread)

View File

@ -62,6 +62,7 @@ class HashDB(object):
threadData = getCurrentThreadData() threadData = getCurrentThreadData()
try: try:
if threadData.hashDBCursor: if threadData.hashDBCursor:
threadData.hashDBCursor.connection.commit()
threadData.hashDBCursor.close() threadData.hashDBCursor.close()
threadData.hashDBCursor.connection.close() threadData.hashDBCursor.connection.close()
threadData.hashDBCursor = None threadData.hashDBCursor = None