For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

AxFunction

Data Model

agents

Get information about all agents calling back to this Adaptix teamserver.

AGENT[id] ax.agents();
// AGENT STRUCT
int    agent["id"]
string agent["type"]
string agent["listener"]
string agent["external_ip"]
string agent["internal_ip"]
string agent["domain"]
string agent["computer"]
string agent["username"]
string agent["impersonated"]
string agent["process"]
string agent["arch"]
int    agent["pid"]
int    agent["tid"]
int    agent["gmt"]
int    agent["acp"]
int    agent["oemcp"]
bool   agent["elevated"]
string agent["tags"]
bool   agent["async"]
int    agent["sleep"]
string agent["os"]
string agent["os_full"]
Example

credentials

Returns a list of credentials.

Example

downloads

Returns a list of downloads.

Example

payloads

Returns the payloads stored on the teamserver. The client returns an object keyed by the payload id. The teamserver returns an array of objects.

The client reads p_id from JSON through a JavaScript number, so an id above 2^53 is already rounded before it becomes the object key.

Example

screenshots

Returns a list of screenshots.

Example

targets

Returns a list of targets.

Example

tunnels

Returns a list of tunnels.

Example

Functions

The following is a list of AxScript's functions:

agents

See here


agent_get_command_groups

Returns the command groups of one session as {name, enabled} objects. The teamserver returns [] when the session is missing.


agent_info

Get information from a agent session's metadata.

  • id - agent ID

  • property - CRED property (see here)

Example

agent_hide

Hide agents from Sessions Table.

  • ids - array of agent ids. A single id is an error. On the teamserver this call does nothing.


agent_remove

Remove agents from server.

  • ids - array of agent ids. A single id is an error. On the teamserver this call does nothing.


agent_set_color

Set color for agent's item in Session Table

  • ids - array of agent ids

  • background - item background color in hex RGB

  • foreground - item text color in hex RGB

  • reset - if true, reset the color to default. ids must be an array.

Example

agent_set_command_group

Enables or disables one command group on a session.


agent_set_impersonate

Set impersonate for agent's item in Session Table

  • id - agent ID

  • impersonate - impersonated user

  • elevated - is impersonated user elevated

Example

agent_set_mark

Set mark for agent's item in Session Table

  • ids - array of agent ids. A single id is an error.

  • mark - agent's mark ("Terminated", "Inactive", "Disconnect", empty "" for active).

Example

agent_set_tag

Set tag for agent's item in Session Table

  • ids - array of agent ids. A single id is an error.

  • tag - agent's tag

Example

agent_update_data

Update/set agent data

  • id - agent ID

  • json_property - CRED property (see here)

Example

arch

Returns the architecture of agent session (e.g., x86 or x64)

  • id - agent ID


base64_decode / base64_encode

Teamserver only. The client does not define these. Decode returns an ArrayBuffer, empty on a bad string. Encode returns a string. Input to encode is an ArrayBuffer, a typed array, or a string.


bof_pack

Pack arguments in a way that's suitable for BOF APIs to unpack. A bytes argument is an ArrayBuffer, a typed array, or a UTF-8 string.

  • types - a set of comma separated string types for BOF's arguments

  • args - array of BOF's arguments

Type
Description
Unpack With (C)

bytes

binary data

BeaconDataExtract

int

4-byte integer

BeaconDataInt

short

2-byte short integer

BeaconDataShort

cstr

zero-terminated+encoded string

BeaconDataExtract

wstr

zero-terminated wide-char string

(wchar_t *)BeaconDataExtract

Example

copy_to_clipboard

Copy text to client's clipboard.

Example

console_message

Print an output message and text to the agent console.

  • id - agent ID

  • message - brief message

  • type - message type ("info", "success", or "error")

  • text - text output

Example

convert_to_code

Renders bytes as source code. data is an ArrayBuffer, a typed array, or a string.

  • language - c, csharp, python, golang, vbs, nim, rust, or powershell

  • varName - variable name in the generated code

Example

credentials

See here


credentials_add

