executeUpload uploads a file to the beacon's current working directory
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 1058 | |
| 1059 | // executeUpload uploads a file to the beacon's current working directory |
| 1060 | func (e *Executor) executeUpload(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 1061 | localPath, ok := action.Parameters["local_path"].(string) |
| 1062 | if !ok { |
| 1063 | return "", fmt.Errorf("local_path parameter required for upload") |
| 1064 | } |
| 1065 | |
| 1066 | resp, err := client.Upload(ctx, beaconID, localPath) |
| 1067 | if err != nil { |
| 1068 | return "", err |
| 1069 | } |
| 1070 | |
| 1071 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 1072 | } |
| 1073 | |
| 1074 | // executeDownload downloads a file from the beacon |
| 1075 | func (e *Executor) executeDownload(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
no test coverage detected