executePowerShell executes a PowerShell command
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 1043 | |
| 1044 | // executePowerShell executes a PowerShell command |
| 1045 | func (e *Executor) executePowerShell(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 1046 | command, ok := action.Parameters["command"].(string) |
| 1047 | if !ok { |
| 1048 | return "", fmt.Errorf("command parameter required for powershell") |
| 1049 | } |
| 1050 | |
| 1051 | resp, err := client.ExecutePowerShell(ctx, beaconID, command) |
| 1052 | if err != nil { |
| 1053 | return "", err |
| 1054 | } |
| 1055 | |
| 1056 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 1057 | } |
| 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) { |
no test coverage detected