diff --git a/lib/core/option.py b/lib/core/option.py index 9c20768e7..42404a264 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -133,6 +133,7 @@ from lib.core.settings import URI_INJECTABLE_REGEX from lib.core.settings import VERSION_STRING from lib.core.settings import WEBSCARAB_SPLITTER from lib.core.threads import getCurrentThreadData +from lib.core.threads import setDaemon from lib.core.update import update from lib.parse.configfile import configFileParser from lib.parse.payloads import loadBoundaries @@ -1063,6 +1064,7 @@ def _setSocketPreConnect(): socket.socket.connect = connect thread = threading.Thread(target=_) + setDaemon(thread) thread.start() def _setHTTPHandlers(): diff --git a/lib/core/settings.py b/lib/core/settings.py index 2691f78ee..a11bcd0db 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.5.27" +VERSION = "1.0.5.28" REVISION = getRevisionNumber() STABLE = VERSION.count('.') <= 2 VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") diff --git a/sqlmap.py b/sqlmap.py index b6b29102c..775f49358 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -20,6 +20,7 @@ import re import shutil import sys import thread +import threading import time import traceback import warnings @@ -275,6 +276,10 @@ def main(): if conf.get("dumper"): conf.dumper.flush() + if threading.activeCount() > 1: + logger.debug("short delay for thread finalization") + time.sleep(0.5) + # Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program if conf.get("threads", 0) > 1 or conf.get("dnsServer"): os._exit(0)