--------------------------------------------------------------------------- Helper functions (shared by all shell adapters) --------------------------------------------------------------------------- firstArg returns the first argument from the request, or empty string.
(req *implantpb.Request)
| 14 | |
| 15 | // firstArg returns the first argument from the request, or empty string. |
| 16 | func 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. |
| 27 | func secondArg(req *implantpb.Request) string { |
no outgoing calls