Native Commands
This section lists the native commands available, their parameters, and usage examples.
bof
Execute a BOF (Beacon Object File) and return its output.
Parameters:
- bofFile: The BOF file to run.
- method: Execution method (usually "go").
- inputArgs: Command-line arguments for the BOF in case on simple string input only.
- inputArgsEncoding: Encoding for the arguments (UTF8 or UTF16LE).
- inputAsBytes: Use binary input (overrides inputArgs if provided).
- pack_format: Format to pack the arguments.
- pack_args: List of arguments to be packed.
Example:
cd
Change the agent's working directory.
Parameter:
- dir: Directory to change to (relative or absolute).
Example:
cmd
Run a command using cmd.exe.
Parameters:
- command: Command text to execute.
- stdin: List of input strings (simulate pressing Enter between commands).
- outputEncoding: Encoding used for reading output.
Example:
die
Terminate the agent.
Example:
jobs
List currently running commands on the agent.
Example:
ls
List directory contents with a specified recursion depth.
Parameters:
- dir: Directory to list.
- depth: Number of subdirectory levels to include.
Example:
ps
List processes running on the system.
Example:
powershell
Execute a command using PowerShell.
Parameters:
- command: PowerShell command to execute.
- stdin: List of input lines for the command(simulated enter presses between).
- outputEncoding: Encoding for the output.
Example:
run
Execute an external program on the agent with optional arguments or input.
Parameters:
- cmdline: The program and its command-line arguments.
- output: Indicates whether stdout and stderr should be returned.
- stdin: List of input lines (simulated enter presses between).
- unicode: True if the input should be UTF-16 (default is false)[only Windows].
- outputEncoding: Encoding used for the program's output[only Windows].
Example:
sh
Run a command using the sh shell on the target system.
Parameters:
- command: The command to execute.
- stdin: Array of input strings for the command (simulated enter presses between).
Note: Available by default on Linux and BSD agents.
Example:
sleep
Adjust the agent’s sleep duration for HTTP/HTTPS communication.
Parameters:
- sleep: Base sleep time in seconds.
- sleepRandom: Amount of random variation in sleep time.
Example:
sleep-until
Set a specific wake-up time for the agent.
Parameter:
- sleepEnds: ISO-formatted date (Zulu time) or a UNIX timestamp.
Example:
token-del
Delete a specific token.
Parameter:
- nr: The token number to delete.
Example:
token-del-all
Delete all tokens.
Example:
token-list
List all available tokens along with related details.
Example:
token-make
Create a token using provided credentials.
Parameters:
- username: Username for token creation.
- password: Password for token creation.
- netonly: Whether the token is created as a netonly type
Example:
token-use
Select a token for use with subsequent commands.
Parameter:
- nr: Token number to use (0 resets to the default).
Example:
token-steal
Extract a token from a running process.
Parameter:
- pid: Process ID from which to steal the token.
Example: