Last active
January 19, 2021 14:52
-
-
Save khyberspache/c8239ec658660c86002d2c9b0529cb26 to your computer and use it in GitHub Desktop.
PneumaEX command handler for modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if executor == "keyword" { | |
task := splitMessage(message, '.') | |
if task[0] == "module" { | |
var err error | |
if !contains(util.InstalledModuleKeywords, task[1] + "." + task[2]) { | |
err = util.InstallModule(task[1], payloadPath) | |
} | |
if err != nil { | |
return err.Error(), 1, -1 | |
} | |
if len(task) >= 4 { | |
return util.RunModuleTask(task[1], task[2], util.ParseArguments(task[3])) | |
} | |
return util.RunModuleTask(task[1], task[2], []string{}) | |
} else if task[0] == "config" { | |
return updateConfiguration(task[1], agent) | |
} | |
return "Keyword selected not available for agent", 0, 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment