Esempio n. 1
0
    def purge(self, response):
        """
        Purge expired sessions (remove sessions that haven't checked in)

        Usage: purge [-h]
        """

        print_good(f"Purged {response.result['purged']} session(s)")
Esempio n. 2
0
    def getpsk(self, guid: str, response):
        """
        Get psk of a session via guid

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

        print_good(f"PSK: {response.result['psk']}")
Esempio n. 3
0
    def start(self, response):
        """
       Start the selected listener

       Usage: start [-h]
       """
        listener = response.result
        print_good(
            f"Started listener \'{listener['options']['Name']['Value']}\'")
Esempio n. 4
0
    def register(self, guid: str, psk: str, response):
        """
        Register a session with the server

        Usage: register [-h] [<guid>] [<psk>]
        """

        print_good(
            f"Registered new session (guid: {response.result['guid']} psk: {response.result['psk']})"
        )
Esempio n. 5
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")
Esempio n. 6
0
    def generate(self, listener_name: str, response):
        """
        Generate the selected stager

        Usage: generate [-h] <listener_name> 
        
        Arguments:
            listener_name   listener name
        """

        generated_stager = response.result

        stager_filename = f"./stager.{generated_stager['extension']}"
        with open(stager_filename, 'wb') as stager:
            stager.write(generated_stager['output'].encode('latin-1'))

        print_good(f"Generated stager to {stager_filename}")