diff --git a/lib/core/settings.py b/lib/core/settings.py index d5615cabc..87da458a1 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.4.3.5" +VERSION = "1.4.3.6" 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/parse/cmdline.py b/lib/parse/cmdline.py index 69d95d892..51460e840 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -761,6 +761,9 @@ def cmdLineParser(argv=None): parser.add_argument("--debug", dest="debug", action="store_true", help=SUPPRESS) + parser.add_argument("--disable-multi", dest="disableMulti", action="store_true", + help=SUPPRESS) + parser.add_argument("--disable-precon", dest="disablePrecon", action="store_true", help=SUPPRESS) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index fff9bdbd6..25e84936f 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -913,6 +913,8 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found proc_count.value -= 1 def dictionaryAttack(attack_dict): + global _multiprocessing + suffix_list = [""] custom_wordlist = [""] hash_regexes = [] @@ -922,6 +924,9 @@ def dictionaryAttack(attack_dict): processException = False foundHash = False + if conf.disableMulti: + _multiprocessing = None + for (_, hashes) in attack_dict.items(): for hash_ in hashes: if not hash_: @@ -1108,7 +1113,7 @@ def dictionaryAttack(attack_dict): else: warnMsg = "multiprocessing hash cracking is currently " - warnMsg += "not supported on this platform" + warnMsg += "%s on this platform" % ("not supported" if not conf.disableMulti else "disabled") singleTimeWarnMessage(warnMsg) retVal = _queue.Queue() @@ -1196,7 +1201,7 @@ def dictionaryAttack(attack_dict): else: warnMsg = "multiprocessing hash cracking is currently " - warnMsg += "not supported on this platform" + warnMsg += "%s on this platform" % ("not supported" if not conf.disableMulti else "disabled") singleTimeWarnMessage(warnMsg) class Value(object): diff --git a/sqlmap.py b/sqlmap.py index 118c51178..57ef3ebef 100755 --- a/sqlmap.py +++ b/sqlmap.py @@ -335,6 +335,12 @@ def main(): logger.critical(errMsg) raise SystemExit + elif all(_ in excMsg for _ in ("Resource temporarily unavailable", "os.fork()", "dictionaryAttack")): + errMsg = "there has been a problem while running the multiprocessing hash cracking. " + errMsg += "Please rerun with option '--threads=1'" + logger.critical(errMsg) + raise SystemExit + elif "can't start new thread" in excMsg: errMsg = "there has been a problem while creating new thread instance. " errMsg += "Please make sure that you are not running too many processes"