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

Method executeSpawnShellcode

workflow/executor_spawn.go:228–243  ·  view source on GitHub ↗

executeSpawnShellcode spawns a process and injects shellcode

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

Source from the content-addressed store, hash-verified

226
227// executeSpawnShellcode spawns a process and injects shellcode
228func (e *Executor) executeSpawnShellcode(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
229 arch, ok := action.Parameters["arch"].(string)
230 if !ok {
231 return "", fmt.Errorf("arch parameter required for spawn_shellcode")
232 }
233 shellcodePath, ok := action.Parameters["shellcode"].(string)
234 if !ok {
235 return "", fmt.Errorf("shellcode parameter required for spawn_shellcode")
236 }
237
238 resp, err := client.SpawnShellcode(ctx, beaconID, arch, shellcodePath)
239 if err != nil {
240 return "", err
241 }
242 return e.waitForOutput(ctx, client, resp.TaskID)
243}
244
245// executeInjectShellcode injects shellcode into a process
246func (e *Executor) executeInjectShellcode(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