# s3n4t0r-0x0/bear-c2 architecture

> Architecture diagram of the GitHub repository s3n4t0r-0x0/bear-c2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/s3n4t0r-0x0/bear-c2
- Repository: https://github.com/s3n4t0r-0x0/bear-c2

## Overview

BEAR-C2 is an adversary-simulation framework whose documented operator workflow configures a listener, generates a matching beacon, and monitors the listener; agents also have messaging-platform alternatives. The repository tree is weighted toward standalone payload variants and adversary primitives, while the controller’s implementation and several README-described interfaces are not sampled. The graph therefore distinguishes documented workflow from implementation evidence and groups protocol variants by transport rather than implying they are wired together. Exfiltration, proxying, DGA, fingerprinting, phishing, and other README capabilities are represented at directory-level scope where their implementation files are not identifiable from the tree.

Main entry points: [`BEAR-C2.py`](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py) (Payload generator), [`Payloads`](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads) (Exfiltration profiles), [`Payloads/C2 Channel Agents/Discord Agent.cpp`](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Payloads/C2%20Channel%20Agents/Discord%20Agent.cpp) (Discord agent), [`Payloads/C2 Channel Agents/Telegram Agent.cpp`](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Payloads/C2%20Channel%20Agents/Telegram%20Agent.cpp) (Telegram agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["C2 Control"]
  node_controller["BEAR-C2 controller<br/>[BEAR-C2.py]"]
  node_listener_config["Listener configuration<br/>[BEAR-C2.py]"]
  node_listener_status["Listener management<br/>[BEAR-C2.py]"]
  node_payload_gen["Payload generator<br/>[BEAR-C2.py]"]
  node_exfil_profiles["Exfiltration profiles"]
  node_simulation_features["Simulation options<br/>[BEAR-C2.py]"]
end

subgraph group_transports["Beacon Transports"]
  node_doh["DoH payloads"]
  node_http["HTTP payloads"]
  node_https["HTTPS payloads"]
  node_quic["QUIC payloads"]
  node_reverse_tcp["Reverse TCP payloads"]
end

subgraph group_channels["Messaging Agents"]
  node_discord["Discord agent<br/>[Discord Agent.cpp]"]
  node_telegram["Telegram agent<br/>[Telegram Agent.cpp]"]
end

subgraph group_primitives["Adversary Primitives"]
  node_stagers["Stagers and loaders"]
  node_pixelcode["PixelCode payload<br/>[payload.cpp]"]
  node_pixel_stager["PixelCode conversion tools"]
  node_dropper["RustyWater dropper<br/>[main.rs]"]
end

node_operator(("Operator"))
node_external_service["Messaging platforms"]
node_cloud_storage["Cloud storage providers"]

node_operator -->|"operates"| node_controller
node_controller -->|"configures"| node_listener_config
node_operator -->|"manages"| node_listener_status
node_listener_config -->|"prefills"| node_payload_gen
node_payload_gen -.->|"generates for"| node_doh
node_payload_gen -.->|"generates for"| node_http
node_payload_gen -.->|"generates for"| node_https
node_payload_gen -.->|"generates for"| node_quic
node_payload_gen -.->|"generates for"| node_reverse_tcp
node_controller -.->|"configures"| node_exfil_profiles
node_controller -.->|"offers"| node_simulation_features
node_discord -->|"communicates via"| node_external_service
node_telegram -->|"communicates via"| node_external_service
node_exfil_profiles -->|"routes data to"| node_cloud_storage
node_pixel_stager -.->|"converts payload"| node_pixelcode

click node_controller "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py"
click node_listener_config "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py"
click node_listener_status "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py"
click node_payload_gen "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py"
click node_exfil_profiles "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads"
click node_simulation_features "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py"
click node_doh "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/DOH"
click node_http "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/HTTP"
click node_https "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/HTTPS"
click node_quic "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/QUIC"
click node_reverse_tcp "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/Reverse%20TCP"
click node_discord "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Payloads/C2%20Channel%20Agents/Discord%20Agent.cpp"
click node_telegram "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Payloads/C2%20Channel%20Agents/Telegram%20Agent.cpp"
click node_stagers "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Adversary%20Primitives/Stagers-Loaders"
click node_pixelcode "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Adversary%20Primitives/PixelCode%20Attack/payload.cpp"
click node_pixel_stager "https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Adversary%20Primitives/PixelCode%20Attack"
click node_dropper "https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Adversary%20Primitives/RustyWater%20ShellCode%20Dropper/reddit/src/main.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_listener_config,node_listener_status,node_payload_gen,node_exfil_profiles,node_simulation_features toneBlue
class node_doh,node_http,node_https,node_quic,node_reverse_tcp,node_cloud_storage toneAmber
class node_discord,node_telegram toneMint
class node_stagers,node_pixelcode,node_pixel_stager,node_dropper toneRose
class node_operator,node_external_service toneIndigo
```

## Components

### C2 Control

- [BEAR-C2 controller](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py): `BEAR-C2.py`
- [Listener configuration](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py): `BEAR-C2.py`
- [Listener management](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py): `BEAR-C2.py`
- [Payload generator](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py): `BEAR-C2.py`
- [Exfiltration profiles](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads): `Payloads`
- [Simulation options](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/BEAR-C2.py): `BEAR-C2.py`

### Beacon Transports

- [DoH payloads](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/DOH): `Payloads/DOH`
- [HTTP payloads](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/HTTP): `Payloads/HTTP`
- [HTTPS payloads](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/HTTPS): `Payloads/HTTPS`
- [QUIC payloads](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/QUIC): `Payloads/QUIC`
- [Reverse TCP payloads](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Payloads/Reverse%20TCP): `Payloads/Reverse TCP`

### Messaging Agents

- [Discord agent](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Payloads/C2%20Channel%20Agents/Discord%20Agent.cpp): `Payloads/C2 Channel Agents/Discord Agent.cpp`
- [Telegram agent](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Payloads/C2%20Channel%20Agents/Telegram%20Agent.cpp): `Payloads/C2 Channel Agents/Telegram Agent.cpp`

### Adversary Primitives

- [Stagers and loaders](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Adversary%20Primitives/Stagers-Loaders): `Adversary Primitives/Stagers-Loaders`
- [PixelCode payload](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Adversary%20Primitives/PixelCode%20Attack/payload.cpp): `Adversary Primitives/PixelCode Attack/payload.cpp`
- [PixelCode conversion tools](https://github.com/s3n4t0r-0x0/bear-c2/tree/main/Adversary%20Primitives/PixelCode%20Attack): `Adversary Primitives/PixelCode Attack`
- [RustyWater dropper](https://github.com/s3n4t0r-0x0/bear-c2/blob/main/Adversary%20Primitives/RustyWater%20ShellCode%20Dropper/reddit/src/main.rs): `Adversary Primitives/RustyWater ShellCode Dropper/reddit/src/main.rs`

### Other components

- **Operator**
- **Messaging platforms**
- **Cloud storage providers**

## Connections

- Operator → BEAR-C2 controller: operates
- BEAR-C2 controller → Listener configuration: configures
- Operator → Listener management: manages
- Listener configuration → Payload generator: prefills
- Payload generator → DoH payloads: generates for
- Payload generator → HTTP payloads: generates for
- Payload generator → HTTPS payloads: generates for
- Payload generator → QUIC payloads: generates for
- Payload generator → Reverse TCP payloads: generates for
- BEAR-C2 controller → Exfiltration profiles: configures
- BEAR-C2 controller → Simulation options: offers
- Discord agent → Messaging platforms: communicates via
- Telegram agent → Messaging platforms: communicates via
- Exfiltration profiles → Cloud storage providers: routes data to
- PixelCode conversion tools → PixelCode payload: converts payload
