API: Aliases
This section explains how to manage command aliases using the updated API format.
Get All Aliases
Retrieve all available aliases.
| GET /api/v1/command-alias HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Create a New Alias
Add a new alias. Use the keys:
- "name" for the alias identifier.
- "description" for a short description.
- "baseTemplate" for choosing the command template.
- "fixedConfiguration" for the fixed parameters.
Request (JSON):
| POST /api/v1/command-alias HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"name": "{ALIAS_NAME}",
"description": "{ALIAS_DESCRIPTION}",
"baseTemplate": "{BASE_TEMPLATE}",
"fixedConfiguration": {FIXED_CONFIGURATION}
}
|
Example:
| POST /api/v1/command-alias HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"name": "powershell-whoami",
"description": "Alias for running whoami in PowerShell",
"baseTemplate": "powershell",
"fixedConfiguration": {
"command": "whoami"
}
}
|
BOF Alias with File Upload
For aliases that require file uploads (e.g. BOF aliases), use a multipart/form-data request.
Request:
| POST /api/v1/command-alias HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: multipart/form-data; boundary=boundary
--boundary
Content-Disposition: form-data; name="requestBody"
Content-Type: application/json; charset=UTF-8
{
"name": "bof-test",
"description": "Alias for executing a BOF file",
"baseTemplate": "bof",
"fixedConfiguration": {
"method": "go",
"inputArgs": []
}
}
--boundary
Content-Disposition: form-data; name="bofFile"; filename="hello.txt"
Hello world!!!
--boundary--
|
Delete an Alias
Remove an alias by specifying its name.
| DELETE /api/v1/command-alias/{ALIAS_NAME} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Get Alias Details
Fetch detailed information about a specific alias by its name.
| GET /api/v1/command-alias/{ALIAS_NAME} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|