> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/c2-framworks/03-c2-concepts-and-types.md).

# 03 — C2 Concepts & Types

### 3.1 Common C2 Channels (Protocols)

| Channel                   | Notes                                                                                     |
| ------------------------- | ----------------------------------------------------------------------------------------- |
| **HTTP/HTTPS**            | Blends with normal web traffic; most common and flexible                                  |
| **DNS**                   | Very covert, works even when only DNS egress is allowed; low bandwidth                    |
| **mTLS (mutual TLS)**     | Both client and server authenticate with certs — strong, hard to MITM                     |
| **SMB / Named Pipes**     | Used for internal pivoting between hosts on the same network, no new external connections |
| **WireGuard (VPN-based)** | Encrypted tunnel; fast, resilient transport                                               |

### 3.2 Diagram — Choosing a Channel

```mermaid
flowchart TD
    A[Choose C2 Channel] --> B{Environment egress rules?}
    B -->|Only DNS allowed| C[DNS C2 - low bandwidth, very covert]
    B -->|Web proxy allowed| D[HTTP/HTTPS C2 - blends with browsing]
    B -->|Internal segment only| E[SMB / Named Pipe P2P]
    B -->|Need strong mutual auth| F[mTLS]
```

### 3.3 Sessions vs. Beacons

|                   | Session (Interactive)          | Beacon (Asynchronous)                     |
| ----------------- | ------------------------------ | ----------------------------------------- |
| Connection style  | Near real-time                 | Checks in on an interval                  |
| Detectability     | Higher (constant traffic)      | Lower (looks like periodic legit traffic) |
| Best for          | Hands-on tasks, fast iteration | Long-term stealthy persistence            |
| Command execution | Immediate                      | Queued, runs at next check-in             |

### 3.4 Jitter & Sleep Intervals

* **Sleep**: base time between beacon check-ins (e.g., 60 seconds).
* **Jitter**: random percentage variance added/subtracted from sleep (e.g., ±30%) so check-ins don't land on a perfectly regular timer — a regular timer is an easy statistical detection pattern for a SOC.

### 3.5 Staged vs. Stageless Payloads

* **Staged**: a small first-stage payload connects out and downloads the full implant. Smaller initial footprint, but the staging fetch is itself a detectable network event.
* **Stageless**: the full implant ships in one shot. Larger file on disk, but no secondary download for defenders to catch.

### 3.6 Malleable Profiles / Traffic Shaping

Some frameworks (Cobalt Strike heavily, Sliver's HTTP(S) C2 to a degree) let operators define what the traffic *looks like* — headers, URIs, JSON/XML body shape — so it resembles legitimate application traffic (a CDN, an analytics beacon, a software update check). This reduces the chance of network-signature-based detection.

### 3.7 What's Next

`04-c2-enterprise-infrastructure-opsec.md` scales this up to how professional red teams structure infrastructure for a real engagement — redirectors, domain reputation, and OPSEC discipline.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/c2-framworks/03-c2-concepts-and-types.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
