Exemple #1
0
                    args_in_params += 1
            # If you provided an argument continue..
            if args_in_params > 0:

                if opt.downloadWordList is True:
                    download_rand_wordlist()

                # Benchmark testing
                if opt.runBenchMarkTest is True:
                    start_time = time.time()
                    LOGGER.info("Benchmark test start: {}".format(start_time))

                # Creating random salts and random placements
                if opt.randomSaltAndPlacement is True:
                    salt, placement = random_salt_generator(
                        opt.useCharsAsSalt, opt.useIntAsSalt,
                        opt.saltSizeToUse)
                    LOGGER.info(
                        "Using random salt: '{}' and random placement: '{}'..."
                        .format(salt, placement))

                # If you provided your own salt and your own placements
                elif opt.saltToUseAndPlacement is not None:
                    salt, placement = opt.saltToUseAndPlacement[
                        0], opt.saltToUseAndPlacement[1].lower()
                    LOGGER.info(
                        "Using salt: '{}' on the {} of the hash...".format(
                            salt, placement))

                # Unicode random salt and placement
                elif opt.useURandomSaltAndRandomPlacement is not None:
Exemple #2
0
                update_status = update_system()
                if update_status == 0:
                    pass
                else:
                    LOGGER.fatal("No git repository found in path..")
                exit(0)

            # create a hash list from a given file or a series of given files
            # for this to work effectively when passing multiple files you must
            # enclose them in quotes and separate them by commas, IE -H "test.txt, testing.txt".
            # This will parse the given file for anything pertaining to a hash and save it
            # under a new file. You can then pass that file to the program
            if opt.createHashFile:
                files_to_process = opt.createHashFile
                hash_file_name = "hash-file-{}.hash".format(
                    random_salt_generator(use_string=True)[0])
                create_dir("{}/hash_files".format(os.getcwd()),
                           verbose=opt.runInVerbose)
                full_hash_path = "{}/{}/{}".format(os.getcwd(), "hash_files",
                                                   hash_file_name)
                with open(full_hash_path, "a+") as filename:
                    if len(files_to_process.split(",")) > 1:
                        LOGGER.info(
                            "Found multiple files to process: '{}'..".format(
                                files_to_process))
                        for f in files_to_process.split(","):
                            try:
                                for item in Generators(
                                        f.strip()).hash_file_generator():
                                    filename.write(item.strip() + "\n")
                            except IOError:
Exemple #3
0
import os
import itertools

from bin.verify_hashes.verify import verify_hash_type
from lib.settings import FUNC_DICT
from lib.settings import LOGGER
from lib.settings import WORDLIST_RE
from lib.settings import match_found
from lib.settings import prompt
from lib.settings import random_salt_generator

# The name of the wordlist
WORDLIST_NAME = "Dagon-bfdict-" + random_salt_generator(use_string=True,
                                                        length=7)[0] + ".txt"


def word_generator(length_min=7, length_max=15, perms=""):
    """
      Generate the words to be used for bruteforcing
      > :param length_min: minimum length for the word
      > :param length_max: max length for the word
      > :param perms: permutations, True or False
      > :return: a word

      Example:
      >>> word_generator()
      aaaaaa
      aaaaab
      aaaaac
      ...
    """
Exemple #4
0
                LOGGER.info("Update in progress..")
                update_status = update_system()
                if update_status == 0:
                    pass
                else:
                    LOGGER.fatal("No git repository found in path..")
                exit(0)

            # create a hash list from a given file or a series of given files
            # for this to work effectively when passing multiple files you must
            # enclose them in quotes and separate them by commas, IE -H "test.txt, testing.txt".
            # This will parse the given file for anything pertaining to a hash and save it
            # under a new file. You can then pass that file to the program
            if opt.createHashFile:
                files_to_process = opt.createHashFile
                hash_file_name = "hash-file-{}.hash".format(random_salt_generator(use_string=True)[0])
                create_dir("{}/hash_files".format(os.getcwd()), verbose=opt.runInVerbose)
                full_hash_path = "{}/{}/{}".format(os.getcwd(), "hash_files", hash_file_name)
                with open(full_hash_path, "a+") as filename:
                    if len(files_to_process.split(",")) > 1:
                        LOGGER.info("Found multiple files to process: '{}'..".format(files_to_process))
                        for f in files_to_process.split(","):
                            try:
                                for item in Generators(f.strip()).hash_file_generator():
                                    filename.write(item.strip() + "\n")
                            except IOError:
                                LOGGER.warning("Provided file '{}' does not exist, skipping..".format(f.strip()))
                                continue
                    else:
                        LOGGER.info("Reading from singular file '{}'...".format(files_to_process))
                        for item in Generators(opt.createHashFile).hash_file_generator():