Skip to main content
  1. Documentation/
  2. Architecture/

Build System

Table of Contents
TantoC2’s build system generates agent binaries with encrypted configuration stamped in.

Agent Build Pipeline
#

Agent Build Pipeline

Config Stamping
#

Agent packages define their own stamping mechanism. The default approach uses a marker block — 256 bytes of 0xDEADBEEF — which the build manager replaces with an encrypted configuration blob containing:

  • Callback addresses (host, port, protocol)
  • Kill date (mandatory)
  • Beacon interval and jitter
  • Agent-specific configuration

The configuration is encrypted before stamping, so it does not appear in plaintext in the binary. The specific stamping approach (marker replacement, appended blob, etc.) is defined by the agent developer as part of the agent package.

Output Formats
#

Agent packages declare their available output formats through build templates. Each template has a platform, arch, mode (beacon or session), and format. The operator specifies the desired combination at build time; the teamserver resolves the correct template internally. Common formats include:

PlatformFormats
WindowsEXE, DLL, shellcode, service binary, BOF
LinuxELF, SO, shellcode

Templates also declare a mode (AgentMode.BEACON or AgentMode.SESSION). The valid modes for a given build are the intersection of the package’s template modes and the transport plugin’s supported_modes() — for example, the HTTP transport declares [BEACON] and the TCP transport declares [SESSION].

Build API
#

List Packages and Templates
#

1
2
3
GET /api/v1/builds/packages
GET /api/v1/builds/packages/<name>/templates
GET /api/v1/builds/packages/<name>/schema

Create a Build
#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
POST /api/v1/builds/
{
  "package_name": "dev_agent",
  "platform": "linux",
  "arch": "x86_64",
  "mode": "beacon",
  "listener_id": "uuid-...",
  "callbacks": [
    {"host": "10.0.0.1", "port": 8080, "protocol": "https"}
  ],
  "kill_date": "2026-12-31",
  "beacon_interval": 60,
  "beacon_jitter": 10
}

platform, arch, mode, and listener_id are optional. The teamserver resolves the matching template internally. Valid modes are the intersection of the package’s template modes and the listener transport’s supported_modes().

Download
#

1
GET /api/v1/builds/<id>/download

CLI Workflow
#

1
2
3
4
tantoc2[my-op]> agents generate dev_agent \
    --listener my-listener \
    --kill-date 2026-12-31 \
    --interval 60 --jitter 10

Build management is integrated into the agents command. Use agents builds to list and download existing builds.

Project Build System
#

TantoC2 uses Hatch as its build backend.

Makefile Targets
#

TargetDescription
make allBuild all wheels (server, CLI, dev agent, web UI)
make buildBuild teamserver wheel
make build-cliBuild CLI wheel
make build-dev-agentBuild dev agent wheel
make build-webBuild web UI (npm + wheel)
make devInstall in development mode
make testRun pytest with coverage
make lintRun ruff linter
make typecheckRun mypy
make formatFormat with ruff
make checkAll checks (lint + typecheck + test)
make cleanRemove build artifacts

Docker
#

1
2
docker build -t tantoc2 .
docker run -d -p 8443:8443 -v tantoc2-data:/app/data tantoc2