Esempio n. 1
0
    def _action(self):
        try:
            data = json.loads(request.data.decode())

            if data["action"] == "start":
                Hashcat.sessions[data["session"]].start()
            if data["action"] == "update":
                Hashcat.sessions[data["session"]].update()
            if data["action"] == "pause":
                Hashcat.sessions[data["session"]].pause()
            if data["action"] == "resume":
                Hashcat.sessions[data["session"]].resume()
            if data["action"] == "quit":
                Hashcat.sessions[data["session"]].quit()
            if data["action"] == "remove":
                Hashcat.remove_session(data["session"])

            res = {"response": "ok"}

            return json.dumps(res)
        except Exception as e:
            traceback.print_exc()

            return json.dumps({
                "response": "error",
                "message": str(e),
            })
Esempio n. 2
0
    def _removeSession(self, session_name):
        try:
            Hashcat.remove_session(session_name)

            res = {"response": "ok"}

            return json.dumps(res)
        except Exception as e:
            traceback.print_exc()

            return json.dumps({
                "response": "error",
                "message": str(e),
            })