major speed improvement of hash cracking

This commit is contained in:
Miroslav Stampar 2011-11-02 06:53:43 +00:00
parent b3a57391e4
commit d735582536
2 changed files with 25 additions and 21 deletions

View File

@ -324,7 +324,7 @@ URLENCODE_CHAR_LIMIT = 2000
DEFAULT_MSSQL_SCHEMA = 'dbo'
# Display hash attack info every mod number of items
HASH_MOD_ITEM_DISPLAY = 1597
HASH_MOD_ITEM_DISPLAY = 11
# Maximum integer value
MAX_INT = sys.maxint

View File

@ -344,6 +344,7 @@ def hashRecognition(value):
def __bruteProcessVariantA(attack_info, hash_regex, wordlist, suffix, retVal, proc_id, proc_count):
count = 0
rotator = 0
hashes = set([item[0][1] for item in attack_info])
try:
for word in wordlist:
@ -359,11 +360,14 @@ def __bruteProcessVariantA(attack_info, hash_regex, wordlist, suffix, retVal, pr
try:
current = __functions__[hash_regex](password = word, uppercase = False)
count += 1
if current in hashes:
continue
for item in list(attack_info):
((user, hash_), _) = item
count += 1
if hash_ == current:
retVal.put((user, hash_, word))
@ -380,7 +384,7 @@ def __bruteProcessVariantA(attack_info, hash_regex, wordlist, suffix, retVal, pr
attack_info.remove(item)
elif proc_id == 0 and count % HASH_MOD_ITEM_DISPLAY == 0 or hash_regex in (HASH.ORACLE_OLD) or hash_regex == HASH.CRYPT_GENERIC and IS_WIN:
elif proc_id == 0 and count % HASH_MOD_ITEM_DISPLAY == 0 or hash_regex == HASH.ORACLE_OLD or hash_regex == HASH.CRYPT_GENERIC and IS_WIN:
rotator += 1
if rotator >= len(ROTATING_CHARS):
rotator = 0
@ -436,7 +440,7 @@ def __bruteProcessVariantB(user, hash_, kwargs, hash_regex, wordlist, suffix, re
dataToStdout(infoMsg, True)
found.value = True
elif proc_id == 0 and count % HASH_MOD_ITEM_DISPLAY == 0 or hash_regex in (HASH.ORACLE_OLD) or hash_regex == HASH.CRYPT_GENERIC and IS_WIN:
elif proc_id == 0 and count % HASH_MOD_ITEM_DISPLAY == 0 or hash_regex == HASH.ORACLE_OLD or hash_regex == HASH.CRYPT_GENERIC and IS_WIN:
rotator += 1
if rotator >= len(ROTATING_CHARS):
rotator = 0