Пример #1
0
    def keyword_obfuscation(self, keyword: str, replacement: str = None):
        """
        Add key words to to be obfuscated from commands. Empire will generate a random word if no replacement word is provided. CANNOT BE USED WITH OBFUSCATE.

        Usage: keyword_obfuscation <keyword> [replacement]
        """
        if not replacement:
            replacement = random.choice(string.ascii_uppercase) + ''.join(
                random.choice(string.ascii_uppercase + string.digits)
                for _ in range(4))
            print(
                print_util.color(
                    f'[*] No keyword obfuscation replacement given, generating random string'
                ))

        options = {
            'keyword_obfuscation': keyword,
            'keyword_replacement': replacement
        }
        response = state.set_admin_options(options)

        # Return results and error message
        if 'success' in response.keys():
            print(
                print_util.color(
                    f'[*] Keyword obfuscation set to replace {keyword} with {replacement}'
                ))
        elif 'error' in response.keys():
            print(print_util.color('[!] Error: ' + response['error']))
Пример #2
0
    def keyword_obfuscation(self, keyword: str, replacement: str = None):
        """
        Add key words to to be obfuscated from commands. Empire will generate a random word if no replacement word is provided.

        Usage: keyword_obfuscation <keyword> [replacement]
        """
        if not replacement:
            replacement = random.choice(string.ascii_uppercase) + "".join(
                random.choice(string.ascii_uppercase + string.digits)
                for _ in range(4))
            print(
                print_util.color(
                    f"[*] No keyword obfuscation replacement given, generating random string"
                ))

        options = {
            "keyword_obfuscation": keyword,
            "keyword_replacement": replacement
        }
        response = state.set_admin_options(options)

        # Return results and error message
        if "success" in response.keys():
            print(
                print_util.color(
                    f"[*] Keyword obfuscation set to replace {keyword} with {replacement}"
                ))
        elif "error" in response.keys():
            print(print_util.color("[!] Error: " + response["error"]))
Пример #3
0
    def obfuscate_command(self, obfucation_type: str):
        """
        Set obfuscation technique to run for all future powershell commands run on all agents.

        Usage: obfuscate_command <obfucation_type>
        """
        options = {'obfuscate_command': obfucation_type}
        response = state.set_admin_options(options)

        # Return results and error message
        if 'success' in response.keys():
            print(
                print_util.color('[*] Global obfuscation command set to %s' %
                                 (obfucation_type)))
        elif 'error' in response.keys():
            print(print_util.color('[!] Error: ' + response['error']))
Пример #4
0
    def preobfuscate(self, force_reobfuscation: str, obfuscation_command: str):
        """
        Preobfuscate modules on the server.

        Usage: preobfuscate <force_reobfuscation> <obfuscation_command>
        """
        options = {
            'preobfuscation': obfuscation_command,
            'force_reobfuscation': force_reobfuscation
        }
        response = state.set_admin_options(options)

        # Return results and error message
        if 'success' in response.keys():
            print(print_util.color('[+] Preobfuscating modules...'))
        elif 'error' in response.keys():
            print(print_util.color('[!] Error: ' + response['error']))
Пример #5
0
    def preobfuscate(self, force_reobfuscation: str, obfuscation_command: str):
        """
        Preobfuscate modules on the server.

        Usage: preobfuscate <force_reobfuscation> <obfuscation_command>
        """
        options = {
            "preobfuscation": obfuscation_command,
            "force_reobfuscation": force_reobfuscation,
        }
        response = state.set_admin_options(options)

        # Return results and error message
        if "success" in response.keys():
            print(print_util.color("[+] Preobfuscating modules..."))
        elif "error" in response.keys():
            print(print_util.color("[!] Error: " + response["error"]))
Пример #6
0
    def obfuscate(self, obfucate_bool: str):
        """
        Turn on obfuscate all future powershell commands run on all agents. CANNOT BE USED WITH KEYWORD_OBFUSCATION.

        Usage: obfuscate <obfucate_bool>
        """
        # todo: should it be set <key> <value> to be consistent?
        if obfucate_bool.lower() in ['true', 'false']:
            options = {'obfuscate': obfucate_bool}
            response = state.set_admin_options(options)
        else:
            print(print_util.color('[!] Error: Invalid entry'))

        # Return results and error message
        if 'success' in response.keys():
            print(
                print_util.color('[*] Global obfuscation set to %s' %
                                 (obfucate_bool)))
        elif 'error' in response.keys():
            print(
                print_util.color('[!] Error: ' + response['error'] +
                                 "obfuscate <True/False>"))
Пример #7
0
    def obfuscate(self, obfucate_bool: str):
        """
        Turn on obfuscate all future powershell commands run on all agents.

        Usage: obfuscate <obfucate_bool>
        """
        # todo: should it be set <key> <value> to be consistent?
        if obfucate_bool.lower() in ["true", "false"]:
            options = {"obfuscate": obfucate_bool}
            response = state.set_admin_options(options)
        else:
            print(print_util.color("[!] Error: Invalid entry"))

        # Return results and error message
        if "success" in response.keys():
            print(
                print_util.color("[*] Global obfuscation set to %s" %
                                 (obfucate_bool)))
        elif "error" in response.keys():
            print(
                print_util.color("[!] Error: " + response["error"] +
                                 "obfuscate <True/False>"))