Clone the Repository

git clone https://github.com/sud0pls/JustC2.git
cd JustC2

Build Everything

The simplest way to build all components (server, client, and extenders) is:

make all

This will:

  1. Clean and create the dist/ output directory
  2. Build the Go server binary
  3. Build all extender .so plugins
  4. Build the Qt6 client

The compiled artifacts are placed in the dist/ directory.

Build Individual Components

Server Only

make server

Produces dist/justserver along with the default configuration files (profile.yaml, ssl_gen.sh, 404page.html).

The server is built with the following Go flags:

  • -buildvcs=false — Disables VCS stamping
  • -ldflags="-s -w" — Strips debug symbols for a smaller binary
  • GOEXPERIMENT=jsonv2,greenteagc — Enables experimental JSON v2 encoder and green-tea GC

Extenders Only

make extenders

Builds all extender plugins found in JustServer/extenders/. Each extender directory must contain its own Makefile. The compiled .so files and configuration are placed in dist/extenders/<name>/.

Server + Extenders (VPS Deploy)

make server-ext

Builds the server and extenders together. This is the recommended target for deploying to a VPS where you don’t need the GUI client.

Client Only

make client

Builds the Qt6 client. Requires Qt6 development libraries and CMake.

For faster builds on multi-core machines:

make client-fast

This uses all available CPU cores (-j$(nproc)).

Build Output

After a successful make all, the dist/ directory contains:

dist/
├── justserver              # Server binary
├── JustClient              # Client binary
├── profile.yaml            # Default configuration
├── ssl_gen.sh              # TLS certificate generator
├── 404page.html            # Default error page
└── extenders/
    ├── beacon_agent/
    │   ├── agent_beacon.so
    │   ├── config.yaml
    │   ├── ax_config.axs
    │   └── src_beacon/     # Agent source (for runtime compilation)
    ├── beacon_listener_http/
    │   ├── listener_beacon_http.so
    │   ├── config.yaml
    │   └── ax_config.axs
    ├── beacon_listener_tcp/
    ├── beacon_listener_smb/
    ├── beacon_listener_dns/
    ├── gopher_agent/
    │   ├── agent_gopher.so
    │   ├── config.yaml
    │   ├── ax_config.axs
    │   └── src_gopher/     # Agent source (for runtime compilation)
    └── gopher_listener_tcp/

Generate TLS Certificates

Before starting the server, generate TLS certificates:

cd dist
bash ssl_gen.sh

This creates server.rsa.crt and server.rsa.key using a self-signed RSA 2048-bit certificate valid for 10 years.

For ECDSA certificates:

openssl req -x509 -nodes -newkey ec:secp384r1 \
    -keyout server.ecdsa.key -out server.ecdsa.crt -days 3650

Post-Build Verification

Verify everything built correctly:

# Check server binary
./dist/justserver --help

# Check extenders are present
ls -la dist/extenders/*/

# Check agent source is present (required for runtime payload generation)
ls dist/extenders/beacon_agent/src_beacon/
ls dist/extenders/gopher_agent/src_gopher/

# Check Go is available system-wide (required for agent compilation)
go version

Cleaning Build Artifacts

# Remove dist directory
make clean

# Remove all build artifacts (object files, libraries, logs)
make clean-all

Troubleshooting

Go version mismatch

go: go.mod requires go >= 1.26.5

Install Go 1.26.5 or later. See Requirements.

Qt6 not found

Could not find a package configuration file provided by "Qt6"

Install Qt6 development packages:

sudo apt-get install qt6-base-dev qt6-websockets-dev qt6-5compat-dev

Agent generation fails at runtime

If agent payloads fail to generate after deployment, ensure:

  1. Go 1.26.5+ is installed on the server machine and in $PATH
  2. The agent source directories (src_beacon/, src_gopher/) are present in the extender directories
  3. The server process has write access to the extender directories