AxCommand type
Command
The ax.create_command function creates an AxCommand object that will be converted into a command for AdaptixC2 agents.
AxCommand ax.create_command(string name, string description, string example = "", string message = "");name- сonsole command name.description- description of the command.example- example of command input.message- the message that will be displayed in the agent console when the command is sent.
Arguments
The AxCommand object has methods for adding arguments to a command.
bool
The addArgBool method adds a flag argument to the command, which can have two values: true (if the flag is specified) and false (if the flag is not specified).
flag- command's flag namedescription- description of the arguments.value- default value.
int
The addArgInt method adds a numeric argument to the command. The addArgFlagInt method adds a numeric argument to the command, which must be specified after the flag.
flag- command's flag namename- command argument's name.required- iftrue, then the argument must be specified in the commanddescription- description of the arguments.value- default value.
string
The addArgString method adds a string argument to the command. The addArgFlagString method adds a string argument to the command, which must be specified after the flag.
flag- command's flag namename- command argument's name.required- iftrue, then the argument must be specified in the commanddescription- description of the arguments.value- default value.
file
The addArgFile method adds a file type argument to the command. The addArgFlagString method adds a file type argument to the command, which must be specified after the flag.
The file-type argument is the path to the file that will be read and sent to the server in base64.
flag- command's flag namename- command argument's name.required- iftrue, then the argument must be specified in the commanddescription- description of the arguments.
SubCommand
The AxCommand object has an addSubCommands method for adding subcommands to a command.
subcommands- array of AxCommand objects
PreHook
See here.
Registering commands
In order for the created commands to be used in the agent console, they must be combined into command groups using the create_commands_group function, and then the group must be registered using the register_commands_group function.
name- command group namecommands- array of AxCommand objects
group- AxCommandsGroup objectagents- an array of strings of agent names for which the command group will be available. The following options are available: "beacon", "gopher", etc.os- an array of strings with the names of the operating systems for which the command group will be available. The following options are available: "windows", "linux", "macos". If an empty array[]is specified, the command group will be registered for all operating systems.listeners- An array of strings with the names of registered listeners for which the command group will be available. The following options are available: "BeaconHTTP", "BeaconSMB", etc. If an empty array [] is specified, the command group will be registered for all listeners.
Last updated






