Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
keyword usage example for Operator
func RunCommand(message string, executor string, payloadPath string) (string, int, int) {
if executor == "keyword" {
switch message {
case "stop agent":
os.Exit(0)
case "module":
// do module stuff
default:
// do other stuff
}
} else {
// run command using exec.Command("powershell.exe", ...)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment