A Typo, a Leaked Token and Booby-Trapped Go Packages: Inside the CCDS C2 Server

The CCDS controller crashed on a single misspelled exception name. Its own logs then printed the full source path, the function names and the line numbers of the code that failed. It’s an unusual way to learn how a C2 framework works, but that’s how much of this analysis came together.

In our CCDS C2: Infrastructure and Payload Analysis report, ThreatMon’s threat intelligence team looked at artifacts recovered from 161.97.113.228, a Debian VPS running a custom remote-control framework its developer calls CCDS. The same server also hosted a set of Go packages that open a reverse shell or send system data the moment another project imports them. That second part is the one software teams should pay attention to.

Key Findings

  • CCDS is a custom, Python-based C2 framework for Linux. It supports remote shell execution, agent management and two-way file transfer, with size and hash checks on every transfer.
  • Two communication models were found. One is a persistent TLS listener on TCP/4444 with a local management API. The other is an HTTP(S) polling agent that checked auto.0xnayel.com every second.
  • The controller ran as an enabled systemd service, ccds-c2.service, so it survived restarts.
  • Authentication relied on one shared REVSHELL_TOKEN. A full copy of the token sat in plaintext in archived session data.
  • Go packages on the same server use init() functions and a CGO constructor to launch a Bash reverse shell or exfiltrate data to TCP/9999 as soon as they’re loaded.
  • The logs date the activity to 13–14 June 2026. They show testing and discovery only. No destructive commands, victims or attribution were found.

What CCDS Does

The TLS version keeps operator traffic and agent traffic apart. The operator sends commands to a management API bound to 127.0.0.1:5001 (POST /execute, GET /agents). The controller then forwards them over a persistent TLS session to agents connected on 0.0.0.0:4444.

CCDS controller communication architecture

The first agent, kali-1, registered about 31 seconds after the controller started. Its first command was echo "alive" && uname -r. Next came a round of file transfer tests: 100 KB and 2 MB files were uploaded to /tmp, pulled back and compared by hash. The controller also retrieved /etc/hostname, which shows it can collect files already on the host and isn’t limited to files it placed there.

The other commands in the logs were standard reconnaissance: whoami, id, uname -a, reading /etc/os-release, and a curl call to api.ipify.org to learn the agent’s public IP. Nothing destructive appears. The agent still accepts any shell string it’s given, though, so this is a general-purpose remote shell, not a limited admin tool.

The polling agent test-agent-1 handled file operations a little differently. It used reserved prefixes, __file_read__ and __file_write__, and attached an eight-character job ID to each task. One test file was named agent-secret.txt, but it only contained the string “this is a secret payload” followed by a Unix timestamp. That timestamp is how we dated an otherwise undated log to 14 June 2026.

The Mistakes That Gave It Away

A misspelled exception. The controller’s error handler catches ssl.SSLErrorWantReadError. Python has no such class; the correct name is ssl.SSLWantReadError. When an agent connection broke, Python tried to evaluate that name, raised an AttributeError and wrote a full traceback to the log. The traceback showed the controller’s internal flow from do_POST() to _read_result(), along with file paths and line numbers. For hunters, it also works as a fingerprint for this specific codebase.

A port open to the internet. Because 4444 was bound to every interface, internet scanners found it within hours. The log records failed TLS handshakes and plain HTTP requests, including one from a zgrab/0.x scanner. The controller rejected that request as a “bad agent_id,” which tells us the first value it expects after the TLS handshake is the agent’s identifier.

Internet scanners hitting the CCDS listener on TCP/4444

One token for everything. The controller, the operator client and the agent all read the same REVSHELL_TOKEN environment variable. We found no per-agent credentials, roles, expiry or replay protection. A complete copy of the token turned up in plaintext in archived session output. We’ve redacted it in the report, as shown below.

Shared REVSHELL_TOKEN across controller, client and agent (redacted)

