Skip to content

Native Command TLV Structures

This reference lists wire-command codes and their message structures. Capability names and command codes do not form a one-to-one mapping; see native-command capabilities for aliases and commands without dedicated capability bits.

Command Index

Code Name Platform
0x01 DIE All
0x02 SET_LISTENER_CONF All
0x03 CD All
0x04 LS All
0x05 PROCLIST All
0x06 COMMAND_LIST All
0x07 RUN All
0x08 CHMOD Linux / BSD / macOS
0x09 SHUTDOWN All
0x0A METADATA_FIELDS_ENABLE Capable AgentPower agents
0x0B METADATA_FIELDS_DISABLE Capable AgentPower agents
0x0C METADATA_FIELDS_REPORT Capable AgentPower agents
0x41 BOF Windows
0x42 TOKEN_STEAL Windows
0x43 TOKEN_USE Windows
0x44 TOKEN_DELETE Windows
0x45 TOKEN_DELETE_ALL Windows
0x46 TOKEN_LIST Windows
0x47 TOKEN_MAKE Windows
0x48 TOKEN_FROM_HANDLE Windows
0x49 PRIVILEGE_LIST Windows-commercial
0x4A PRIVILEGE_ENABLE Windows-commercial
0x4B PRIVILEGE_DISABLE Windows-commercial
0x51 OVERRIDE_ADD Windows-commercial
0x52 OVERRIDE_LIST Windows-commercial
0x53 OVERRIDE_REMOVE Windows-commercial
0x54 OVERRIDE_SET Windows-commercial
0x55 OVERRIDE_UNSET Windows-commercial

0x01 — DIE

Terminates the agent process, optionally erasing the agent binary from the filesystem.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: no VALUE: If non-zero, erase agent binary from filesystem before dying

Output

None (process exits).


0x02 — SET_LISTENER_CONF

Reconfigures the agent's listener (C2 communication settings) at runtime.

Input (CONF)

  • ID: 0x2 TYPE: BLOB required: YES VALUE: Raw listener configuration blob

Output

Success or error only (no result data).


0x03 — CD

Changes the agent's current working directory.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Target directory path (Unicode on Windows, ASCII on Linux, BSD, and macOS)

Output

Success or error only (no result data).


0x04 — LS

Lists files and directories. Supports wildcards and recursive depth.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Directory path or glob pattern (Unicode on Windows, ASCII on Linux, BSD, and macOS)
  • ID: 0x2 TYPE: INT32 required: no VALUE: Recursion depth (default: 1)

Output (result data bytes)

  • ID: 0x83 TYPE: PARENT VALUE: result root
    • ID: 0x81 TYPE: PARENT VALUE: directory entry (one per directory found)
      • ID: 0x1 TYPE: STR_UTF8 VALUE: directory name
      • ID: 0x83 TYPE: PARENT VALUE: nested directory/file entries (same structure, populated when DEPTH > 1)
      • ID: 0x4 TYPE: INT64 VALUE: creation time (Unix timestamp)
      • ID: 0x5 TYPE: INT64 VALUE: last access time (Unix timestamp)
      • ID: 0x6 TYPE: INT64 VALUE: last write/modify time (Unix timestamp)
      • ID: 0x7 TYPE: INT32 VALUE: Unix mode bits [Linux, BSD, and macOS]
      • ID: 0x8 TYPE: STR_UTF8 VALUE: owner username [Linux, BSD, and macOS]
      • ID: 0x9 TYPE: STR_UTF8 VALUE: group name [Linux, BSD, and macOS]
    • ID: 0x82 TYPE: PARENT VALUE: file entry (one per file found)
      • ID: 0x1 TYPE: STR_UTF8 VALUE: filename
      • ID: 0x2 TYPE: INT64 VALUE: file size in bytes
      • ID: 0x4 TYPE: INT64 VALUE: creation time (Unix timestamp)
      • ID: 0x5 TYPE: INT64 VALUE: last access time (Unix timestamp)
      • ID: 0x6 TYPE: INT64 VALUE: last write/modify time (Unix timestamp)
      • ID: 0x7 TYPE: INT32 VALUE: Unix mode bits [Linux, BSD, and macOS]
      • ID: 0x8 TYPE: STR_UTF8 VALUE: owner username [Linux, BSD, and macOS]
      • ID: 0x9 TYPE: STR_UTF8 VALUE: group name [Linux, BSD, and macOS]
    • ID: 0x10 TYPE: STR_UTF8 VALUE: resolved absolute base directory path

0x05 — PROCLIST

Returns a snapshot of all running processes.

Input (CONF)

None.

Output (result data bytes)

  • ID: 0x81 TYPE: PARENT VALUE: result root
    • ID: 0x81 TYPE: PARENT VALUE: process entry (one per process)
      • ID: 0x1 TYPE: INT32 VALUE: process ID
      • ID: 0x2 TYPE: STR_UTF8 VALUE: process image name
      • ID: 0x3 TYPE: STR_UTF8 VALUE: owning user (empty if unavailable)
      • ID: 0x4 TYPE: STR_UTF8 VALUE: architecture: "64bit" | "32bit" | "???"
      • ID: 0x5 TYPE: STR_UTF8 VALUE: integrity level: "Low" | "Medium" | "High" | "System" | "" [Windows only]
      • ID: 0x6 TYPE: INT32 VALUE: parent process ID
      • ID: 0x7 TYPE: INT32 VALUE: process creation time
      • ID: 0x8 TYPE: INT32 VALUE: session ID [Windows only]

