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

Skip to content

Commit 753dcb3

Browse files
committed
minor update
1 parent da51e8a commit 753dcb3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/utils/hash.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def oracle_old_passwd(password, username, uppercase=True): # prior to version '1
180180
>>> oracle_old_passwd(password='tiger', username='scott', uppercase=True)
181181
'F894844C34402B67'
182182
"""
183+
183184
IV, pad = "\0"*8, "\0"
184185

185186
if isinstance(username, unicode):
@@ -239,8 +240,8 @@ def wordpress_passwd(password, salt, count, prefix, uppercase=False):
239240
http://packetstormsecurity.org/files/74448/phpassbrute.py.txt
240241
http://scriptserver.mainframe8.com/wordpress_password_hasher.php
241242
242-
>>> wordpress_passwd(password='testpass', salt='dYPSjeF4', count=2048)
243-
''
243+
>>> wordpress_passwd(password='testpass', salt='aD9ZLmkp', count=2048, prefix='$P$9aD9ZLmkp', uppercase=False)
244+
'$P$9aD9ZLmkpsN4A83G8MefaaP888gVKX0'
244245
"""
245246

246247
def _encode64(input_, count):
@@ -453,6 +454,9 @@ def __bruteProcessVariantA(attack_info, hash_regex, wordlist, suffix, retVal, pr
453454
except KeyboardInterrupt:
454455
raise
455456

457+
except UnicodeEncodeError:
458+
pass # ignore possible encoding problems caused by some words in custom dictionaries
459+
456460
except Exception, ex:
457461
print ex
458462
warnMsg = "there was a problem while hashing entry: %s. " % repr(word)
@@ -516,6 +520,9 @@ def __bruteProcessVariantB(user, hash_, kwargs, hash_regex, wordlist, suffix, re
516520
except KeyboardInterrupt:
517521
raise
518522

523+
except UnicodeEncodeError:
524+
pass # ignore possible encoding problems caused by some words in custom dictionaries
525+
519526
except Exception, ex:
520527
print ex
521528
warnMsg = "there was a problem while hashing entry: %s. " % repr(word)

0 commit comments

Comments
 (0)