AxFunction

Data Model

agents

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

AGENT[id] ax.agents();
// AGENT STRUCT
string 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_full"]
chevron-rightExamplehashtag

credentials

Returns a list of credentials.

chevron-rightExamplehashtag

downloads

Returns a list of downloads.

chevron-rightExamplehashtag

screenshots

Returns a list of screenshots.

chevron-rightExamplehashtag

targets

Returns a list of targets.

chevron-rightExamplehashtag

tunnels

Returns a list of tunnels.

chevron-rightExamplehashtag

Functions

The following is a list of AxScript's functions:

agents

See here


agent_info

Get information from a agent session's metadata.

  • id - agent ID

  • property - CRED property (see here)

chevron-rightExamplehashtag

agent_hide

Hide agents from Sessions Table.

  • ids - array of agent ids


agent_remove

Remove agents from server.

  • ids - array of agent ids


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

  • reser - if true, reset the color to default

chevron-rightExamplehashtag

agent_set_impersonate

Set impersonate for agent's item in Session Table

  • id - agent ID

  • impersonate - impersonated user

  • elevated - is impersonated user elevated

chevron-rightExamplehashtag

agent_set_mark

Set mark for agent's item in Session Table

  • id - agent ID

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

chevron-rightExamplehashtag

agent_set_tag

Set tag for agent's item in Session Table

  • id - agent ID

  • tag - agent's tag

chevron-rightExamplehashtag

agent_update_data

Update/set agent data

  • id - agent ID

  • json_property - CRED property (see here)

chevron-rightExamplehashtag

arch

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

  • id - agent ID

chevron-rightExamplehashtag

bof_pack

Pack arguments in a way that's suitable for BOF APIs to unpack. To transmit binary data to the server, the function will encode it in base64.

  • 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

chevron-rightExamplehashtag

copy_to_clipboard

Copy text to client's clipboard.

chevron-rightExamplehashtag

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

chevron-rightExamplehashtag


convert_to_code

Convert base64 binary data to code format.

  • languaage - programming language ("c", "csharp", "python", "golang", "vbs", "nim", "rust", "powershell")

  • base64data - base64 data for converting

  • varName - var's name in code

chevron-rightExamplehashtag

credentials

See here


credentials_add

Save the specified credentials in Credentials Manager

  • 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

chevron-rightExamplehashtag

credentials_add_list

Save a list of creds in the Credentials Manager

chevron-rightExamplehashtag

create_command

See here


create_commands_group

See here


decode_data

Return decoded base64 data from algorithm ("hex", "base64", "base32", "zip" or "xor") in base64.

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

  • base64data - data in base64

  • key - encrypt key (for xor)

chevron-rightExamplehashtag

decode_file

Return decoded base64 data from algorithm ("hex", "base64", "base32", "zip" or "xor") in base64.

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

  • filepath - file with data in base64

  • key - encrypt key (for xor)

chevron-rightExamplehashtag

encode_data

Return encoded data ("hex", "base64", "base32", "zip" or "xor") in base64.

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

  • data - data for encoding

  • key - encrypt key (for xor)

chevron-rightExamplehashtag

encode_file

Return encoded data ("hex", "base64", "base32", "zip" or "xor") in base64.

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

  • filepath - file with data in base64

  • key - encrypt key (for xor)

chevron-rightExamplehashtag

execute_alias

See here


execute_browser

See here


execute_command

See here


file_basename

Returns the filename

  • path - full filename

chevron-rightExamplehashtag

file_dirname

Returns the base directory name

  • path - full filename

chevron-rightExamplehashtag

file_exists

Checks if a file exists

  • path - full filename

chevron-rightExamplehashtag

file_extension

Checks if a file exists

  • path - full filename

chevron-rightExamplehashtag

file_read

Reads a file and returns base64 encoded contents

  • path - full filename

chevron-rightExamplehashtag

file_size

Return the file size

  • path - full filename

chevron-rightExamplehashtag

file_write_text

Writes text data to a file and returns true if the write is successful.

  • path - full filename

  • text - text data

chevron-rightExamplehashtag

file_write_binary

Writes base64 data to a file and returns true if the write is successful.

  • path - full filename

  • b64text - base64 data

chevron-rightExamplehashtag

format_time

Convert UNIX Epoch Time to date/time string value.

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

  • unixtime - UNIX Epoch Time value

chevron-rightExamplehashtag

format_size

Converts bytes into a convenient format

chevron-rightExamplehashtag

get_commands

Returns a list of available commands for the agent.

  • id - agent ID

chevron-rightExamplehashtag

get_project

Returns the name of the current project.


hash

Returns a hash string in hex format.

  • algorithm - hash "sha1" or "md5";

  • length - length of the returned string

  • data - data to be hashed

chevron-rightExamplehashtag

interfaces

Returns a list of network interfaces of the teamserver

chevron-rightExamplehashtag

ids

Returns a list of agent ids

chevron-rightExamplehashtag

is64

Check if a session is on an x64 system or not

  • id - agent ID

chevron-rightExamplehashtag

isactive

Returns true if the agent is active

id - agent ID

chevron-rightExamplehashtag

isadmin

Check if a session has admin rights

  • id - agent ID

chevron-rightExamplehashtag

log / log_error

Print text to AxScript Console.

chevron-rightExamplehashtag

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

chevron-rightExamplehashtag

open_browser_files

Open the File Browser for a agent

  • id - agent ID


open_browser_process

Open the Process Browser for a agent

  • id - agent ID


open_remote_terminal

Open the Interactive Terminal for a agent

  • id - agent ID


open_remote_shell

Open the I/O remote shell for a agent

  • id - agent ID


prompt_confirm

Show a confirm dialog.

  • caption - title of the dialog

  • text - Text question

chevron-rightExamplehashtag

prompt_open_file

Show a file open dialog.

  • caption - title of the dialog

  • filter - filter for selecting files

chevron-rightExamplehashtag

prompt_open_dir

Show a directory open dialog.

  • caption - title of the dialog

chevron-rightExamplehashtag

prompt_save_file

Show a file save dialog.

  • filename - default filename

  • caption - title of the dialog

  • filter - filter for selecting files

chevron-rightExamplehashtag

random_string

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

  • set - set of characters (alphanumeric, alphabetic, numeric or hex)

chevron-rightExamplehashtag

random_int

Generates a random int value.

  • min - min value

  • max - max value

chevron-rightExamplehashtag

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

chevron-rightExamplehashtag

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

chevron-rightExamplehashtag

targets_add_list

Save a list of targets in the Targets Manager

chevron-rightExamplehashtag

ticks

UNIX Epoch Time value


validate_command

Checks the validity of the entered command and returns full information

  • id - agent ID

  • command - agents command

chevron-rightExamplehashtag

Last updated