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

Skip to content

Commit 861cdb1

Browse files
committed
cosmetics
1 parent 4513ef4 commit 861cdb1

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,12 @@ def adjust(self):
157157
self.iter = iter(self.custom)
158158
else:
159159
current = self.filenames[self.index]
160-
infoMsg = "loading dictionary from: '%s'" % current
160+
infoMsg = "loading dictionary from '%s'" % current
161161
singleTimeLogMessage(infoMsg)
162162
self.fp = open(current, "r")
163163
self.cursize = os.path.getsize(current)
164164
self.iter = self.fp.xreadlines()
165+
165166
self.index += 1
166167

167168
def append(self, value):

lib/utils/hash.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,26 +368,33 @@ def dictionaryAttack(attack_dict):
368368
if not kb.wordlist:
369369
while not kb.wordlist:
370370
message = "what dictionary do you want to use?\n"
371-
message += "[1] Default (Press Enter)\n"
372-
message += "[2] Custom\n"
373-
message += "[3] File with list of dictionary files"
371+
message += "[1] default dictionary file (press Enter)\n"
372+
message += "[2] custom dictionary file\n"
373+
message += "[3] file with list of dictionary files"
374374
choice = readInput(message, default="1")
375375

376376
try:
377377
if choice == "2":
378378
message = "what's the custom dictionary's location?\n"
379379
dictPaths = [readInput(message)]
380+
381+
logger.info("using custom dictionary")
380382
elif choice == "3":
381383
message = "what's the list file location?\n"
382384
listPath = readInput(message)
383385
checkFile(listPath)
384386
dictPaths = getFileItems(listPath)
387+
388+
logger.info("using custom list of dictionaries")
385389
else:
386-
if hash_regex == HASH.ORACLE_OLD: #it's the slowest of all methods hence smaller default dict
390+
# It is the slowest of all methods hence smaller default dict
391+
if hash_regex == HASH.ORACLE_OLD:
387392
dictPaths = [paths.ORACLE_DEFAULT_PASSWD]
388393
else:
389394
dictPaths = [paths.WORDLIST]
390395

396+
logger.info("using default dictionary")
397+
391398
for dictPath in dictPaths:
392399
checkFile(dictPath)
393400

@@ -452,16 +459,16 @@ def dictionaryAttack(attack_dict):
452459
infoMsg = "[%s] [INFO] found: '%s'" % (time.strftime("%X"), word)
453460

454461
if user and not user.startswith(DUMMY_USER_PREFIX):
455-
infoMsg += " for user: '%s'\n" % user
462+
infoMsg += " for user '%s'\n" % user
456463
else:
457-
infoMsg += " for hash: '%s'\n" % hash_
464+
infoMsg += " for hash '%s'\n" % hash_
458465

459466
dataToStdout(infoMsg, True)
460467

461468
attack_info.remove(item)
462469

463470
elif count % HASH_MOD_ITEM_DISPLAY == 0 or hash_regex in (HASH.ORACLE_OLD) or hash_regex == HASH.CRYPT_GENERIC and IS_WIN:
464-
status = 'current status: %d%s (%s...)' % (kb.wordlist.percentage(), '%', word.ljust(5)[:5])
471+
status = 'current status: %d%s (%s...)' % (kb.wordlist.percentage(), '%', word.ljust(5)[:8])
465472
dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status))
466473

467474
except KeyboardInterrupt:
@@ -513,9 +520,9 @@ def dictionaryAttack(attack_dict):
513520
infoMsg = "[%s] [INFO] found: '%s'" % (time.strftime("%X"), word)
514521

515522
if user and not user.startswith(DUMMY_USER_PREFIX):
516-
infoMsg += " for user: '%s'\n" % user
523+
infoMsg += " for user '%s'\n" % user
517524
else:
518-
infoMsg += " for hash: '%s'\n" % hash_
525+
infoMsg += " for hash '%s'\n" % hash_
519526

520527
dataToStdout(infoMsg, True)
521528

0 commit comments

Comments
 (0)