Пример #1
0
                print("The specified path '" + arguments.local_path +
                      "' doesn't exist.")
                sys.exit()

        if arguments.level == 0:
            set_key_characteristics(20, 40, 3.2)

        if arguments.level == 1:
            set_key_characteristics(40, 66, 4.3)

        if arguments.level == 2:
            set_key_characteristics(66, 76, 5.0)

        if arguments.level == 3:
            set_key_characteristics(20, 1800, 3.2)

        if arguments.min_key: core.MIN_KEY_LENGTH = arguments.min_key
        if arguments.max_key: core.MAX_KEY_LENGTH = arguments.max_key
        if arguments.entropy: core.HIGH_ENTROPY_EDGE = arguments.entropy
        if arguments.min_pass: core.MIN_PASS_LENGTH = arguments.min_pass
        if arguments.max_pass: core.MAX_PASS_LENGTH = arguments.max_pass
        if arguments.password_complexity:
            core.PASSWORD_COMPLEXITY = arguments.password_complexity
        if arguments.grep_words:
            advancedSearch.GREP_WORDS = arguments.grep_words

        core.start_the_hunt()

    except IOError as msg:
        parser.error(str(msg))
Пример #2
0
        help="specifies file names or extensions which shouldn't be analyzed. "
        + "File extension should contain '.' character (e.g. '.pdf'). " +
        "Multiple file names and extensions should be separated by space.")
    configuration.add_argument(
        '--bad-expressions',
        dest='bad_expressions',
        action='store',
        nargs='+',
        help="specifies bad expressions - if the DumpsterDiver " +
        "find such expression in a file, then this file won't be analyzed. " +
        "Multiple bad expressions should be separated by space. ")

    try:
        arguments = parser.parse_args()

        if arguments.local_path:

            if os.path.isdir(arguments.local_path) or os.path.isfile(
                    arguments.local_path):
                arguments.local_path = os.path.abspath(arguments.local_path)

            else:
                print("The specified path '" + arguments.local_path +
                      "' doesn't exist.")
                sys.exit()

        core.start_the_hunt(arguments)

    except IOError as msg:
        parser.error(str(msg))