0x06 — COMMAND_LIST

Lists all command instances currently running in the agent.

Input (CONF)

None.

Output (result data bytes)

  • ID: 0x81 TYPE: PARENT VALUE: result root
    • ID: 0x81 TYPE: PARENT VALUE: job entry (one per running command)
      • ID: 0x1 TYPE: INT32 VALUE: command instance ID
      • ID: 0x2 TYPE: INT32 VALUE: in what process command is executed

0x07 — RUN

Spawns a process and optionally captures its output.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Command line to execute (Unicode on Windows, ASCII on Linux, BSD, and macOS)
  • ID: 0x2 TYPE: BYTE required: no VALUE: Capture stdout/stderr (default: 1 = yes)
  • ID: 0x3 TYPE: BLOB required: no VALUE: Data to write to the process's stdin
  • ID: 0x4 TYPE: STR_UTF8 required: no VALUE: Run as this user (Unicode) [Windows only]
  • ID: 0x5 TYPE: STR_UTF8 required: no VALUE: Password for the specified user (Unicode) [Windows only]

Output (result data chunks)

Raw stdout/stderr bytes.


0x08 — CHMOD

Changes file/directory permissions. Supports glob patterns.

Platform: Linux / BSD / macOS.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: File/directory path or glob pattern (ASCII)
  • ID: 0x2 TYPE: INT32 required: no VALUE: Set permissions to this exact octal value (e.g., 0755)
  • ID: 0x3 TYPE: INT32 required: no VALUE: OR-add these permission bits
  • ID: 0x4 TYPE: INT32 required: no VALUE: AND-NOT-remove these permission bits

At least one of ACCESS_FULL (0x2), ACCESS_ADD (0x3), or ACCESS_REMOVE (0x4) should be provided.

Output (result data bytes)

  • ID: 0x81 TYPE: PARENT VALUE: result root
    • ID: 0x1 TYPE: STR_UTF8 VALUE: path that was changed successfully (0..n entries)
    • ID: 0x2 TYPE: STR_UTF8 VALUE: path that could not be changed (0..n entries)

0x09 — SHUTDOWN

Initiates a system shutdown or reboot.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: no VALUE: 0 = power off (default), 1 = reboot

Output

Success or error only (no result data).


0x0A — METADATA_FIELDS_ENABLE

Enables selected optional metadata fields in a running agent. Availability is advertised by the METADATA_FIELDS_ENABLE capability bit; support varies by agent build. These changes reset to the payload's configured policy after an agent restart.

Input (CONF)

For each selected field, add a parent 0x01 containing two BYTE children: 0x01 is the metadata field ID and 0x02 is its component mask. Ordinary fields use mask 0x01. NETWORK_INTERFACES (field ID 0x12) uses 0x01 for MAC, 0x02 for IPv4, 0x04 for IPv6, and 0x08 for name; combine flags to select more than one component. At least one selector is required.

Output

A metadata-field report as described under METADATA_FIELDS_REPORT.


0x0B — METADATA_FIELDS_DISABLE

Disables selected optional metadata fields. Its input and output have the same structure as 0x0A. Required identity, encryption, and capability fields cannot be disabled. Availability is advertised by the METADATA_FIELDS_DISABLE capability bit.


0x0C — METADATA_FIELDS_REPORT

Reports the current metadata-field policy. Availability is advertised by the METADATA_FIELDS_REPORT capability bit.

Input (CONF)

Empty configuration.

Output (result data bytes)

One root parent 0x01 contains a parent 0x02 for each metadata field, in field-ID order. Each field record contains five ordered one-byte values: 0x01 field ID, 0x02 configured flags, 0x03 effective flags, 0x04 forced flags, and 0x05 supported flags. The effective flags equal the configured flags OR the forced flags. Use this report before enabling or disabling fields. See Metadata Controls for user-facing selectors and examples.


0x41 — BOF

Loads and executes a Beacon Object File (BOF) in-process.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: BLOB required: YES VALUE: Raw COFF/BOF binary
  • ID: 0x2 TYPE: BLOB required: no VALUE: Packed argument buffer passed to the BOF entry point
  • ID: 0x3 TYPE: STR_UTF8 required: no VALUE: Export name to call (ASCII, default: "go")
  • ID: 0x4 TYPE: BYTE required: no VALUE: Run on a designated thread (1) rather than a new thread (0)
  • ID: 0x5 TYPE: BYTE required: no VALUE: Free BOF memory after execution (1 = yes, default: 0)

Output (result data chunks)

Raw BeaconPrintf/BeaconOutput callback data, streamed as TLV__COMMAND__NEW_RESULT_DATA (0x30) messages.

