|
50 | 50 | from lib.core.convert import hexdecode |
51 | 51 | from lib.core.convert import hexencode |
52 | 52 | from lib.core.convert import utf8encode |
| 53 | +from lib.core.data import conf |
53 | 54 | from lib.core.data import kb |
54 | 55 | from lib.core.data import logger |
55 | 56 | from lib.core.enums import DBMS |
@@ -500,7 +501,15 @@ def dictionaryAttack(attack_dict): |
500 | 501 |
|
501 | 502 | key = hash(repr(item)) |
502 | 503 | if item and key not in keys: |
503 | | - attack_info.append(item) |
| 504 | + resumed = conf.hashDB.retrieve(hash_) |
| 505 | + if not resumed: |
| 506 | + attack_info.append(item) |
| 507 | + else: |
| 508 | + infoMsg = "resuming found '%s' ('%s')" % (resumed, hash_) |
| 509 | + if user and not user.startswith(DUMMY_USER_PREFIX): |
| 510 | + infoMsg += " for user '%s'" % user |
| 511 | + logger.info(infoMsg) |
| 512 | + results.append((user, hash_, resumed)) |
504 | 513 | keys.add(key) |
505 | 514 |
|
506 | 515 | if not attack_info: |
@@ -615,7 +624,9 @@ def dictionaryAttack(attack_dict): |
615 | 624 | process.join() |
616 | 625 |
|
617 | 626 | while not retVal.empty(): |
618 | | - results.append(retVal.get(block=False)) |
| 627 | + _, hash_, word = item = retVal.get(block=False) |
| 628 | + conf.hashDB.write(hash_, word) |
| 629 | + results.append(item) |
619 | 630 |
|
620 | 631 | clearConsoleLine() |
621 | 632 |
|
@@ -689,7 +700,9 @@ class Value(): |
689 | 700 | process.join() |
690 | 701 |
|
691 | 702 | while not retVal.empty(): |
692 | | - results.append(retVal.get(block=False)) |
| 703 | + _, hash_, word = item = retVal.get(block=False) |
| 704 | + conf.hashDB.write(hash_, word) |
| 705 | + results.append(item) |
693 | 706 |
|
694 | 707 | clearConsoleLine() |
695 | 708 |
|
|
0 commit comments