Save the specified credentials in Credentials Manager. The client returns nothing. The teamserver returns true or false. Argument order is the same on both.

  • username - creds username

  • password - creds secret

  • realm - creds domain/realm

  • type - creds type (possible "password", "hash", "rc4", "aes128", "aes256", "token")

  • tag - creds tag

  • storage - creds container (possible "browser", "dpapi", "database", "sam", "lsass", "ntds", "manual")

  • host - the host where the credentials were stored

Example

credentials_add_list

Save a list of creds in the Credentials Manager. The teamserver returns true or false. Each item is an object with username, password, realm, type, tag, storage, and host.

Example

create_command

See here


create_commands_group

See here


decode_data

Decodes data and returns raw bytes. hex, base64, and base32 take a text string. xor and zip take an ArrayBuffer, a typed array, or a string of bytes.

  • algorithm - hex, base64, base32, zip, or xor.

  • key - key for xor.

Example

decode_file

Reads a file and decodes it. Always returns an ArrayBuffer.

Example

encode_data

Same return rule as encode_data, reading the file first.

  • algorithm - string (UTF-8), ArrayBuffer, or typed array.

  • key - key for xor.

Example

editor_profile_upsert

Client only. Registers or updates a managed code-editor profile. The teamserver does not define this function.

id is required and is the stable key. A value that is not an object returns "error: expected object". An empty id returns "error: id is required". The same text is written to the script log.

An id that starts with system., or the name AxScript, BOF, or Event Handler, returns "error: cannot upsert system profile".

  • name — display name. Defaults to id. On insert, a name that is already taken becomes name_1, name_2, and so on.

  • language — defaults to "plain".

  • panel_script or panelScript — panel script. An empty value uses the built-in custom panel.

  • persist — defaults to true. false keeps the profile in memory and does not write it to the local database.

  • force — defaults to false. true overwrites a profile the operator created in Settings and marks it managed. Without force that profile is left unchanged.

  • toolbar — newFile, openFile, openFolder, save, explorer, buildLog, minimap, wordWrap (bool, on by default), and panel. "axscript" shows the script panel, "build" shows the build panel, and any other value hides the panel.

  • actions — {id, label, icon, script} objects. An empty id becomes the lower-case label. An empty list uses the built-in Build and Stop actions.

Returns "inserted", "updated", "unchanged", or "error:…". The same id and the same content does nothing. Changing only persist does not change the stored hash, so that call also returns "unchanged". An update keeps the panel state already stored for the profile.


encode_file

Same return rule as encode_data, reading the file first.

  • algorithm - "hex", "base64", "base32", "zip" or "xor".

  • filepath - file with data in base64

  • key - encrypt key (for xor)

Example

event_handler_register

Client only. Registers an event handler through the teamserver. A server script, a missing connection, or a meta value that is not an object returns false, and the reason is written to the script log.

name, event, and script are required. Optional fields are id, group, description, enabled, and filters.


execute_alias

See here


execute_browser

See here


execute_command

See here


file_basename

Returns the filename

  • path - full filename

Example

file_dirname

Returns the base directory name

  • path - full filename

Example

file_exists

Checks if a file exists

  • path - full filename

Example

file_extension

Checks if a file exists

  • path - full filename

Example

file_read

Reads a file and returns the raw bytes. The teamserver returns null when the file is missing or outside the sandbox. The client returns an empty ArrayBuffer in those cases.

  • path - full filename

Example

file_size

Return the file size

  • path - full filename. The client returns -1 when the path is rejected. The teamserver returns 0 when the path is missing or outside the sandbox.

Example

file_write

Writes bytes to a file and returns true on success.

  • path - full filename. On the server the path must stay inside the script sandbox.

  • data - ArrayBuffer, typed array, or string (written as UTF-8).

  • append - append instead of truncate.

Example

format_time

Convert UNIX Epoch Time to date/time string value.

  • format - datetime format (e.g. "dd/MM/yyyy hh🇲🇲ss")

  • unixtime - UNIX Epoch Time value

Example

format_size

Converts bytes into a convenient format

Example

get_commands

Returns a list of available commands for the agent.

  • id - agent ID

Example

get_project

Returns the name of the current project.


