Skip to content

Instantly share code, notes, and snippets.

@khyberspache
Last active Jan 19, 2021
Embed
What would you like to do?
PneumaEX command handler for modules
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