executeInjectLoadDll loads a DLL from disk via LoadLibrary
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 440 | |
| 441 | // executeInjectLoadDll loads a DLL from disk via LoadLibrary |
| 442 | func (e *Executor) executeInjectLoadDll(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 443 | pidVal, ok := action.Parameters["pid"] |
| 444 | if !ok { |
| 445 | return "", fmt.Errorf("pid parameter required for inject_load_dll") |
| 446 | } |
| 447 | var pid int |
| 448 | switch v := pidVal.(type) { |
| 449 | case float64: |
| 450 | pid = int(v) |
| 451 | case int: |
| 452 | pid = v |
| 453 | default: |
| 454 | return "", fmt.Errorf("pid must be a number") |
| 455 | } |
| 456 | |
| 457 | path, ok := action.Parameters["path"].(string) |
| 458 | if !ok { |
| 459 | return "", fmt.Errorf("path parameter required for inject_load_dll") |
| 460 | } |
| 461 | |
| 462 | resp, err := client.InjectLoadDll(ctx, beaconID, pid, path) |
| 463 | if err != nil { |
| 464 | return "", err |
| 465 | } |
| 466 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 467 | } |
| 468 | |
| 469 | // --- PostEx DLL --- |
| 470 |
no test coverage detected