Native Command TLV Structures
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 |
0x09 |
SHUTDOWN | All |
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:
0x1TYPE:INT32required: 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:
0x2TYPE:BLOBrequired: 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:
0x1TYPE:STR_UTF8required: YES VALUE: Target directory path (Unicode on Windows, ASCII on Linux/BSD)
Output
Success or error only (no result data).
0x04 — LS
Lists files and directories. Supports wildcards and recursive depth.
Input (CONF)
- ID:
0x1TYPE:STR_UTF8required: YES VALUE: Directory path or glob pattern (Unicode on Windows, ASCII on Linux/BSD) - ID:
0x2TYPE:INT32required: no VALUE: Recursion depth (default:1)
Output (result data bytes)
- ID:
0x83TYPE:PARENTVALUE: result root- ID:
0x81TYPE:PARENTVALUE: directory entry (one per directory found)- ID:
0x1TYPE:STR_UTF8VALUE: directory name - ID:
0x83TYPE:PARENTVALUE: nested directory/file entries (same structure, populated when DEPTH > 1) - ID:
0x4TYPE:INT64VALUE: creation time (Unix timestamp) - ID:
0x5TYPE:INT64VALUE: last access time (Unix timestamp) - ID:
0x6TYPE:INT64VALUE: last write/modify time (Unix timestamp) - ID:
0x7TYPE:INT32VALUE: Unix mode bits [Linux/BSD only] - ID:
0x8TYPE:STR_UTF8VALUE: owner username [Linux/BSD only] - ID:
0x9TYPE:STR_UTF8VALUE: group name [Linux/BSD only]
- ID:
- ID:
0x82TYPE:PARENTVALUE: file entry (one per file found)- ID:
0x1TYPE:STR_UTF8VALUE: filename - ID:
0x2TYPE:INT64VALUE: file size in bytes - ID:
0x4TYPE:INT64VALUE: creation time (Unix timestamp) - ID:
0x5TYPE:INT64VALUE: last access time (Unix timestamp) - ID:
0x6TYPE:INT64VALUE: last write/modify time (Unix timestamp) - ID:
0x7TYPE:INT32VALUE: Unix mode bits [Linux/BSD only] - ID:
0x8TYPE:STR_UTF8VALUE: owner username [Linux/BSD only] - ID:
0x9TYPE:STR_UTF8VALUE: group name [Linux/BSD only]
- ID:
- ID:
0x10TYPE:STR_UTF8VALUE: resolved absolute base directory path
- ID:
0x05 — PROCLIST
Returns a snapshot of all running processes.
Input (CONF)
None.
Output (result data bytes)
- ID:
0x81TYPE:PARENTVALUE: result root- ID:
0x81TYPE:PARENTVALUE: process entry (one per process)- ID:
0x1TYPE:INT32VALUE: process ID - ID:
0x2TYPE:STR_UTF8VALUE: process image name - ID:
0x3TYPE:STR_UTF8VALUE: owning user (empty if unavailable) - ID:
0x4TYPE:STR_UTF8VALUE: architecture:"64bit"|"32bit"|"???" - ID:
0x5TYPE:STR_UTF8VALUE: integrity level:"Low"|"Medium"|"High"|"System"|""[Windows only] - ID:
0x6TYPE:INT32VALUE: parent process ID - ID:
0x7TYPE:INT32VALUE: process creation time - ID:
0x8TYPE:INT32VALUE: session ID [Windows only]
- ID:
- ID:
0x06 — COMMAND_LIST
Lists all command instances currently running in the agent.
Input (CONF)
None.
Output (result data bytes)
- ID:
0x81TYPE:PARENTVALUE: result root- ID:
0x81TYPE:PARENTVALUE: job entry (one per running command)- ID:
0x1TYPE:INT32VALUE: command instance ID - ID:
0x2TYPE:INT32VALUE: in what process command is executed
- ID:
- ID:
0x07 — RUN
Spawns a process and optionally captures its output.
Input (CONF)
- ID:
0x1TYPE:STR_UTF8required: YES VALUE: Command line to execute (Unicode on Windows, ASCII on Linux/BSD) - ID:
0x2TYPE:BYTErequired: no VALUE: Capture stdout/stderr (default:1= yes) - ID:
0x3TYPE:BLOBrequired: no VALUE: Data to write to the process's stdin - ID:
0x4TYPE:STR_UTF8required: no VALUE: Run as this user (Unicode) [Windows only] - ID:
0x5TYPE:STR_UTF8required: 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 only.
Input (CONF)
- ID:
0x1TYPE:STR_UTF8required: YES VALUE: File/directory path or glob pattern (ASCII) - ID:
0x2TYPE:INT32required: no VALUE: Set permissions to this exact octal value (e.g.,0755) - ID:
0x3TYPE:INT32required: no VALUE: OR-add these permission bits - ID:
0x4TYPE:INT32required: 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:
0x81TYPE:PARENTVALUE: result root- ID:
0x1TYPE:STR_UTF8VALUE: path that was changed successfully (0..n entries) - ID:
0x2TYPE:STR_UTF8VALUE: path that could not be changed (0..n entries)
- ID:
0x09 — SHUTDOWN
Initiates a system shutdown or reboot.
Input (CONF)
- ID:
0x1TYPE:INT32required: no VALUE:0= power off (default),1= reboot
Output
Success or error only (no result data).
0x41 — BOF
Loads and executes a Beacon Object File (BOF) in-process.
Platform: Windows only.
Input (CONF)
- ID:
0x1TYPE:BLOBrequired: YES VALUE: Raw COFF/BOF binary - ID:
0x2TYPE:BLOBrequired: no VALUE: Packed argument buffer passed to the BOF entry point - ID:
0x3TYPE:STR_UTF8required: no VALUE: Export name to call (ASCII, default:"go") - ID:
0x4TYPE:BYTErequired: no VALUE: Run on a designated thread (1) rather than a new thread (0) - ID:
0x5TYPE:BYTErequired: 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:
0x1TYPE:INT32required: 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:
0x1TYPE:INT32required: 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:
0x1TYPE:INT32required: 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:
0x1TYPE:STR_UTF8required: YES VALUE: Username (Unicode) - ID:
0x2TYPE:STR_UTF8required: YES VALUE: Password (Unicode) - ID:
0x3TYPE:BYTErequired: 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:
0x1TYPE:INT32required: YES VALUE: Token handle value (cast toHANDLE/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:
0x81TYPE:PARENTVALUE: result root- ID:
0x1TYPE:STR_UTF8VALUE: privilege name (0..n, one per available privilege) - ID:
0x2TYPE:STR_UTF8VALUE: privilege name (0..n, one per currently enabled privilege)
- ID:
0x4A — PRIVILEGE_ENABLE
Enables one or all privileges on the agent process token.
Platform: Windows only.
Input (CONF)
- ID:
0x1TYPE:STR_UTF8required: 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:
0x1TYPE:STR_UTF8required: 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:
0x1TYPE:STR_UTF8required: YES VALUE: Logical name/identifier for the DLL (ASCII) - ID:
0x2TYPE:BLOBrequired: 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 and their exported functions with addresses.
Platform: Windows only.
Input (CONF)
None.
Output (result data bytes)
Raw UTF-8 text:
#<id> <name> 0x<base_address><export_name> 0x<export_address>
0x53 — OVERRIDE_REMOVE
Unloads and removes one or all override DLLs.
Platform: Windows only.
Input (CONF)
- ID:
0x1TYPE:INT32required: YES VALUE: DLL ID to remove. Use0xFFFFFFto 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.
Platform: Windows only.
Input (CONF)
- ID:
0x1TYPE:STR_UTF8required: YES VALUE: Override hook point name (ASCII) - ID:
0x2TYPE:INT32required: YES VALUE: ID of the loaded override DLL - ID:
0x3TYPE:STR_UTF8required: 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, restoring default behavior.
Platform: Windows only.
Input (CONF)
- ID:
0x1TYPE:STR_UTF8required: YES VALUE: Override hook point name to unbind (ASCII)
Output
Success or error only (no result data).