executeSpawnBeaconAsUser spawns a beacon process as another user
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 149 | |
| 150 | // executeSpawnBeaconAsUser spawns a beacon process as another user |
| 151 | func (e *Executor) executeSpawnBeaconAsUser(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 152 | password, ok := action.Parameters["password"].(string) |
| 153 | if !ok { |
| 154 | return "", fmt.Errorf("password parameter required for spawn_beacon_as_user") |
| 155 | } |
| 156 | listener, ok := action.Parameters["listener"].(string) |
| 157 | if !ok { |
| 158 | return "", fmt.Errorf("listener parameter required for spawn_beacon_as_user") |
| 159 | } |
| 160 | domain, _ := action.Parameters["domain"].(string) // optional |
| 161 | user, _ := action.Parameters["user"].(string) // optional |
| 162 | |
| 163 | resp, err := client.SpawnBeaconAsUser(ctx, beaconID, domain, user, password, listener) |
| 164 | if err != nil { |
| 165 | return "", err |
| 166 | } |
| 167 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 168 | } |
| 169 | |
| 170 | // executeSpawnBeaconUnder spawns a beacon with specified PID as parent |
| 171 | func (e *Executor) executeSpawnBeaconUnder(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
no test coverage detected