コード例 #1
0
    def kill(self, guid: str, response):
        """
        Kill a session

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

        print_info(f"Tasked session {guid} to exit")
コード例 #2
0
    def stop(self, response):
        """
        Stop the selected listener

        Usage: stop <name> [-h]
        """
        listener = response.result
        print_info(
            f"Stopped listener \'{listener['options']['Name']['Value']}\'")
コード例 #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")
コード例 #4
0
    def rename(self, old_name: str, new_name: str):
        """
        Rename a specified teamserver

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

        Arguments:
            old_name   old teamserver name
            new_name   new teamserver name
        """
        for ts in self.connections:
            if ts.alias == old_name:
                ts.alias = new_name
                print_info(f"Renamed teamserver {old_name} to {new_name}")
                break
コード例 #5
0
    def use(self, TS: str):
        """
        Select a specified teamserver for all communication

        Usage: use [-h] <TS>

        Arguments:
            TS   teamserver to use
        """

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

        print_bad(f"Not currently connected to teamserver '{TS}'")
コード例 #6
0
 def job_result(self, data):
     print_info(
         f"[{self.connection.alias}] {data['session']} returned job result (id: {data['id']})"
     )
     print(data['output'])
コード例 #7
0
 def new_session(self, data):
     print_info(f"[{self.connection.alias}] {data}")
コード例 #8
0
 def session_staged(self, data):
     print_info(f"[{self.connection.alias}] {data}")
コード例 #9
0
 def user_login(self, data):
     print_info(f"[{self.connection.alias}] {data}")