mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-07 05:01:30 +00:00
Fixes #2495
This commit is contained in:
@@ -529,7 +529,7 @@ def hashRecognition(value):
|
||||
|
||||
return retVal
|
||||
|
||||
def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc_count, wordlists, custom_wordlist):
|
||||
def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc_count, wordlists, custom_wordlist, api):
|
||||
if IS_WIN:
|
||||
coloramainit()
|
||||
|
||||
@@ -583,7 +583,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
|
||||
|
||||
status = 'current status: %s... %s' % (word.ljust(5)[:5], ROTATING_CHARS[rotator])
|
||||
|
||||
if not conf.api:
|
||||
if not api:
|
||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status))
|
||||
|
||||
except KeyboardInterrupt:
|
||||
@@ -605,7 +605,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
|
||||
with proc_count.get_lock():
|
||||
proc_count.value -= 1
|
||||
|
||||
def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found, proc_id, proc_count, wordlists, custom_wordlist):
|
||||
def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found, proc_id, proc_count, wordlists, custom_wordlist, api):
|
||||
if IS_WIN:
|
||||
coloramainit()
|
||||
|
||||
@@ -657,7 +657,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
|
||||
if user and not user.startswith(DUMMY_USER_PREFIX):
|
||||
status += ' (user: %s)' % user
|
||||
|
||||
if not conf.api:
|
||||
if not api:
|
||||
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status))
|
||||
|
||||
except KeyboardInterrupt:
|
||||
@@ -842,12 +842,12 @@ def dictionaryAttack(attack_dict):
|
||||
count = _multiprocessing.Value('i', _multiprocessing.cpu_count())
|
||||
|
||||
for i in xrange(_multiprocessing.cpu_count()):
|
||||
p = _multiprocessing.Process(target=_bruteProcessVariantA, args=(attack_info, hash_regex, suffix, retVal, i, count, kb.wordlists, custom_wordlist))
|
||||
processes.append(p)
|
||||
process = _multiprocessing.Process(target=_bruteProcessVariantA, args=(attack_info, hash_regex, suffix, retVal, i, count, kb.wordlists, custom_wordlist, conf.api))
|
||||
processes.append(process)
|
||||
|
||||
for p in processes:
|
||||
p.daemon = True
|
||||
p.start()
|
||||
for process in processes:
|
||||
process.daemon = True
|
||||
process.start()
|
||||
|
||||
while count.value > 0:
|
||||
time.sleep(0.5)
|
||||
@@ -858,7 +858,7 @@ def dictionaryAttack(attack_dict):
|
||||
singleTimeWarnMessage(warnMsg)
|
||||
|
||||
retVal = Queue()
|
||||
_bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, 0, 1, kb.wordlists, custom_wordlist)
|
||||
_bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, 0, 1, kb.wordlists, custom_wordlist, conf.api)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print
|
||||
@@ -926,12 +926,12 @@ def dictionaryAttack(attack_dict):
|
||||
count = _multiprocessing.Value('i', _multiprocessing.cpu_count())
|
||||
|
||||
for i in xrange(_multiprocessing.cpu_count()):
|
||||
p = _multiprocessing.Process(target=_bruteProcessVariantB, args=(user, hash_, kwargs, hash_regex, suffix, retVal, found_, i, count, kb.wordlists, custom_wordlist))
|
||||
processes.append(p)
|
||||
process = _multiprocessing.Process(target=_bruteProcessVariantB, args=(user, hash_, kwargs, hash_regex, suffix, retVal, found_, i, count, kb.wordlists, custom_wordlist, conf.api))
|
||||
processes.append(process)
|
||||
|
||||
for p in processes:
|
||||
p.daemon = True
|
||||
p.start()
|
||||
for process in processes:
|
||||
process.daemon = True
|
||||
process.start()
|
||||
|
||||
while count.value > 0:
|
||||
time.sleep(0.5)
|
||||
@@ -950,7 +950,7 @@ def dictionaryAttack(attack_dict):
|
||||
found_ = Value()
|
||||
found_.value = False
|
||||
|
||||
_bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found_, 0, 1, kb.wordlists, custom_wordlist)
|
||||
_bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found_, 0, 1, kb.wordlists, custom_wordlist, conf.api)
|
||||
|
||||
found = found_.value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user