# bishopfox/sliver architecture

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

- Interactive diagram: https://gitdiagram.com/bishopfox/sliver
- Repository: https://github.com/bishopfox/sliver

## Overview

Sliver is a cross-platform adversary-emulation framework for authorized security testing. An operator uses the client console to generate payloads, establish C2, and issue tasks to sessions or beacons; implants execute those tasks and return results through the server. The graph also preserves documented transport and payload capabilities and shows the RPC, implant-handler, and generation layers. Several subsystems are represented by their exact tree directories because their implementation files were not sampled; those links are marked unverified where appropriate.

Main entry points: [`server/rpc/rpc-service.go`](https://github.com/bishopfox/sliver/blob/master/server/rpc/rpc-service.go) (RPC service), [`client/command/server.go`](https://github.com/bishopfox/sliver/blob/master/client/command/server.go) (Command registry), [`implant/sliver/transports`](https://github.com/bishopfox/sliver/tree/master/implant/sliver/transports) (C2 transports), [`implant/sliver/handlers/handlers.go`](https://github.com/bishopfox/sliver/blob/master/implant/sliver/handlers/handlers.go) (Task handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Operator client"]
  node_client_cli["Client CLI<br/>[cli.go]"]
  node_client_console["Interactive console<br/>[console.go]"]
  node_command_registry["Command registry<br/>[server.go]"]
  node_payload_commands["Payload commands"]
  node_session_commands["Session and task commands"]
  node_opfor_manager["Opfor script manager<br/>[manager.go]"]
  node_mcp_server["MCP tool server<br/>[server.go]"]
end

subgraph group_server["Server and control plane"]
  node_server_config["Server configuration<br/>[server.go]"]
  node_server_rpc["RPC service<br/>[rpc-service.go]"]
  node_rpc_tasks["Task RPC handlers<br/>[rpc-tasks.go]"]
  node_server_sessions["Session handlers<br/>[sessions.go]"]
  node_c2_ingress["C2 listeners"]
  node_binary_generation["Binary generation<br/>[binaries.go]"]
  node_session_store[("Session state<br/>[clients.go]")]
end

subgraph group_implant["Implant runtime"]
  node_implant_entry["Implant entry point<br/>[main.go]"]
  node_implant_transports["C2 transports"]
  node_implant_handlers["Task handlers<br/>[handlers.go]"]
  node_implant_socks["SOCKS tunnel handler<br/>[socks_handler.go]"]
end

subgraph group_capabilities["Payload capabilities"]
  node_post_exploitation["Post-exploitation"]
  node_payload_modes["Payload modes"]
end

subgraph group_protocol["RPC protocol"]
  node_protobuf_contracts["Protobuf contracts<br/>[sliver.proto]"]
  node_client_contracts["Client RPC contracts<br/>[client.proto]"]
end

node_operator_actor(("Operator"))
node_external_c2(("C2 network"))

node_operator_actor -->|"starts"| node_client_cli
node_client_cli -.->|"opens"| node_client_console
node_client_console -->|"loads commands"| node_command_registry
node_command_registry -->|"registers"| node_payload_commands
node_command_registry -->|"registers"| node_session_commands
node_command_registry -->|"registers"| node_opfor_manager
node_command_registry -->|"registers"| node_mcp_server
node_payload_commands -.->|"requests generation"| node_server_rpc
node_session_commands -.->|"sends tasks"| node_server_rpc
node_mcp_server -->|"calls RPC"| node_server_rpc
node_server_rpc -.->|"dispatches tasks"| node_rpc_tasks
node_rpc_tasks -->|"reads sessions"| node_session_store
node_rpc_tasks -.->|"routes task work"| node_server_sessions
node_server_rpc -.->|"coordinates C2"| node_c2_ingress
node_server_config -.->|"configures listeners"| node_c2_ingress
node_payload_commands -.->|"requests builds"| node_binary_generation
node_binary_generation -->|"generates implant"| node_implant_entry
node_implant_entry -->|"starts runtime"| node_implant_transports
node_implant_transports -.->|"connects over C2"| node_c2_ingress
node_c2_ingress -.->|"serves traffic"| node_external_c2
node_implant_transports -->|"dispatches messages"| node_implant_handlers
node_implant_handlers -.->|"decodes tasks"| node_protobuf_contracts
node_implant_handlers -->|"executes capabilities"| node_post_exploitation
node_implant_handlers -->|"uses tunnel handler"| node_implant_socks
node_implant_transports -.->|"transfers messages"| node_protobuf_contracts
node_server_rpc -.->|"exposes RPC types"| node_client_contracts
node_binary_generation -->|"supports payload forms"| node_payload_modes

click node_client_cli "https://github.com/bishopfox/sliver/blob/master/client/cli/cli.go"
click node_client_console "https://github.com/bishopfox/sliver/blob/master/client/console/console.go"
click node_command_registry "https://github.com/bishopfox/sliver/blob/master/client/command/server.go"
click node_payload_commands "https://github.com/bishopfox/sliver/tree/master/client/command/generate"
click node_session_commands "https://github.com/bishopfox/sliver/tree/master/client/command/tasks"
click node_opfor_manager "https://github.com/bishopfox/sliver/blob/master/client/command/opfor/manager.go"
click node_mcp_server "https://github.com/bishopfox/sliver/blob/master/client/mcp/server.go"
click node_server_config "https://github.com/bishopfox/sliver/blob/master/server/configs/server.go"
click node_server_rpc "https://github.com/bishopfox/sliver/blob/master/server/rpc/rpc-service.go"
click node_rpc_tasks "https://github.com/bishopfox/sliver/blob/master/server/rpc/rpc-tasks.go"
click node_server_sessions "https://github.com/bishopfox/sliver/blob/master/server/handlers/sessions.go"
click node_c2_ingress "https://github.com/bishopfox/sliver/tree/master/server/c2"
click node_binary_generation "https://github.com/bishopfox/sliver/blob/master/server/generate/binaries.go"
click node_session_store "https://github.com/bishopfox/sliver/blob/master/server/core/clients.go"
click node_implant_entry "https://github.com/bishopfox/sliver/blob/master/implant/sliver/main.go"
click node_implant_transports "https://github.com/bishopfox/sliver/tree/master/implant/sliver/transports"
click node_implant_handlers "https://github.com/bishopfox/sliver/blob/master/implant/sliver/handlers/handlers.go"
click node_implant_socks "https://github.com/bishopfox/sliver/blob/master/implant/sliver/handlers/tunnel_handlers/socks_handler.go"
click node_protobuf_contracts "https://github.com/bishopfox/sliver/blob/master/protobuf/sliverpb/sliver.proto"
click node_client_contracts "https://github.com/bishopfox/sliver/blob/master/protobuf/clientpb/client.proto"
click node_post_exploitation "https://github.com/bishopfox/sliver/tree/master/implant/sliver/handlers"
click node_payload_modes "https://github.com/bishopfox/sliver/tree/master/client/command/generate"

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_client_cli,node_client_console,node_command_registry,node_payload_commands,node_session_commands,node_opfor_manager,node_mcp_server toneBlue
class node_server_config,node_server_rpc,node_rpc_tasks,node_server_sessions,node_c2_ingress,node_binary_generation,node_session_store toneAmber
class node_implant_entry,node_implant_transports,node_implant_handlers,node_implant_socks toneMint
class node_post_exploitation,node_payload_modes toneRose
class node_protobuf_contracts,node_client_contracts,node_operator_actor,node_external_c2 toneIndigo
```

## Components

### Operator client

- [Client CLI](https://github.com/bishopfox/sliver/blob/master/client/cli/cli.go): `client/cli/cli.go`
- [Interactive console](https://github.com/bishopfox/sliver/blob/master/client/console/console.go): `client/console/console.go`
- [Command registry](https://github.com/bishopfox/sliver/blob/master/client/command/server.go): `client/command/server.go`
- [Payload commands](https://github.com/bishopfox/sliver/tree/master/client/command/generate): `client/command/generate`
- [Session and task commands](https://github.com/bishopfox/sliver/tree/master/client/command/tasks): `client/command/tasks`
- [Opfor script manager](https://github.com/bishopfox/sliver/blob/master/client/command/opfor/manager.go): `client/command/opfor/manager.go`
- [MCP tool server](https://github.com/bishopfox/sliver/blob/master/client/mcp/server.go): `client/mcp/server.go`

### Server and control plane

- [Server configuration](https://github.com/bishopfox/sliver/blob/master/server/configs/server.go): `server/configs/server.go`
- [RPC service](https://github.com/bishopfox/sliver/blob/master/server/rpc/rpc-service.go): `server/rpc/rpc-service.go`
- [Task RPC handlers](https://github.com/bishopfox/sliver/blob/master/server/rpc/rpc-tasks.go): `server/rpc/rpc-tasks.go`
- [Session handlers](https://github.com/bishopfox/sliver/blob/master/server/handlers/sessions.go): `server/handlers/sessions.go`
- [C2 listeners](https://github.com/bishopfox/sliver/tree/master/server/c2): `server/c2`
- [Binary generation](https://github.com/bishopfox/sliver/blob/master/server/generate/binaries.go): `server/generate/binaries.go`
- [Session state](https://github.com/bishopfox/sliver/blob/master/server/core/clients.go): `server/core/clients.go`

### Implant runtime

- [Implant entry point](https://github.com/bishopfox/sliver/blob/master/implant/sliver/main.go): `implant/sliver/main.go`
- [C2 transports](https://github.com/bishopfox/sliver/tree/master/implant/sliver/transports): `implant/sliver/transports`
- [Task handlers](https://github.com/bishopfox/sliver/blob/master/implant/sliver/handlers/handlers.go): `implant/sliver/handlers/handlers.go`
- [SOCKS tunnel handler](https://github.com/bishopfox/sliver/blob/master/implant/sliver/handlers/tunnel_handlers/socks_handler.go): `implant/sliver/handlers/tunnel_handlers/socks_handler.go`

### Payload capabilities

- [Post-exploitation](https://github.com/bishopfox/sliver/tree/master/implant/sliver/handlers): `implant/sliver/handlers`
- [Payload modes](https://github.com/bishopfox/sliver/tree/master/client/command/generate): `client/command/generate`

### RPC protocol

- [Protobuf contracts](https://github.com/bishopfox/sliver/blob/master/protobuf/sliverpb/sliver.proto): `protobuf/sliverpb/sliver.proto`
- [Client RPC contracts](https://github.com/bishopfox/sliver/blob/master/protobuf/clientpb/client.proto): `protobuf/clientpb/client.proto`

### Other components

- **Operator**
- **C2 network**

## Connections

- Operator → Client CLI: starts
- Client CLI → Interactive console: opens
- Interactive console → Command registry: loads commands (evidence: `client/command/server.go`)
- Command registry → Payload commands: registers (evidence: `client/command/server.go`)
- Command registry → Session and task commands: registers (evidence: `client/command/server.go`)
- Command registry → Opfor script manager: registers (evidence: `client/command/server.go`)
- Command registry → MCP tool server: registers (evidence: `client/command/server.go`)
- Payload commands → RPC service: requests generation
- Session and task commands → RPC service: sends tasks
- MCP tool server → RPC service: calls RPC (evidence: `client/mcp/server.go`)
- RPC service → Task RPC handlers: dispatches tasks
- Task RPC handlers → Session state: reads sessions (evidence: `server/rpc/rpc-tasks.go`)
- Task RPC handlers → Session handlers: routes task work
- RPC service → C2 listeners: coordinates C2
- Server configuration → C2 listeners: configures listeners
- Payload commands → Binary generation: requests builds
- Binary generation → Implant entry point: generates implant (evidence: `server/generate/binaries.go`)
- Implant entry point → C2 transports: starts runtime (evidence: `implant/sliver/main.go`)
- C2 transports → C2 listeners: connects over C2
- C2 listeners → C2 network: serves traffic
- C2 transports → Task handlers: dispatches messages (evidence: `implant/sliver/handlers/handlers.go`)
- Task handlers → Protobuf contracts: decodes tasks
- Task handlers → Post-exploitation: executes capabilities (evidence: `implant/sliver/handlers/handlers.go`)
- Task handlers → SOCKS tunnel handler: uses tunnel handler (evidence: `implant/sliver/handlers/handlers.go`)
- C2 transports → Protobuf contracts: transfers messages
- RPC service → Client RPC contracts: exposes RPC types
- Binary generation → Payload modes: supports payload forms (evidence: `README.md`)
