MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeSpawnBeaconAsUser

Method executeSpawnBeaconAsUser

workflow/executor_spawn.go:151–168  ·  view source on GitHub ↗

executeSpawnBeaconAsUser spawns a beacon process as another user

(ctx context.Context, client *csclient.Client, beaconID string, action Action)

Source from the content-addressed store, hash-verified

149
150// executeSpawnBeaconAsUser spawns a beacon process as another user
151func (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
171func (e *Executor) executeSpawnBeaconUnder(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected