Example #1
0
def powershell_function(rat: Rat, script_anchor: str,
                        command: PSFunction) -> Job:
    stdin = "[[" + script_anchor + "]] " + command.command.command_line
    return Job.create_rat_command(rat,
                                  Opcodes.EXECUTE,
                                  command_line=powershell.PS_COMMAND,
                                  stdin=stdin)
Example #2
0
def exfil_network_connection(rat: Rat, addr: str, port: str, file_path: str,
                             method: str) -> Job:
    return Job.create_rat_command(rat,
                                  Opcodes.EXFIL_CONNECTION,
                                  address=addr,
                                  port=port,
                                  file_path=file_path,
                                  method=method)
Example #3
0
def send_shell_command(rat: Rat, cmd: str) -> Job:
    return Job.create_rat_command(rat, Opcodes.EXECUTE, command_line=cmd)
Example #4
0
def read_file(rat: Rat, file_path: str):
    return Job.create_rat_command(rat, Opcodes.READ_FILE, file_path=file_path)
Example #5
0
def drop_file(rat: Rat, file_path: str, contents: bytes):
    return Job.create_rat_command(
        rat,
        Opcodes.WRITE_FILE,
        file_path=file_path,
        contents=base64.encodebytes(contents).decode('utf-8'))