Planting C4: Cross-Compatible External C2 for All Your Implants

Scott Taylor

DEF CON 33 · Day 3 · Main Stage

Overview

Scott Taylor's DEF CON 33 talk introduces C4—Cross-Compatible External C2—a framework for building command-and-control infrastructure that operates as an intermediary between diverse red team implants

Slides

Visual summary for Planting C4: Cross-Compatible External C2 for All Your Implants by Scott Taylor
Visual summary for Planting C4: Cross-Compatible External C2 for All Your Implants by Scott Taylor

Key moments

  1. 1:00 Introduction: limitations of single-C2-framework implants
  2. 3:36 C4 architecture overview: universal broker between implants and C2 frameworks
  3. 6:24 Wire protocol design: encoding and transport abstraction layer
  4. 9:00 Integration demo: connecting C4 to Cobalt Strike and Sliver simultaneously
  5. 11:36 Live demo: issuing tasking from multiple C2 frameworks to one implant
  6. 14:24 Evasion benefits: traffic appears as single trusted service
  7. 17:00 Release announcement and GitHub repository walkthrough
  8. 18:36 Defensive detection challenges and mitigations

Planting C4: Cross-Compatible External C2 for All Your Implants

Speakers: Scott Taylor

Conference: DEF CON 33

YouTube: Not yet available

Slides: https://media.defcon.org/DEF%20CON%2033/DEF%20CON%2033%20presentations/Scott%20Taylor%20-%20Planting%20C4%20Cross-Compatible%20External%20C2%20for%20All%20Your%20Implants.pdf

Overview

Scott Taylor's DEF CON 33 talk introduces C4—Cross-Compatible External C2—a framework for building command-and-control infrastructure that operates as an intermediary between diverse red team implants and C2 servers. Rather than tying implant development to a single C2 platform, C4 provides a standardized external C2 channel that any implant can use, regardless of the C2 framework it was designed for. The project addresses a longstanding friction point in offensive security operations: the fragmentation of implant ecosystems across Cobalt Strike, Brute Ratel, Havoc, Sliver, and others, each with incompatible C2 protocols and custom beacon formats.

C4's design philosophy is analogous to an adapter layer—a well-defined protocol on the implant side, a plugin or listener interface on the C2 server side, and arbitrary transport flexibility in between. The name is a deliberate play on "C2" (Command and Control), "external C2" (a concept Cobalt Strike introduced), and the explosive—suggesting both destructive capability and a compact, moldable material that conforms to whatever space it's placed in.

Background

The External C2 Concept

Cobalt Strike introduced the "External C2" specification as a way to route Beacon's communications through custom transport channels—not just HTTP/S or DNS, but arbitrary protocols like Slack, Teams, WebSockets, or even physical-layer channels like radio. The core idea is a local TCP socket that Cobalt Strike's team server exposes; an external process reads raw beacon frames from this socket, wraps them in whatever transport it wants, and delivers them to a corresponding relay on the victim side.

The problem with Cobalt Strike's External C2 spec is that it is Cobalt Strike-specific. Brute Ratel has its own external channel concept, Havoc has its own, and Sliver's concept differs again. A red teamer who wants to use a custom transport with multiple frameworks must implement the external channel separately for each—duplicating work and creating inconsistency in tooling.

The Multi-C2 Operator Reality

Modern red teams commonly operate with multiple C2 frameworks depending on the engagement context: Cobalt Strike for mature enterprise engagements, Sliver or Havoc for open-source-preferred clients, custom implants for highly constrained environments. Switching between frameworks means switching toolsets, operator training, and infrastructure management. An operator who has developed a reliable exfiltration channel over, say, Microsoft Teams webhooks, must reimplement that channel for each framework.

C4 solves this by decoupling the transport layer from the C2 framework.

Key Findings

C4 provides a universal external C2 adapter. C4 defines a simple wire protocol for implant-to-relay communication. Any implant—regardless of the underlying C2 framework—can be modified to speak C4's protocol. On the server side, C4 listeners translate between the C4 protocol and the native external C2 format expected by each supported C2 server.

Transport plugins enable arbitrary covert channels. C4 separates the relay (which speaks to the implant) from the transport (which carries data between the relay and the C2 server). Transports are implemented as plugins, allowing operators to write a transport once and use it with any C4-compatible implant and any supported C2 framework.

Modular implant support through a common stub. C4 provides a stub library that handles the C4 protocol, which can be linked against an existing implant or used as a thin wrapper. The stub is small enough to be practical in resource-constrained implants and is written in portable C.

Operational flexibility at scale. In a red team operation with multiple concurrent implants using different C2 frameworks, C4 allows a single operator to manage all implants through a unified transport layer—switching the transport channel for all implants simultaneously if evasion requirements change, without recompiling or re-deploying implants.

Technical Deep Dive

C4 Architecture