The Go Packages Are the Real Warning

The C2 logs show a framework under test. The Go packages show payloads that are ready to run.

The most direct example is evil_pkg10/pkg10.go. Its init() function opens an interactive Bash reverse shell to 161.97.113.228:4444. Go runs init() automatically when a program starts, so a developer who imports this package never has to call anything suspicious. Starting the application is enough.

Go package launching a Bash reverse shell from init()

Two more packages, pkg40 and pkg41, run id, Base64-encode the output and send it in a URL query to port 9999. This gives the operator the user, UID/GID and group memberships of whatever process loaded the code. Base64 isn’t encryption, so anyone watching the traffic can read the data too.

How the id output is encoded and sent to TCP/9999

evilrepo/pkg70.go takes a different route. It uses a CGO __attribute__((constructor)) to read /flag.txt when the component loads, before any application logic runs. The flag file points to a lab or CTF setup. Point the same code at .env, ~/.aws/credentials or a CI secret, though, and it becomes a working build-time stealer. A small Python script, webhook2.py, listens on port 9999 and logs whatever arrives.

The package names, the /flag.txt target and a few harmless “hello” control packages all suggest dependency-confusion or supply-chain testing. We found no evidence that any of these packages reached a real project. Still, the technique works exactly the same way in an actual attack, and that’s what makes it worth a close look. It’s the same risk that supply chain monitoring is meant to cover: code you didn’t write, running with your build’s permissions.

What to Look For

TypeIndicator
IP / ports161.97.113.228 on TCP/4444 (agent listener, reverse shell) and TCP/9999 (callback collector)
Domainsauto.0xnayel.com (polling controller); nleaks.0xnayel.com, nn.0xnayel.com (pivots via passive DNS)
Servicesccds-c2.service, remote-agent.service
Paths/root/CCDS/controller/revshell/, /etc/ccds-c2/token, /tmp/revshell-upload-*, /tmp/wh.log
Strings__file_read__, __file_write__, FILE_GET, REVSHELL_TOKEN, ccds-agent/
Go packagesevil_pkg10, evil_pkg31, evil_pkg40, evil_pkg41, evilrepo/pkg70

The full report lists SHA-256 hashes for all payload and evidence files, along with a MITRE ATT&CK mapping.

If you build software in Go, check your module cache, internal registry and build logs for these package names. More broadly, flag any init() function or CGO constructor that spawns a shell or runs curl. Outbound connections from build runners to unknown hosts on 4444 or 9999 are also worth a second look.

ThreatMon's Take

CCDS isn’t a polished, widely used tool, and nothing we found shows it being used against real victims. It sits at the opposite end from ASTRO, the Rust framework we analyzed last month with more than 200 commands. It’s a good example of something we see more and more often: a single person or a small team building their own C2, testing supply-chain payloads on the same box, and leaving the whole thing exposed on the open internet. The infrastructure turned up through internet-wide scanning, passive DNS and the server’s own leaky logs. ThreatMon watches those same sources to spot new C2 servers early.

ThreatMon Cyber Threat Intelligence tracks exposed C2 infrastructure, new attacker-controlled domains and the IOCs our analysts pull from reports like this one, and feeds them directly into customers’ monitoring. Attack Surface Intelligence does the same for your own side: it finds the open ports and forgotten services that, as CCDS shows, scanners will find within hours. When a suspicious sample or package turns up, our malware analysis team can take it apart.

To find out whether any of these indicators have touched your environment, talk to our team or start with free access. More C2 and malware analyses are on the ThreatMon reports page.

Table of Contents
advanced divider

More posts

This image is about monthly vulnerabilities for September 2024.
This image is about the ServiceNow data leak.
This image is about monthly vulnerabilities for July 2024.
advanced divider

Share this article

Found it interesting? Don’t hesitate to share it to wow your friends or colleagues

advanced divider

Subscribe to our blog newsletter to follow the latest posts