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

Method executeInjectPostExDll

workflow/executor_spawn.go:487–513  ·  view source on GitHub ↗

executeInjectPostExDll injects postex DLL into a process

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

Source from the content-addressed store, hash-verified

485
486// executeInjectPostExDll injects postex DLL into a process
487func (e *Executor) executeInjectPostExDll(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
488 pidVal, ok := action.Parameters["pid"]
489 if !ok {
490 return "", fmt.Errorf("pid parameter required for inject_postex_dll")
491 }
492 var pid int
493 switch v := pidVal.(type) {
494 case float64:
495 pid = int(v)
496 case int:
497 pid = v
498 default:
499 return "", fmt.Errorf("pid must be a number")
500 }
501
502 dllPath, ok := action.Parameters["dll"].(string)
503 if !ok {
504 return "", fmt.Errorf("dll parameter required for inject_postex_dll")
505 }
506 args, _ := action.Parameters["args"].(string) // optional
507
508 resp, err := client.InjectPostExDll(ctx, beaconID, pid, dllPath, args)
509 if err != nil {
510 return "", err
511 }
512 return e.waitForOutput(ctx, client, resp.TaskID)
513}
514
515// --- Registry ---
516

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected