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']}\'")
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")
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
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}'")
def job_result(self, data): print_info( f"[{self.connection.alias}] {data['session']} returned job result (id: {data['id']})" ) print(data['output'])
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}")