mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-29 13:03:50 +03:00
Writing only unique hashes to an output file (for eventual cracking with 3rd party tools)
This commit is contained in:
parent
b9f6fc5f4e
commit
ef33729381
|
@ -312,15 +312,23 @@ def storeHashesToFile(attack_dict):
|
||||||
warnMsg += "for eventual further processing with other tools"
|
warnMsg += "for eventual further processing with other tools"
|
||||||
logger.warn(warnMsg)
|
logger.warn(warnMsg)
|
||||||
|
|
||||||
|
items = set()
|
||||||
|
|
||||||
with open(filename, "w+") as f:
|
with open(filename, "w+") as f:
|
||||||
for user, hashes in attack_dict.items():
|
for user, hashes in attack_dict.items():
|
||||||
for hash_ in hashes:
|
for hash_ in hashes:
|
||||||
if not hash_ or hash_ == NULL or not hashRecognition(hash_):
|
if not hash_ or hash_ == NULL or not hashRecognition(hash_):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
item = None
|
||||||
if user and not user.startswith(DUMMY_USER_PREFIX):
|
if user and not user.startswith(DUMMY_USER_PREFIX):
|
||||||
f.write("%s:%s\n" % (user.encode(UNICODE_ENCODING), hash_.encode(UNICODE_ENCODING)))
|
item = "%s:%s\n" % (user.encode(UNICODE_ENCODING), hash_.encode(UNICODE_ENCODING))
|
||||||
else:
|
else:
|
||||||
f.write("%s\n" % hash_.encode(UNICODE_ENCODING))
|
item = "%s\n" % hash_.encode(UNICODE_ENCODING)
|
||||||
|
|
||||||
|
if item and item not in items:
|
||||||
|
f.write(item)
|
||||||
|
items.add(item)
|
||||||
|
|
||||||
def attackCachedUsersPasswords():
|
def attackCachedUsersPasswords():
|
||||||
if kb.data.cachedUsersPasswords:
|
if kb.data.cachedUsersPasswords:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user