diff --git a/lib/core/settings.py b/lib/core/settings.py index cd8ef7ee8..83783ce6e 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from thirdparty import six from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.6.4.2" +VERSION = "1.6.4.3" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" 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) diff --git a/lib/core/threads.py b/lib/core/threads.py index 2322e003c..5a264930f 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -119,6 +119,13 @@ def setDaemon(thread): def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True): threads = [] + def _threadFunction(): + try: + threadFunction() + finally: + if conf.hashDB: + conf.hashDB.close() + kb.multipleCtrlC = False kb.threadContinue = True kb.threadException = False @@ -154,14 +161,14 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio infoMsg = "starting %d threads" % numThreads logger.info(infoMsg) else: - threadFunction() + _threadFunction() return kb.multiThreadMode = True # Start the threads 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) diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index 312393795..4ec53185b 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -62,6 +62,7 @@ class HashDB(object): threadData = getCurrentThreadData() try: if threadData.hashDBCursor: + threadData.hashDBCursor.connection.commit() threadData.hashDBCursor.close() threadData.hashDBCursor.connection.close() threadData.hashDBCursor = None