示例#1
0
文件: hunt.py 项目: secureonelabs/grr
  def Handle(self, args, context=None):
    output_fname = re.sub("[^0-9a-zA-Z]+", "_", str(args.hunt_id))
    code_to_execute = ("""grrapi.Hunt("%s").GetFilesArchive()."""
                       """WriteToFile("./hunt_results_%s.zip")""") % (
                           args.hunt_id, output_fname)

    export_command_str = " ".join([
        config.CONFIG["AdminUI.export_command"], "--exec_code",
        utils.ShellQuote(code_to_execute)
    ])

    return ApiGetHuntResultsExportCommandResult(command=export_command_str)
示例#2
0
文件: flow.py 项目: x35029/grr
  def Handle(self, args, token=None):
    output_fname = re.sub(
        "[^0-9a-zA-Z]+", "_", "%s_%s" %
        (utils.SmartStr(args.client_id), utils.SmartStr(args.flow_id)))
    code_to_execute = ("""grrapi.Client("%s").Flow("%s").GetFilesArchive()."""
                       """WriteToFile("./flow_results_%s.zip")""") % (
                           args.client_id, args.flow_id, output_fname)

    export_command_str = " ".join([
        config.CONFIG["AdminUI.export_command"], "--exec_code",
        utils.ShellQuote(code_to_execute)
    ])

    return ApiGetFlowResultsExportCommandResult(command=export_command_str)
示例#3
0
文件: vfs.py 项目: threatintel-c/grr
    def Handle(self, args, token=None):
        ValidateVfsPath(args.file_path)

        output_fname = os.path.basename(args.file_path)

        code_to_execute = (
            """grrapi.Client("%s").File(r\"\"\"%s\"\"\").GetBlob()."""
            """WriteToFile("./%s")""") % (args.client_id, args.file_path,
                                          output_fname)

        export_command = u" ".join([
            config.CONFIG["AdminUI.export_command"], "--exec_code",
            utils.ShellQuote(code_to_execute)
        ])

        return ApiGetFileDownloadCommandResult(command=export_command)