mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-10 08:30:36 +03:00
Minor patch for --threads and multi Ctrl-C
This commit is contained in:
parent
1824e5b094
commit
de63238897
|
@ -1935,6 +1935,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
|
||||||
kb.matchRatio = None
|
kb.matchRatio = None
|
||||||
kb.maxConnectionsFlag = False
|
kb.maxConnectionsFlag = False
|
||||||
kb.mergeCookies = None
|
kb.mergeCookies = None
|
||||||
|
kb.multipleCtrlC = False
|
||||||
kb.negativeLogic = False
|
kb.negativeLogic = False
|
||||||
kb.nullConnection = None
|
kb.nullConnection = None
|
||||||
kb.oldMsf = None
|
kb.oldMsf = None
|
||||||
|
|
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
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.3.8.3"
|
VERSION = "1.3.8.4"
|
||||||
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)
|
||||||
|
|
|
@ -114,6 +114,7 @@ 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 = []
|
||||||
|
|
||||||
|
kb.multipleCtrlC = False
|
||||||
kb.threadContinue = True
|
kb.threadContinue = True
|
||||||
kb.threadException = False
|
kb.threadException = False
|
||||||
kb.technique = ThreadData.technique
|
kb.technique = ThreadData.technique
|
||||||
|
@ -185,6 +186,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
pass
|
pass
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
kb.multipleCtrlC = True
|
||||||
raise SqlmapThreadException("user aborted (Ctrl+C was pressed multiple times)")
|
raise SqlmapThreadException("user aborted (Ctrl+C was pressed multiple times)")
|
||||||
|
|
||||||
if forwardException:
|
if forwardException:
|
||||||
|
@ -199,13 +201,15 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
except:
|
except:
|
||||||
from lib.core.common import unhandledExceptionMessage
|
|
||||||
|
|
||||||
print()
|
print()
|
||||||
kb.threadException = True
|
|
||||||
errMsg = unhandledExceptionMessage()
|
if not kb.multipleCtrlC:
|
||||||
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
|
from lib.core.common import unhandledExceptionMessage
|
||||||
traceback.print_exc()
|
|
||||||
|
kb.threadException = True
|
||||||
|
errMsg = unhandledExceptionMessage()
|
||||||
|
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
kb.threadContinue = True
|
kb.threadContinue = True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user