hash

Returns a hash string in hex format.

  • algorithm — md5, sha1, sha256, or sha512 (case-insensitive). Unknown names return an empty string.

  • length — how many hex characters to return. 0 returns the full digest.

  • data — string, ArrayBuffer, or typed array. The argument order is (algorithm, length, input).

Example

interfaces

Returns a list of network interfaces of the teamserver

Example

ids

Returns a list of agent ids

Example

is64

Check if a session is on an x64 system or not

  • id - agent ID

Example

isactive

Returns true if the agent is active

id - agent ID

Example

isadmin

Check if a session has admin rights

  • id - agent ID

Example

log / log_error

Print text to AxScript Console.

Example

open_agent_console

Open the console to interact with a agent

  • id - agent ID


open_access_tunnel

Open the tunnel creation dialog window

  • id - agent ID

  • socks4 - is agent support socks4

  • socks5 - is agent support socks5

  • lportfwd - is agent support local port forwarding

  • rportfwd - is agent support reverse port forwarding

Example

open_browser_files

Open the File Browser for a agent

  • id - agent ID

  • zone — optional dock zone. Omit it to use the default placement


open_browser_process

Open the Process Browser for a agent

  • id - agent ID

  • zone — optional dock zone. Omit it to use the default placement


open_code_editor

Opens the code editor. No arguments opens an empty editor. A number first argument is an agent id, and the second argument is a zone string or an options object (profiles, profile, zone). An object first argument is those options alone. Client only.


open_remote_terminal

Open the Interactive Terminal for a agent

  • id - agent ID

  • zone — optional dock zone. Omit it to use the default placement


plugin_agent_command

Calls PluginAgent.Call for one session.


plugin_listener_command

Calls PluginListener.Call.


plugin_service_command

Calls PluginService.Call. args is a JSON object.


plugin_service_wait

Calls PluginService.CallRPC and returns the JSON result. timeoutMs is optional.


process

Runs a local process from the code editor, and only when Settings allows process execution for scripts.


open_remote_shell

Open the I/O remote shell for a agent

  • id - agent ID

  • zone — optional dock zone. Omit it to use the default placement


prompt_confirm

Show a confirm dialog. Returns true when the operator presses Yes. The teamserver always returns false.

  • caption - title of the dialog

  • text - Text question

Example

prompt_open_file

Show a file open dialog.

  • caption - title of the dialog

  • filter - filter for selecting files

Example

prompt_open_dir

Show a directory open dialog.

  • caption - title of the dialog

Example

prompt_save_file

Show a file save dialog.

  • filename - default filename

  • caption - title of the dialog

  • filter - filter for selecting files

Example

random_string

Generates a random string of length len from a set of characters set.

  • set — client: alphanumeric, alphabetic, numeric. Any other name, including hex, uses 0-9a-f. Teamserver: hex, alpha, numeric, lower, upper. Any other name uses letters and digits. Length is capped at 4096 on the teamserver

Example

random_int

Generates a random int value.

  • min, max — the client range includes max. The teamserver range is [min, max).

Example

register_commands_group

See here


script_import

Import AxScript script into current script's env.

  • path - path to script file


script_load

Load a new script to AxScript Manager

  • path - path to script file


script_unload

Unload a script from the AxScript Manager

  • path - path to script file


script_dir

Returns the directory where the script is located.


show_message

Shows a message to the user in a dialog box. Use this function to relay information.

  • title - title of the dialog

  • text - the message text

Example

targets_add

Save the specified target in Targets Manager

  • computer - computer name

  • domain - domain name

  • address - IP address

  • os - OS type (possible "windows", "linux", "macos")

  • osDesc - detailed information about OS

  • tag - tag

  • info - info

  • alive - true if the host is alive

Example

targets_add_list

Save a list of targets in the Targets Manager

Example

ticks

UNIX Epoch Time value


tokenize

Splits a command line with quote and backslash rules. Teamserver only. The client has the same splitter internally but does not expose ax.tokenize.


validate_command

Checks the validity of the entered command and returns full information

  • id - agent ID

  • command - agents command

Example

Last updated