Exemple #1
0
        Crack("crack brute ?a")
        Crack("crack brute ?a?a")
        Crack("crack brute ?a?a?a")
        Crack("crack brute ?a?a?a?a")
        Crack("crack brute ?a?a?a?a?a")
        Crack("crack brute ?a?a?a?a?a?a")
        Crack("crack brute ?a?a?a?a?a?a?a")

        # Maybe keyboard walk?
        Crack("crack kwp")

        # Cracks more but is larger space
        Crack("crack rules OneRuleToRuleThemAll.rule")

        # Last gasp. Try out prince
        Crack("crack prince")


# https://github.com/intel/compute-runtime/blob/master/documentation/Neo_in_distributions.md
# intel-opencl-icd
# https://software.intel.com/en-us/articles/opencl-drivers#latest_CPU_runtime
LOGGER = logging.getLogger(__name__)
CRACK_COMPLETER = NestedCompleter({
    'brute': None,
    'kwp': None,
    'prince': None,
    'rules': None,
    'show': None,
    'wordlist': None,
})
Exemple #2
0
import logging
from prompt_toolkit.completion import WordCompleter, NestedCompleter
from .config import config


def Add(command):
    command = command[3:].strip()
    command = command.split(" ")

    if command[0] == "hash":
        if len(command) == 1:
            LOGGER.error("Specify hash in command.")

        else:
            config["hashes"] += command[1].encode()


LOGGER = logging.getLogger(__name__)
ADD_COMPLETER = NestedCompleter({
    'hash': None,
})
Exemple #3
0
    def __init__(self, client):
        super(Root, self).__init__(None)
        self.client = client

        @self.command(WordCompleter(self.client.list().keys(), WORD=True))
        def module(line):
            if len(line) != 1:
                raise InvalidInput('usage: module <name>')
            return Module(self.client.get_module(line[0]), line[0], self)

        @self.command(name='list')
        def _list(line):
            if len(line) != 0:
                raise InvalidInput('usage: list')
            for k, m in self.client.list().items():
                stroid = lambda oid: '0x{:08x}'.format(oid)
                print('module:', k, stroid(m.oid) if m.oid else 'not present')
                for v in m.hostifs:
                    print(' hostif:', v.index, stroid(v.oid))

                for v in m.netifs:
                    print(' netif:', v.index, stroid(v.oid))

        @self.command(
            WordCompleter(
                ['debug', 'info', 'notice', 'warn', 'error', 'critical']),
            'log-level')
        def set_log_level(line):
            if len(line) != 1:
                raise InvalidInput('usage: log-level <level>')
            self.client.set_log_level(line[0])

        @self.command(
            NestedCompleter({
                'module': None,
                'netif': None,
                'hostif': None
            }))
        def create(line):
            if len(line) < 1:
                raise InvalidInput(
                    'invalid input: create [module| netif <module-oid> | hostif <module-oid>] [<attr-name>:<attr-value> ]...'
                )
            object_type = line[0]
            line.pop(0)
            module_id = 0
            if object_type in ['netif', 'hostif']:
                if len(line) < 1:
                    print(
                        'invalid input: create [module| netif <module-oid> | hostif <module-oid>] [<attr-name>:<attr-value> ]...'
                    )
                    return
                try:
                    module_id = int(line[0], 0)
                except ValueError as e:
                    raise InvalidInput(f'invalid module oid: {e}')
                line.pop(0)

            attrs = [tuple(attr.split(':')) for attr in line]
            try:
                print('oid: 0x{:x}'.format(
                    self.client.create(object_type, attrs, module_id)))
            except TAIException as e:
                print('err: {} (code: {:x})'.format(e.msg, e.code))

        get_oids = lambda: ('0x{:x}'.format(elem.oid)
                            for elem in chain.from_iterable(
                                [v] + list(v.netifs) + list(v.hostifs)
                                for v in self.client.list().values()
                                if v.oid > 0))

        @self.command(WordCompleter(get_oids))
        def remove(line):
            if len(line) != 1:
                raise InvalidInput('usage: remove <oid>')
            try:
                self.client.remove(int(line[0], 0))
            except TAIException as e:
                print('err: {} (code: {:x})'.format(e.msg, e.code))
Exemple #4
0
        if os.path.isfile(routesfile):
            config["kwp:routes"] = routesfile
        else:
            LOGGER.error("Can't find routes file at " + routesfile)

from .autoconfig import autoconfig

LOGGER = logging.getLogger(__name__)

SET_COMPLETER = NestedCompleter({
    "device": WordCompleter(["auto", "cpu", "gpu"]),
    "hashfile": PathCompleter(),
    "hashtype": WordCompleter(types.hashcat.keys(), ignore_case=True, match_middle=True),
    "kwp:basechars": PathCompleter(get_paths=lambda:[KWP_BASECHARS_DIR]),
    "kwp:keymaps": PathCompleter(get_paths=lambda:[KWP_KEYMAPS_DIR]),
    "kwp:routes": PathCompleter(get_paths=lambda:[KWP_ROUTES_DIR]),
    "mask": None,
    "optimized": WordCompleter(["true", "false"]),
    "rules": PathCompleter(get_paths=lambda:[RULES_DIR]),
    "wordlist": PathCompleter(),
})

MASK_HELP = r"""usage: set mask <mask_here>

Default mask charsets:
    ?l = abcdefghijklmnopqrstuvwxyz
    ?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ
    ?d = 0123456789
    ?h = 0123456789abcdef
    ?H = 0123456789ABCDEF
    ?s = «space»!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Exemple #5
0
MENU = {
    "add": Add,
    "crack": Crack,
    "exit": do_exit,
    "help": Help,
    "set": Set,
    "show": Show,
    "identify": Identify,
}

COMPLETER = NestedCompleter({
    'add': ADD_COMPLETER,
    'crack': CRACK_COMPLETER,
    'exit': None,
    'help': None,
    'identify': None,
    'set': SET_COMPLETER,
    'show': SHOW_COMPLETER,
})

BANNER = r"""   ▄█    █▄       ▄████████    ▄████████    ▄█    █▄     ▄████████    ▄████████    ▄████████  ▄████████    ▄█   ▄█▄ 
  ███    ███     ███    ███   ███    ███   ███    ███   ███    ███   ███    ███   ███    ███ ███    ███   ███ ▄███▀ 
  ███    ███     ███    ███   ███    █▀    ███    ███   ███    █▀    ███    ███   ███    ███ ███    █▀    ███▐██▀   
 ▄███▄▄▄▄███▄▄   ███    ███   ███         ▄███▄▄▄▄███▄▄ ███         ▄███▄▄▄▄██▀   ███    ███ ███         ▄█████▀    
▀▀███▀▀▀▀███▀  ▀███████████ ▀███████████ ▀▀███▀▀▀▀███▀  ███        ▀▀███▀▀▀▀▀   ▀███████████ ███        ▀▀█████▄    
  ███    ███     ███    ███          ███   ███    ███   ███    █▄  ▀███████████   ███    ███ ███    █▄    ███▐██▄   
  ███    ███     ███    ███    ▄█    ███   ███    ███   ███    ███   ███    ███   ███    ███ ███    ███   ███ ▀███▄ 
  ███    █▀      ███    █▀   ▄████████▀    ███    █▀    ████████▀    ███    ███   ███    █▀  ████████▀    ███   ▀█▀ 
                                                                     ███    ███                           ▀         
Version {version} (https://github.com/bannsec/hashcrack)