Phase 04.07 · Holding the Channel

Command & Control Frameworks

A successful exploit gives you a foothold for an instant. Keeping it — running commands, moving data, and surviving a reboot — needs a reliable channel back to the attacker. That channel is command and control, and the software that manages it is a C2 framework. Metasploit is where everyone starts; it is far from where the field ends.

00

What command and control is

The moment an exploit lands, the attacker has a problem: a shell in a terminal is fragile. Close the laptop, lose the connection, reboot the box, and the access is gone. Command and control (C2, or C&C) solves this. A small program — the implant or beacon — runs on the compromised host and reaches back out to a C2 server the attacker controls. The operator issues tasks through the server; the beacon picks them up, runs them, and returns the results.

The defining behavior is beaconing: rather than holding a constant connection (loud and obvious), the implant "phones home" on an interval — every few seconds, minutes, or hours — usually with randomized jitter so the pattern is harder to spot. Between check-ins it sleeps quietly. This is the rhythm that separates modern C2 from a raw reverse shell, and the rhythm that defenders learn to hunt for.

Authorized operations only. C2 is dual-use: the exact tooling red teams use to prove risk is what criminals use to run intrusions. Everything here is for legal, scoped engagements and for the defenders who must learn to detect it. Standing up C2 against systems you do not own is a crime.
Lesson
04.07
Phase
Exploitation
Key idea
Beacon & redirect
01

Metasploit is the on-ramp, not the destination

You already met Metasploit and Meterpreter. Meterpreter is a C2 channel — an in-memory implant with a rich command set, sessions, and pivoting. It is the perfect place to learn the concepts because it is free, well-documented, and forgiving.

It is also, in a real engagement against a defended network, the first thing to get caught. Stock Meterpreter and default Metasploit payloads are some of the most heavily signatured code in existence; every AV and EDR vendor has studied them for over a decade. Run a default payload against a modern endpoint and it is flagged, quarantined, and alerted on before you get a session. That single limitation is why a whole market of dedicated C2 frameworks exists — tools built from the ground up to survive on an endpoint that is actively watching.

02

The modern C2 landscape

Professional red teams and, increasingly, real intruders have moved toward frameworks designed for stealth and flexibility. You do not need to operate these to be a strong defender or tester — but you must recognize the names, because they dominate real intrusion reports.

FrameworkTypeWhat sets it apart
Cobalt StrikeCommercialThe long-time industry standard and still the most-observed C2 in real intrusions. Its "Beacon" implant and malleable C2 profiles set the template the others follow. Heavily pirated and abused by criminals.
SliverOpen-sourceBishopFox's cross-platform framework written in Go. mTLS, HTTP(S), DNS, and WireGuard channels; in-memory implants; multi-operator. The most common free Cobalt Strike alternative.
HavocOpen-sourceA modern, Cobalt-Strike-style framework with a polished UI, strong EDR-evasion features (reflective loading, sleep obfuscation), and a low barrier to entry.
Brute Ratel C4CommercialBuilt specifically to defeat EDR. Its "Badger" agent is among the hardest implants to detect, with evasion tuned into every stage. Criminal abuse drove tighter vetting of its sales.
MythicOpen-sourceA modular platform with a web UI, multi-user support, and a microservice design that supports many agent types (Go, .NET, Python, and more). Favored for research and tailored operations.
MetasploitOpen-sourceThe learning standard and still excellent for known exploits — but its default C2 is the loudest and most-signatured of the group.

The trend is clear: defenders got good at catching Cobalt Strike and Metasploit, so operators diversified toward modular, evasion-first tools — Sliver, Havoc, Brute Ratel, and Mythic — that offer encrypted multi-protocol channels, in-memory execution, and integration with cloud services. For a defender, the lesson is that "looking for Meterpreter" is nowhere near enough.

03

Redirectors: never expose the real server

A beacon that talks straight to the C2 server hands defenders a gift: block or seize that one IP and the whole operation collapses, and the server's address becomes an indicator that burns every host using it. So serious operators never let the beacon see the real server. They put redirectors in front — lightweight hops that forward only legitimate beacon traffic to the hidden C2 (the "team server") and silently drop everything else, including curious investigators and scanners.

This is where one particular technique has become a favorite, because it delivers redirection, reputation, and resilience all at once — using infrastructure almost every network already trusts.

04

The Cloudflare Tunnel technique

Cloudflare's Tunnel service (the cloudflared daemon) and its serverless Workers were built for a legitimate purpose: letting a developer expose a service running on a private machine to the internet without opening a single inbound firewall port. Attackers realized the same machinery makes near-ideal C2 infrastructure. The chain looks like this:

Victim beacon
  → Cloudflare Worker — serverless redirector; forwards only valid beacons (checked via custom CF-Access-* headers), drops the rest
  → Zero Trust application — gatekeeper that requires a service token so only the Worker can reach the tunnel
  → cloudflared tunnel — a daemon on the attacker's VM holding an outbound connection to Cloudflare; maps a public hostname to a local listener
  → internal C2 server (e.g. Sliver on 127.0.0.1:443)

Because cloudflared dials out to Cloudflare, the attacker's server needs no inbound ports open at all — nothing to find by scanning it. What the victim and any investigator see is ordinary HTTPS to Cloudflare's address space. The advantages stack up fast:

Seen in the wild. This is not theoretical. Threat actors have abused free Cloudflare Tunnels to stage and deliver malware and proxy C2 — the SERPENTINE#CLOUD campaign used trycloudflare.com tunnels to run stealthy Python-based loaders and remote-access trojans. For defenders, the hard part is precisely the point: the malicious traffic looks like trusted Cloudflare HTTPS.
05

Detecting and defending against C2

If the traffic looks legitimate and the server cannot be scanned, how do defenders fight back? Not by chasing IPs — by hunting behavior:

The throughline of this phase: gaining access is one skill; keeping it quietly is another, and the cat-and-mouse of C2 versus detection is where much of modern offense and defense actually plays out. With a stable channel established, the next phase asks what you do with it — escalate, persist, pivot, and loot.

Sources & further reading. Cloudflare-tunnel C2 mechanics: redteaming.org. Real-world abuse: Securonix — SERPENTINE#CLOUD. C2 framework trends: Red Canary Threat Detection Report.