Exemple #1
0
                        os.urandom(int(opt.useURandomSaltAndRandomPlacement))
                    ), random.choice(["front", "back"])
                    LOGGER.info(
                        "Using urandom salt: '{}' on the {} of the hash...".
                        format(salt, placement))

                # No salt or placement
                else:
                    salt, placement = None, None

                # Bruteforce this shit
                if opt.bruteforceCrack is True and opt.hashToCrack is not None and opt.hashListToCrack is None:
                    try:
                        bruteforce_main(opt.hashToCrack,
                                        algorithm=opt.algToUse,
                                        wordlist=opt.wordListToUse,
                                        salt=salt,
                                        placement=placement)
                    except Exception as e:
                        LOGGER.fatal("{} failed with error code: '{}'".format(
                            os.path.basename(__file__), e))

                # Bruteforce a list of hashes
                elif opt.bruteforceCrack is True and opt.hashListToCrack is not None and opt.hashToCrack is None:
                    try:
                        with open(opt.hashListToCrack) as hashes:
                            for i, hash_to_crack in enumerate(
                                    hashes.readlines(), start=1):
                                crack_or_not = prompt(
                                    "Attempt to crack: '{}'".format(
                                        hash_to_crack.strip()), "y/N")
Exemple #2
0
                    LOGGER.info(
                        "Using urandom salt: '{}' on the '{}' of the hash...".
                        format(salt, placement))

                # No salt or placement
                else:
                    salt, placement = None, None

                # Bruteforce this shit
                if opt.bruteforceCrack and opt.hashToCrack is not None and opt.hashListToCrack is None:
                    try:
                        bruteforce_main(opt.hashToCrack,
                                        algorithm=algorithm_pointers(
                                            opt.algToUse),
                                        wordlist=opt.wordListToUse,
                                        salt=salt,
                                        placement=placement,
                                        posx=opt.returnThisPartOfHash,
                                        use_hex=opt.useHexCodeNotHash,
                                        verbose=opt.runInVerbose)
                    except Exception as e:
                        LOGGER.fatal("{} failed with error code: '{}'".format(
                            os.path.basename(__file__), e.message))

                # Bruteforce a list of hashes
                elif opt.bruteforceCrack and opt.hashListToCrack is not None and opt.hashToCrack is None:
                    try:
                        with open(opt.hashListToCrack) as hashes:
                            for i, hash_to_crack in enumerate(
                                    hashes.readlines(), start=1):
                                if opt.runInBatchMode:
Exemple #3
0
                    ), random.choice(["front", "back"])
                    LOGGER.info(
                        "Using urandom salt: '{}' on the {} of the hash...".
                        format(salt, placement))

                # No salt or placement
                else:
                    salt, placement = None, None

                # Bruteforce this shit
                if opt.bruteforceCrack is True and opt.hashToCrack is not None and opt.hashListToCrack is None:
                    try:
                        bruteforce_main(opt.hashToCrack,
                                        algorithm=algorithm_pointers(
                                            opt.algToUse),
                                        wordlist=opt.wordListToUse,
                                        salt=salt,
                                        placement=placement,
                                        posx=opt.returnThisPartOfHash)
                    except Exception as e:
                        LOGGER.fatal("{} failed with error code: '{}'".format(
                            os.path.basename(__file__), e))

                # Bruteforce a list of hashes
                elif opt.bruteforceCrack is True and opt.hashListToCrack is not None and opt.hashToCrack is None:
                    try:
                        with open(opt.hashListToCrack) as hashes:
                            for i, hash_to_crack in enumerate(
                                    hashes.readlines(), start=1):
                                crack_or_not = prompt(
                                    "Attempt to crack: '{}'".format(
Exemple #4
0
 if opt.useRounds is not None and opt.useRounds > DEFAULT_ROUNDS:
     LOGGER.warning(
         "Keep in mind, the more rounds, the slower the algorithm.."
     )
 try:
     if opt.multiWordLists is not None:
         file_list = create_file_list(
             cmd_line=opt.multiWordLists,
             verbose=opt.runInVerbose)
         for item in file_list:
             bruteforce_main(
                 opt.hashToCrack,
                 algorithm=algorithm_pointers(opt.algToUse),
                 wordlist=item.strip(),
                 salt=salt,
                 placement=placement,
                 posx=opt.returnThisPartOfHash,
                 use_hex=opt.useHexCodeNotHash,
                 verbose=opt.runInVerbose,
                 batch=opt.runInBatchMode,
                 rounds=opt.useRounds or DEFAULT_ROUNDS)
     elif opt.useDirForWordlists is not None:
         file_list = create_file_list(
             directory=opt.useDirForWordlists,
             verbose=opt.runInVerbose)
         for item in file_list:
             bruteforce_main(
                 opt.hashToCrack,
                 algorithm=algorithm_pointers(opt.algToUse),
                 wordlist="{}/{}".format(
                     opt.useDirForWordlists, item.strip()),