AxScript Extensions
Overview
AxScript (.axs files) is JustC2’s extension scripting system. It serves two primary purposes:
- UI Definitions — Define forms, dialogs, and custom views for extender plugins in the client
- Automation — Create custom scripts that interact with the teamserver and agents
AxScript Files
Each extender includes an ax_config.axs file that defines how the client renders its configuration UI. When the server loads an extender, it sends the AxScript configuration to connected clients, which use it to dynamically generate the appropriate forms and controls.
Location
dist/extenders/<extender_name>/ax_config.axsUI Element Types
AxScript supports defining various UI elements that the JustClient renders dynamically:
Form Elements
- Text inputs — Single-line text fields
- Text areas — Multi-line text input
- Dropdowns — Selection from predefined options
- Checkboxes — Boolean toggles
- Number inputs — Numeric fields with optional min/max constraints
- File selectors — File browser integration
- Password fields — Masked text input
Layout
- Forms are organized into labeled sections
- Elements can have tooltips and default values
- Required fields are validated before submission
AxScript Console
The JustClient includes an AxScript Console (accessible via the Extensions toolbar button) that provides:
- Script loading and execution
- Script management (load/unload)
- Console output for script results
Services and RPC
AxScript extensions can register as services on the teamserver:
PluginService Interface
type PluginService interface {
Call(operator string, function string, args string)
CallRPC(operator string, function string, args string) (resultJSON string, err error)
}- Call — Fire-and-forget invocation
- CallRPC — Synchronous call with a JSON response
Services are accessible through the API:
GET /endpoint/service/list
POST /endpoint/service/callConfiguring AxScripts
Server-Side
Add AxScript files to profile.yaml:
Teamserver:
axscripts:
- "Extension-Kit/extension-kit.axs"Per-Extender
Each extender’s config.yaml references its AxScript:
ax_file: "ax_config.axs"Use Cases
Custom Agent Commands
AxScript defines the command interface for agents — what commands are available, their parameters, and how the client renders the command input forms.
Listener Configuration Forms
When creating a listener, the form fields (host, port, protocol-specific options) are defined by the listener extender’s AxScript configuration.
Agent Generation Forms
The agent generation dialog uses AxScript to define configurable parameters for each agent type.
Custom Automation
Standalone AxScript files can automate common workflows:
- Bulk credential testing
- Automated enumeration sequences
- Custom reporting generators
- Engagement playbook execution
Development
To create a custom AxScript for your extender:
- Study existing
ax_config.axsfiles in the built-in extenders - Define your UI elements and command structure
- Place the file in your extender directory
- Reference it in your extender’s
config.yaml - Reload the server to test