Skip to content

Instantly share code, notes, and snippets.

@khyberspache
Created December 23, 2020 22:08
Show Gist options
  • Save khyberspache/f1204e2c8746210d901ebfb233bfaac9 to your computer and use it in GitHub Desktop.
Save khyberspache/f1204e2c8746210d901ebfb233bfaac9 to your computer and use it in GitHub Desktop.
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