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

Method sendExecResponse

internal/bridge/forward.go:69–87  ·  view source on GitHub ↗

sendExecResponse sends a simple ExecResponse back to the C2 server.

(sessionID string, taskID uint32, message string)

Source from the content-addressed store, hash-verified

67
68// sendExecResponse sends a simple ExecResponse back to the C2 server.
69func (b *Bridge) sendExecResponse(sessionID string, taskID uint32, message string) {
70 spite := &implantpb.Spite{
71 Name: consts.ModuleExecute,
72 Body: &implantpb.Spite_ExecResponse{
73 ExecResponse: &implantpb.ExecResponse{
74 Stdout: []byte(message),
75 End: true,
76 },
77 },
78 }
79 if err := b.sendSpite(&clientpb.SpiteResponse{
80 ListenerId: b.listenerID,
81 SessionId: sessionID,
82 TaskId: taskID,
83 Spite: spite,
84 }); err != nil {
85 log.Errorf("[bridge] failed to send exec response for session %s: %v", sessionID, err)
86 }
87}
88
89// extractPlainOutput extracts the actual output from tool result text,
90// stripping metadata like "Exit code:", "Wall time:", "Output:" wrappers.

Callers 1

handleSpiteRecvMethod · 0.95

Calls 1

sendSpiteMethod · 0.95

Tested by

no test coverage detected