--- Beacon/Shellcode Spawn & Inject --- executeSpawnBeacon spawns a beacon process
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 134 | |
| 135 | // executeSpawnBeacon spawns a beacon process |
| 136 | func (e *Executor) executeSpawnBeacon(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 137 | listener, ok := action.Parameters["listener"].(string) |
| 138 | if !ok { |
| 139 | return "", fmt.Errorf("listener parameter required for spawn_beacon") |
| 140 | } |
| 141 | arch, _ := action.Parameters["arch"].(string) // optional (x86 or x64) |
| 142 | |
| 143 | resp, err := client.SpawnBeacon(ctx, beaconID, listener, arch) |
| 144 | if err != nil { |
| 145 | return "", err |
| 146 | } |
| 147 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 148 | } |
| 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) { |
no test coverage detected