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

Method executeInjectDll

workflow/executor_spawn.go:414–439  ·  view source on GitHub ↗

--- DLL Operations --- executeInjectDll injects a reflective DLL into a process

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

Source from the content-addressed store, hash-verified

412
413// executeInjectDll injects a reflective DLL into a process
414func (e *Executor) executeInjectDll(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
415 pidVal, ok := action.Parameters["pid"]
416 if !ok {
417 return "", fmt.Errorf("pid parameter required for inject_dll")
418 }
419 var pid int
420 switch v := pidVal.(type) {
421 case float64:
422 pid = int(v)
423 case int:
424 pid = v
425 default:
426 return "", fmt.Errorf("pid must be a number")
427 }
428
429 dllPath, ok := action.Parameters["dll"].(string)
430 if !ok {
431 return "", fmt.Errorf("dll parameter required for inject_dll")
432 }
433
434 resp, err := client.InjectDll(ctx, beaconID, pid, dllPath)
435 if err != nil {
436 return "", err
437 }
438 return e.waitForOutput(ctx, client, resp.TaskID)
439}
440
441// executeInjectLoadDll loads a DLL from disk via LoadLibrary
442func (e *Executor) executeInjectLoadDll(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