AxEvent type
AdaptixClient generates events for various situations. To register a handler for a specific event, there are functions from the event
namespace. Several handlers can be connected to one event.
To assign a handler
to a specific event use the function
void event.on_EVENT_TYPE(handler(){}, string[] agents, string[] os = [], string[] listeners = [], string event_id = "");
handler
- a handler that will be triggered when the event occurs.agents
- an array of strings containing the names of agents for which the event will be triggered. Available options are "beacon", "gopher", etc.os
- an array of strings with the names of the operating systems for which the event will be triggered. 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 event will be triggered. The following options are available: "BeaconHTTP", "BeaconSMB", etc. If an empty array [] is specified, the command group will be registered for all listeners.event_id
- id forhandler
You can remove a handler that has an id set.
void event.remove(string event_id);
on_filebrowser_disks
This event occurs when the user clicks the Disks button in the File Browser.
void event.on_filebrowser_disks(handler(){}, string[] agents, string[] os = [], string[] listeners = [], string event_id = "");
This event must have a handler
assigned in the following format.
function handler(string id);
id
- agent ID
Example
var event_disks_action = function(id) {
ax.execute_browser(id, "disks");
}
event.on_filebrowser_disks(event_disks_action, ["beacon"]);
on_filebrowser_list
This event occurs whenever the user requests a list of files in the File Browser.
void event.on_filebrowser_list(handler(){}, string[] agents, string[] os = [], string[] listeners = [], string event_id = "");
This event must have a handler
assigned in the following format.
function handler(string id, string path);
id
- agent IDpath
- current path in File Browser
Example
var event_files_action = function(id, path) {
ax.execute_browser(id, "ls " + path);
}
event.on_filebrowser_list(event_files_action, ["beacon"]);
on_filebrowser_upload
This event occurs whenever the user requests a list of processes in the Process Browser.
void event.on_processbrowser_list(handler(){}, string[] agents, string[] os = [], string[] listeners = [], string event_id = "");
This event must have a handler
assigned in the following format.
function handler(string id, string path, string filepath );
id
- agent IDpath
- current path in File Browserfilepath
- path to the local file to upload
Example
var event_upload_action = function(id, path, filepath) {
let filename = ax.file_basename(filepath);
ax.execute_browser(id, "upload " + filepath + " " + path + filename);
}
event.on_filebrowser_upload(event_upload_action, ["beacon"]);
on_processbrowser_list
This event occurs when a user uploads a file in a File Browser.
void event.on_filebrowser_upload(handler(){}, string[] agents, string[] os = [], string[] listeners = [], string event_id = "");
This event must have a handler
assigned in the following format.
function handler(string id);
id
- agent ID
Example
var event_process_action = function(id) {
ax.execute_browser(id, "ps list");
}
event.on_processbrowser_list(event_process_action, ["beacon"]);
Last updated