MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / enqueueToolAction

Function enqueueToolAction

internal/bridge/commands.go:144–160  ·  view source on GitHub ↗

enqueueToolAction builds a PendingAction, enqueues it, and binds to the task. Returns the command ID and true on success, or ("", false) on failure. Use this for modules that manage their own result channel (e.g. upload/download).

(ctx ModuleContext, sessionID string, taskID uint32, toolName string, args map[string]any)

Source from the content-addressed store, hash-verified

142// Returns the command ID and true on success, or ("", false) on failure.
143// Use this for modules that manage their own result channel (e.g. upload/download).
144func enqueueToolAction(ctx ModuleContext, sessionID string, taskID uint32, toolName string, args map[string]any) (string, bool) {
145 cmdID := sessions.GenerateCommandID()
146 action := &sessions.PendingAction{
147 ID: cmdID,
148 TaskID: taskID,
149 Type: sessions.ActionToolCall,
150 ToolName: toolName,
151 Arguments: args,
152 CreatedAt: time.Now(),
153 }
154 if !sessions.Global().EnqueueAction(sessionID, action) {
155 ctx.Tasks.Fail(sessionID, taskID, "enqueue failed")
156 return "", false
157 }
158 ctx.Tasks.BindCommand(sessionID, taskID, cmdID)
159 return cmdID, true
160}
161
162// execSpite builds a simple ExecResponse Spite for error messages.
163func execSpite(message string) *implantpb.Spite {

Callers 6

handleDirectUploadMethod · 0.85
executeChunksMethod · 0.85
handleDirectDownloadMethod · 0.85
probeAndDownloadMethod · 0.85
executeSingleShellMethod · 0.85
executeChunksMethod · 0.85

Calls 5

GenerateCommandIDFunction · 0.92
GlobalFunction · 0.92
EnqueueActionMethod · 0.80
FailMethod · 0.80
BindCommandMethod · 0.80

Tested by

no test coverage detected