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

Skip to content

Commit de63238

Browse files
committed
Minor patch for --threads and multi Ctrl-C
1 parent 1824e5b commit de63238

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
19351935
kb.matchRatio = None
19361936
kb.maxConnectionsFlag = False
19371937
kb.mergeCookies = None
1938+
kb.multipleCtrlC = False
19381939
kb.negativeLogic = False
19391940
kb.nullConnection = None
19401941
kb.oldMsf = None

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.8.3"
21+
VERSION = "1.3.8.4"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/threads.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def setDaemon(thread):
114114
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True):
115115
threads = []
116116

117+
kb.multipleCtrlC = False
117118
kb.threadContinue = True
118119
kb.threadException = False
119120
kb.technique = ThreadData.technique
@@ -185,6 +186,7 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
185186
pass
186187

187188
except KeyboardInterrupt:
189+
kb.multipleCtrlC = True
188190
raise SqlmapThreadException("user aborted (Ctrl+C was pressed multiple times)")
189191

190192
if forwardException:
@@ -199,13 +201,15 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
199201
traceback.print_exc()
200202

201203
except:
202-
from lib.core.common import unhandledExceptionMessage
203-
204204
print()
205-
kb.threadException = True
206-
errMsg = unhandledExceptionMessage()
207-
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
208-
traceback.print_exc()
205+
206+
if not kb.multipleCtrlC:
207+
from lib.core.common import unhandledExceptionMessage
208+
209+
kb.threadException = True
210+
errMsg = unhandledExceptionMessage()
211+
logger.error("thread %s: %s" % (threading.currentThread().getName(), errMsg))
212+
traceback.print_exc()
209213

210214
finally:
211215
kb.threadContinue = True

0 commit comments

Comments
 (0)