Ejemplo n.º 1
0
    def kill(self, guid: str, response):
        """
        Kill a session

        Usage: kill [-h] <guid>
        """

        print_info(f"Tasked session {guid} to exit")
    def stop(self, response):
        """
        Stop the selected listener

        Usage: stop <name> [-h]
        """
        listener = response.result
        print_info(
            f"Stopped listener \'{listener['options']['Name']['Value']}\'")
Ejemplo n.º 3
0
    def unregister(self, guid: str, response):
        """
        Unregister a session with the server. You will need to register the session manually to reuse it again

        Usage: unregister [-h] [<guid>]
        """

        print_good(f"Unregistered session (guid: {response.result['guid']})")
        print_info(
            f"If you wish to reuse the session you must manually register it")
Ejemplo n.º 4
0
    def rename(self, old_name: str, new_name: str):
        """
        Rename a specified Web Socket URL

        Usage: use [-h] <old_name> <new_name>

        Arguments:
            old_name   old WSS URL name
            new_name   new WSS URL name
        """
        for wss in self.connections:
            if wss.alias == old_name:
                wss.alias = new_name
                print_info(f"Renamed Web Socket URL {old_name} to {new_name}")
                break
Ejemplo n.º 5
0
    def use(self, TS: str):
        """
        Select a specified Web Socket URL for all communication

        Usage: use [-h] <TS>

        Arguments:
            WSS   Web Socket URL to use
        """

        for wss in self.connections:
            if wss.alias == WSS:
                self.selected = wss
                print_info(f"Now using {ts.alias} for all comms")
                return

        print_bad(f"Not currently connected to WSS Server '{WSS}'")
    def job_result(self, data):
        print_info(
            f"[{self.connection.alias}] {data['session']} returned job result (id: {data['id']})"
        )
        if witness.status:
            try:
                x = b64decode(data['output'].encode()).decode()
                aux = x.split("\\r\\n")
                text = ""
                for line in aux:
                    text += line + "\n"

                print(text)
            except:
                print(data['output'])
        else:
            pass
 def new_session(self, data):
     print_info(f"[{self.connection.alias}] {data}")
 def session_staged(self, data):
     print_info(f"[{self.connection.alias}] {data}")
 def user_login(self, data):
     print_info(f"[{self.connection.alias}] {data}")