C4 consists of three components:

  1. C4 Stub (implant-side): A small C library that the implant links against. The stub handles the C4 wire protocol: framing task data, sending it over the chosen transport, receiving responses, and passing them back to the implant's main loop. The stub is transport-agnostic—it hands off serialized frames to a transport function pointer that the operator provides at compile time.
  1. C4 Relay: A server-side process (or daemon) that receives frames from C4 stubs over the configured transport, unpacks them, and forwards the raw C2 data to the appropriate C2 server listener using that server's native external C2 protocol. It also receives tasks from the C2 server and routes them back to the correct implant.
  1. C4 Transport Plugins: Modular implementations of specific covert channels—HTTP/S, WebSockets, DNS, Slack API, Teams webhooks, OneDrive file polling, etc. Each plugin implements a simple send/receive interface. Operators can write custom plugins for novel transport requirements.

The relay maintains a session table: a mapping between C4 session identifiers (set by each implant on first connection) and the corresponding C2 server session for that implant.

Wire Protocol

The C4 wire protocol is intentionally minimal:

  • Fixed-size header: session ID (UUID), sequence number, total frame length, flags.
  • Variable-length payload: the raw C2 frame, encrypted using an AES key negotiated on first contact.
  • The protocol does not perform key exchange itself—it assumes the transport provides confidentiality (e.g., TLS), or operators supply a pre-shared key.

The simplicity is deliberate: the protocol must be implementable in a few hundred bytes of stub code for resource-constrained implants.

C2 Framework Integration

C4 currently supports integration with:

  • Cobalt Strike via the External C2 specification (local TCP on team server).
  • Havoc via its ExternalC2 listener.
  • Sliver via its DNS/HTTP staging mechanism (adapted for external relay use).

Support for additional frameworks is added by writing a relay-side plugin that translates between C4 frames and the target framework's external C2 wire format.

Evasion Implications

C4's transport plugin model means that defenders who detect a specific C2 framework's network signature may be unable to correlate that with the transport channel in use—the implant's network traffic looks like whatever the transport plugin generates (a Teams webhook call, a DNS query, an OneDrive sync), not like the underlying C2 framework. This decoupling challenges detection strategies that rely on matching C2 framework signatures to network traffic patterns.

Demo / Proof of Concept

The talk demonstrates:

  • A C4-compatible Cobalt Strike Beacon communicating over a Microsoft Teams webhook transport.
  • The same transport configuration used with a Havoc implant, showing the C4 relay transparently proxying to both C2 servers simultaneously.
  • A custom transport plugin (Discord webhooks) written and deployed during the talk, demonstrating the ease of adding new transports.
  • Operator-side switching of the active transport channel for a live implant session, without losing the session state.

Code and framework plugins were released publicly on the speaker's GitHub at the time of the talk.

Defensive Implications

For blue teams and SOC analysts:

  • C4-style frameworks decouple C2 framework signatures from transport signatures. Detection strategies that rely on identifying Cobalt Strike, Havoc, or Sliver by their network traffic patterns are less effective against C4-wrapped implants.
  • Focus detection on transport-level behavioral anomalies: unusual volumes of Teams webhook calls from a single endpoint, DNS query patterns inconsistent with normal user behavior, unexpected OneDrive sync activity.
  • Endpoint detection (EDR) that observes implant behavior—process injection, memory patterns, beacon callbacks from the host perspective—is harder to evade than network-based C2 detection.

For red teams:

  • C4 reduces the operational burden of maintaining multiple transport implementations across frameworks. A single well-tested covert channel can serve all frameworks in the operator's toolkit.
  • The project opens the door to transport reuse across engagements and teams.

For detection engineering:

  • Publish detection rules for the C4 wire protocol header patterns (the UUID + sequence number framing) that may appear in otherwise innocuous-looking traffic.
  • Monitor for the specific API patterns used by popular C4 transport plugins (Teams, OneDrive, Slack) when access comes from unusual endpoints.

Key Takeaways

  1. C4 solves the fragmentation problem in offensive C2 tooling by providing a universal adapter between diverse implant types and diverse C2 frameworks.
  2. Transport plugins decouple covert channel implementation from implant development, enabling reuse and rapid deployment of novel channels.
  3. The framework has direct evasion implications: detection strategies based on matching C2-specific network signatures are bypassed when the transport layer is decoupled.
  4. Blue teams should shift detection emphasis toward transport-layer behavioral analysis and host-based EDR when faced with advanced external C2 frameworks.
  5. The modular, open architecture of C4 makes it a foundation for future community contributions—additional C2 framework integrations and transport plugins will expand its coverage over time.

About the Speaker(s)

Scott Taylor is an offensive security practitioner with a focus on red team tooling and C2 infrastructure development. His work on C4 reflects years of experience operating across multiple C2 frameworks in complex red team engagements, and the frustration of maintaining redundant transport implementations for each. The C4 project was released as open-source tooling at DEF CON 33, continuing the conference's tradition of advancing the public state of offensive security knowledge to drive improvements in defensive capabilities.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

Scott Taylor's C4 framework solves the multi-C2-framework transport fragmentation problem with a universal external C2 adapter — a small C stub on the implant side, a relay with per-framework plugins, and transport plugins that decouple covert channel implementation from C2 framework selection.

Heather Calloway (CISO) — WEAK

C4 is a well-engineered red team tooling project that solves a real fragmentation problem in offensive C2 infrastructure. The detection evasion implications are legitimate but the talk provides no governance story, minimal defender guidance beyond 'shift to behavioral detection,' and is primarily useful for red teams and detection engineers. Not her room.

→ Top-rated talks at DEF CON 33

All talks from DEF CON 33