Пример #1
0
    def run():
        Configuration.initialize()
        Cracker.crt_workload = 4  # TODO get value from parameters, adjust from keyboard

        signal.signal(signal.SIGINT, signal_handler)
        signal.signal(signal.SIGTERM, signal_handler)

        Cracker.req = Requester(Configuration.apikey,
                                Comunicator.error_printer)

        Cracker.resume_work()

        Comunicator.initialize()

        Comunicator.printer("Cracker initialized", reprint=False)

        # Disable terminal echo
        os.system("stty -echo")

        try:
            last_time = None
            while True:
                now_time = datetime.now()
                if last_time is None or (now_time -
                                         last_time).total_seconds() > 10:
                    last_time = now_time
                    Cracker.crack_existing_handshakes()

                cmd = Comunicator.get_command()
                if cmd is not None:
                    Cracker.parse_command(cmd)
                sleep(0.1)
        except Exception as e:
            Configuration.dual_print(
                Configuration.logger.critical,
                "Caught unexpected exception: '%s'" % (traceback.format_exc()))
            Cracker.clean_variables()
            die(True, e)
        finally:
            # Reenable terminal echo
            os.system("stty echo")
            pass
Пример #2
0
    def run():
        Comunicator.initialize()

        signal.signal(signal.SIGINT, signal_handler)
        signal.signal(signal.SIGTERM, signal_handler)

        Configuration.initialize()
        Cracker.crt_workload = Configuration.hashcat_workload  # TODO maybe adjust from keyboard

        Cracker.req = Requester(Configuration.apikey, Comunicator.error_logger)

        Cracker.resume_work()

        Comunicator.printer("Cracker initialized", reprint=False)

        try:
            # Disable terminal echo
            os.system("stty -echo")

            last_time = None
            while True:
                now_time = datetime.now()
                if last_time is None or (now_time -
                                         last_time).total_seconds() > 10:
                    last_time = now_time
                    Cracker.do_work()

                cmd = Comunicator.get_command()
                if cmd is not None:
                    Cracker.parse_command(cmd)
                sleep(0.1)
        except Exception as e:
            Cracker.clean_variables()
            Comunicator.fatal_debug_printer(
                "Caught unexpected exception: '%s' '%s'" %
                (e, traceback.format_exc()))
        finally:
            # Reenable terminal echo
            os.system("stty echo")
            pass