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

Skip to content

Commit 5fd2598

Browse files
committed
Fixes #4136
1 parent 1112019 commit 5fd2598

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

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.4.3.5"
21+
VERSION = "1.4.3.6"
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/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,9 @@ def cmdLineParser(argv=None):
761761
parser.add_argument("--debug", dest="debug", action="store_true",
762762
help=SUPPRESS)
763763

764+
parser.add_argument("--disable-multi", dest="disableMulti", action="store_true",
765+
help=SUPPRESS)
766+
764767
parser.add_argument("--disable-precon", dest="disablePrecon", action="store_true",
765768
help=SUPPRESS)
766769

lib/utils/hash.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,8 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
913913
proc_count.value -= 1
914914

915915
def dictionaryAttack(attack_dict):
916+
global _multiprocessing
917+
916918
suffix_list = [""]
917919
custom_wordlist = [""]
918920
hash_regexes = []
@@ -922,6 +924,9 @@ def dictionaryAttack(attack_dict):
922924
processException = False
923925
foundHash = False
924926

927+
if conf.disableMulti:
928+
_multiprocessing = None
929+
925930
for (_, hashes) in attack_dict.items():
926931
for hash_ in hashes:
927932
if not hash_:
@@ -1108,7 +1113,7 @@ def dictionaryAttack(attack_dict):
11081113

11091114
else:
11101115
warnMsg = "multiprocessing hash cracking is currently "
1111-
warnMsg += "not supported on this platform"
1116+
warnMsg += "%s on this platform" % ("not supported" if not conf.disableMulti else "disabled")
11121117
singleTimeWarnMessage(warnMsg)
11131118

11141119
retVal = _queue.Queue()
@@ -1196,7 +1201,7 @@ def dictionaryAttack(attack_dict):
11961201

11971202
else:
11981203
warnMsg = "multiprocessing hash cracking is currently "
1199-
warnMsg += "not supported on this platform"
1204+
warnMsg += "%s on this platform" % ("not supported" if not conf.disableMulti else "disabled")
12001205
singleTimeWarnMessage(warnMsg)
12011206

12021207
class Value(object):

sqlmap.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,12 @@ def main():
335335
logger.critical(errMsg)
336336
raise SystemExit
337337

338+
elif all(_ in excMsg for _ in ("Resource temporarily unavailable", "os.fork()", "dictionaryAttack")):
339+
errMsg = "there has been a problem while running the multiprocessing hash cracking. "
340+
errMsg += "Please rerun with option '--threads=1'"
341+
logger.critical(errMsg)
342+
raise SystemExit
343+
338344
elif "can't start new thread" in excMsg:
339345
errMsg = "there has been a problem while creating new thread instance. "
340346
errMsg += "Please make sure that you are not running too many processes"

0 commit comments

Comments
 (0)