building-c2-redirector-infrastructure
它能做什么
这个工具可以帮你搭建一台中间服务器(重定向器),用来隐藏主要的命令与控制(C2)服务器。它会过滤流量,只让来自你的程序(植入体)的合法通信到达主服务器,而可疑流量则被引向一个正常的网站。
适用场景
- ✓当你需要让主服务器免受攻击、不被发现时。
- ✓当你希望只有预期的流量能到达 C2 服务器时。
- ✓当你想把好奇的访问者和安全检查引向一个无害的诱饵网站时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-c2-redirector-infrastructure/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“搭建一个重定向器来隐藏我的 C2 服务器,并把无效流量转到 example.com。”
每周 5 个新技能,1 分钟读完。
工作原理
它使用 Nginx 或 Apache 等软件检查传入的连接。如果某个连接符合预定义的特征(与某个配置文件匹配),就会被转发到 C2 服务器;否则,它会被重定向到诱饵网站。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Building C2 Redirector Infrastructure
Authorized Use Only: This skill is for authorized red-team engagements, adversary-emulation exercises, and defensive research only. Command-and-control infrastructure is dual-use; deploying redirectors to control malware on systems you are not explicitly authorized to test is illegal. Operate only inside an agreed scope with a signed rules-of-engagement document, and decommission infrastructure when the engagement ends.
Overview
A C2 redirector is an intermediary host that sits between victim implants and the real team server. Beacons connect to the redirector's public domain/IP; the redirector inspects each request and either proxies legitimate C2 traffic back to the hidden team server or diverts everything else (scanners, blue-team analysts, sandboxes) to a benign decoy site. This protects the team server from discovery, takedown, and attribution, and lets operators rotate the public edge without rebuilding the backend. The technique maps to MITRE ATT&CK T1090.002 (Proxy: External Proxy) — adversaries route C2 through an intermediary node to obscure the true origin.
Redirectors come in two flavors. Dumb pipes (socat, iptables NAT) blindly forward a port and provide separation but no filtering. Smart/filtering redirectors (nginx proxy_pass, Apache mod_rewrite with [P], or purpose-built tools like RedWarden) parse HTTP requests and only forward traffic that matches the implant's Malleable C2 profile — correct URI, User-Agent, headers — while sending everything else a 302 to a real website. The filtering logic is derived directly from the C2 framework's traffic profile, so the two must stay in lock-step. Tools such as cs2modrewrite automate generating Apache/nginx rules from a Cobalt Strike Malleable C2 profile.
This skill covers building both dumb and filtering redirectors with nginx and Apache, deriving filter rules from a malleable profile, layering TLS with Let's Encrypt, and applying OPSEC controls (categorized domains, domain fronting/CDN fronting, header validation, geo/UA filtering) for resilient, low-attribution infrastructure.
When to Use
- Standing up red-team C2 that must survive blue-team triage and domain takedown requests.
- Separating a hidden team server from any internet-facing host during an engagement.
- Filtering implant traffic so only profile-matching requests reach the backend, diverting scanners.
- Adding TLS termination, domain categorization, and CDN/domain fronting to an HTTP(S) listener.
- Teaching defenders how external-proxy C2 (T1090.002) is constructed so they can detect it.
Prerequisites
- One or more disposable cloud VPS instances (the redirector edge) and a separate, firewalled team-server host.
- A registered domain with controllable DNS, ideally aged/categorized.
- Root on the redirector host. Install the web server and TLS tooling:
# Debian/Ubuntu redirector sudo apt update sudo apt install -y nginx apache2 socat certbot python3-certbot-nginx git # Enable Apache proxy modules if using mod_rewrite redirector sudo a2enmod rewrite proxy proxy_http ssl headers - The C2 framework's Malleable C2 profile (Cobalt Strike
.profile, Sliver/Havoc HTTP profile) defining URIs, User-Agent, and headers. cs2modrewriteto auto-generate rules from a Cobalt Strike profile:git clone https://github.com/threatexpress/cs2modrewrite- Firewall the team server so it only accepts the redirector's source IP on the C2 port.
Objectives
- Deploy a dumb-pipe redirector (socat/iptables) for fast port separation.
- Deploy a filtering nginx reverse-proxy redirector keyed to a malleable profile.
- Deploy an Apache
mod_rewriteredirector with[P]proxying and302decoy fallback. - Auto-generate redirector rules from a Cobalt Strike profile with
cs2modrewrite. - Terminate TLS with Let's Encrypt and harden the public edge.
- Apply OPSEC: header/UA validation, geo filtering, decoy diversion, and infra rotation.
MITRE ATT&CK Mapping
| Technique ID | Official Name | Relevance |
|---|---|---|
| T1090.002 | Proxy: External Proxy | The redirector is an external intermediary that proxies C2 to hide the team server |
| T1090.004 | Proxy: Domain Fronting | CDN fronting routes beacon traffic through a trusted high-reputation domain |
…
常见问题
什么是“C2 重定向器”?
它是位于你的恶意程序(植入体)和主控制服务器之间的服务器,用来隐藏主服务器并过滤流量。
什么是“Malleable C2 配置文件”?
它是一组规则,定义了你的程序流量应该呈现的样子(例如使用哪些地址、请求头等)。重定向器依靠这些规则来识别正确的流量。
这里的“OPSEC”是什么意思?
OPSEC(操作安全)指为避免被发现和溯源而采取的措施,例如隐藏真实服务器,让流量看起来正常。
详情
作者的原始描述
Build dumb-pipe and traffic-filtering C2 redirectors with nginx (proxy_pass) and Apache (mod_rewrite), deriving filter rules from a Malleable C2 profile, layering Let's Encrypt TLS, and applying OPSEC controls like domain fronting and UA/geo filtering. Use when standing up red-team C2 that must survive blue-team triage or ensuring only profile-matching implant traffic reaches the hidden team serve
热度
- GitHub 星标
- 35k
- 排名
- #7693
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。