executeSpawnShellcode spawns a process and injects shellcode
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 226 | |
| 227 | // executeSpawnShellcode spawns a process and injects shellcode |
| 228 | func (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 |
| 246 | func (e *Executor) executeInjectShellcode(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
no test coverage detected