executeShell executes a shell command
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 1028 | |
| 1029 | // executeShell executes a shell command |
| 1030 | func (e *Executor) executeShell(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 1031 | command, ok := action.Parameters["command"].(string) |
| 1032 | if !ok { |
| 1033 | return "", fmt.Errorf("command parameter required for shell") |
| 1034 | } |
| 1035 | |
| 1036 | resp, err := client.ExecuteShell(ctx, beaconID, command) |
| 1037 | if err != nil { |
| 1038 | return "", err |
| 1039 | } |
| 1040 | |
| 1041 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 1042 | } |
| 1043 | |
| 1044 | // executePowerShell executes a PowerShell command |
| 1045 | func (e *Executor) executePowerShell(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
no test coverage detected