Special in-band markers for file operations emitted by BOF callbacks:

  • "<!<!<FILE-FOR-BOF>!>!>S" — file read start
  • "<!<!<FILE-FOR-BOF>!>!>W" — file write
  • "<!<!<FILE-FOR-BOF>!>!>C" — file close

BOF error callbacks use callback type 0x0D.


0x42 — TOKEN_STEAL

Duplicates an impersonation token from a target process.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: YES VALUE: Process ID to steal the token from

Output (result data bytes)

Raw UTF-8 string: "<token_nr>: DOMAIN\username\n"


0x43 — TOKEN_USE

Activates a previously stolen or created token for subsequent operations.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: YES VALUE: Token number (from TOKEN_STEAL / TOKEN_MAKE / TOKEN_FROM_HANDLE)

Output

Success or error only (no result data).


0x44 — TOKEN_DELETE

Removes a specific token from the token store.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: YES VALUE: Token number to delete

Output

Success or error only (no result data).


0x45 — TOKEN_DELETE_ALL

Removes all stored tokens.

Platform: Windows only.

Input (CONF)

None.

Output

Success or error only (no result data).


0x46 — TOKEN_LIST

Lists all stored tokens with their associated usernames.

Platform: Windows only.

Input (CONF)

None.

Output (result data bytes)

Raw UTF-8 string, one token per line: "<nr>: DOMAIN\username\n"


0x47 — TOKEN_MAKE

Creates a new logon token from credentials (calls LogonUserW).

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Username (Unicode)
  • ID: 0x2 TYPE: STR_UTF8 required: YES VALUE: Password (Unicode)
  • ID: 0x3 TYPE: INT32 required: no VALUE: 0 = interactive logon (default), 1 = network-only logon (LOGON32_LOGON_NETWORK)

Output (result data bytes)

Raw UTF-8 string: "<token_nr>: DOMAIN\username\n"


0x48 — TOKEN_FROM_HANDLE

Stores an existing token handle (e.g., delivered via TLV__COMMAND__NEW_TOKEN_HANDLE) into the token store.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: YES VALUE: Token handle value (cast to HANDLE / void*)

Output (result data bytes)

Raw UTF-8 string: "<token_nr>: DOMAIN\username\n" or error string.


0x49 — PRIVILEGE_LIST

Returns the set of available and currently-enabled privileges for the agent process.

Platform: Windows only.

Input (CONF)

None.

Output (result data bytes)

  • ID: 0x81 TYPE: PARENT VALUE: result root
    • ID: 0x1 TYPE: STR_UTF8 VALUE: privilege name (0..n, one per available privilege)
    • ID: 0x2 TYPE: STR_UTF8 VALUE: privilege name (0..n, one per currently enabled privilege)

0x4A — PRIVILEGE_ENABLE

Enables one or all privileges on the agent process token.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Privilege name (Unicode), e.g., "SeDebugPrivilege". Use "*" to enable all available privileges.

Output (result data bytes)

Same structure as PRIVILEGE_LIST — reflects the updated privilege state.


0x4B — PRIVILEGE_DISABLE

Disables one or all privileges on the agent process token.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Privilege name (Unicode). Use "*" to disable all privileges.

Output (result data bytes)

Same structure as PRIVILEGE_LIST — reflects the updated privilege state.


0x51 — OVERRIDE_ADD

Loads a DLL into the agent process for use as a function override.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Logical name/identifier for the DLL (ASCII)
  • ID: 0x2 TYPE: BLOB required: YES VALUE: Raw DLL binary

Output (result data bytes)

Raw UTF-8 text: DLL load confirmation with assigned ID and exported function list.


0x52 — OVERRIDE_LIST

Lists all currently loaded override DLLs, their exported functions with addresses, and the current binding for every override hook.

Platform: Windows only.

Input (CONF)

None.

Output (result data bytes)

Raw UTF-8 text:

  • #<id> <name> 0x<base_address>
    • <export_name> 0x<export_address>

The response also includes an Overrides: section with an entry for every hook. A bound entry identifies its function address, DLL name and ID, and export name. An unbound entry contains NO CUSTOM IMPLEMENTATION. This section is present even when no override DLLs are loaded.


0x53 — OVERRIDE_REMOVE

Unloads and removes one or all override DLLs.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: INT32 required: YES VALUE: DLL ID to remove. Use 0xFFFFFF to remove all.

Output

Success or error only (no result data).


0x54 — OVERRIDE_SET

Binds a loaded override DLL export to a specific override hook point.

The DLL Override Functions reference lists accepted hook names and export signatures.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Override hook point name (ASCII)
  • ID: 0x2 TYPE: INT32 required: YES VALUE: ID of the loaded override DLL
  • ID: 0x3 TYPE: STR_UTF8 required: YES VALUE: Exported function name to bind (ASCII)

Output

Success or error only (no result data).


0x55 — OVERRIDE_UNSET

Removes a binding from an override hook point so future calls use the built-in path. The DLL remains loaded. Unsetting does not invoke callback cleanup or undo effects of earlier calls.

Platform: Windows only.

Input (CONF)

  • ID: 0x1 TYPE: STR_UTF8 required: YES VALUE: Override hook point name to unbind (ASCII)

Output

Success or error only (no result data).