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

Function firstArg

internal/bridge/module_shell_adapters.go:16–24  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Helper functions (shared by all shell adapters) --------------------------------------------------------------------------- firstArg returns the first argument from the request, or empty string.

(req *implantpb.Request)

Source from the content-addressed store, hash-verified

14
15// firstArg returns the first argument from the request, or empty string.
16func firstArg(req *implantpb.Request) string {
17 if req != nil && len(req.Args) > 0 {
18 return req.Args[0]
19 }
20 if req != nil && req.Input != "" {
21 return req.Input
22 }
23 return ""
24}
25
26// secondArg returns the second argument from the request, or empty string.
27func secondArg(req *implantpb.Request) string {

Callers 14

lsCommandFunction · 0.85
lsResponseFunction · 0.85
catCommandFunction · 0.85
cdCommandFunction · 0.85
killCommandFunction · 0.85
mkdirCommandFunction · 0.85
rmCommandFunction · 0.85
cpCommandFunction · 0.85
mvCommandFunction · 0.85
chmodCommandFunction · 0.85
TestFirstArg_FromArgsFunction · 0.85
TestFirstArg_FromInputFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestFirstArg_FromArgsFunction · 0.68
TestFirstArg_FromInputFunction · 0.68
TestFirstArg_NilFunction · 0.68
TestFirstArgFunction · 0.68