[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D6X0YAKZ2QYN1GVQ794RH0":3,"skill-same:01M7D6X0YAKZ2QYN1GVQ794RH0":85},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":48,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M7D6X0YAKZ2QYN1GVQ794RH0","building-c2-redirector-infrastructure",null,"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\u002Fgeo 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 server.","SaiVatsal\u002FSkills-I-Use","SaiVatsal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F242597752?v=4","01M7D5YM1T4VXW9203M0GFAHZ1","SaiVatsalPolimera","01M7D5YM2D61ST39XVR2V7B7ZJ",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: building-c2-redirector-infrastructure\ndescription: 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\u002Fgeo 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 server.\ndomain: cybersecurity\nsubdomain: red-teaming\ntags:\n- red-team\n- c2-infrastructure\n- redirector\n- nginx\n- apache-mod-rewrite\n- malleable-c2\n- opsec\n- traffic-filtering\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- DE.CM-01\nmitre_attack:\n- T1090.002\n---\n# Building C2 Redirector Infrastructure\n\n> **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.\n\n## Overview\n\nA C2 redirector is an intermediary host that sits between victim implants and the real team server. Beacons connect to the redirector's public domain\u002FIP; 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.\n\nRedirectors come in two flavors. **Dumb pipes** (socat, iptables NAT) blindly forward a port and provide separation but no filtering. **Smart\u002Ffiltering 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\u002Fnginx rules from a Cobalt Strike Malleable C2 profile.\n\nThis 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\u002FCDN fronting, header validation, geo\u002FUA filtering) for resilient, low-attribution infrastructure.\n\n## When to Use\n\n- Standing up red-team C2 that must survive blue-team triage and domain takedown requests.\n- Separating a hidden team server from any internet-facing host during an engagement.\n- Filtering implant traffic so only profile-matching requests reach the backend, diverting scanners.\n- Adding TLS termination, domain categorization, and CDN\u002Fdomain fronting to an HTTP(S) listener.\n- Teaching defenders how external-proxy C2 (T1090.002) is constructed so they can detect it.\n\n## Prerequisites\n\n- One or more disposable cloud VPS instances (the redirector edge) and a separate, firewalled team-server host.\n- A registered domain with controllable DNS, ideally aged\u002Fcategorized.\n- Root on the redirector host. Install the web server and TLS tooling:\n  ```bash\n  # Debian\u002FUbuntu redirector\n  sudo apt update\n  sudo apt install -y nginx apache2 socat certbot python3-certbot-nginx git\n  # Enable Apache proxy modules if using mod_rewrite redirector\n  sudo a2enmod rewrite proxy proxy_http ssl headers\n  ```\n- The C2 framework's Malleable C2 profile (Cobalt Strike `.profile`, Sliver\u002FHavoc HTTP profile) defining URIs, User-Agent, and headers.\n- `cs2modrewrite` to auto-generate rules from a Cobalt Strike profile:\n  ```bash\n  git clone https:\u002F\u002Fgithub.com\u002Fthreatexpress\u002Fcs2modrewrite\n  ```\n- Firewall the team server so it only accepts the redirector's source IP on the C2 port.\n\n## Objectives\n\n- Deploy a dumb-pipe redirector (socat\u002Fiptables) for fast port separation.\n- Deploy a filtering nginx reverse-proxy redirector keyed to a malleable profile.\n- Deploy an Apache `mod_rewrite` redirector with `[P]` proxying and `302` decoy fallback.\n- Auto-generate redirector rules from a Cobalt Strike profile with `cs2modrewrite`.\n- Terminate TLS with Let's Encrypt and harden the public edge.\n- Apply OPSEC: header\u002FUA validation, geo filtering, decoy diversion, and infra rotation.\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Official Name | Relevance |\n|--------------|---------------|-----------|\n| T1090.002 | Proxy: External Proxy | The redirector is an external intermediary that proxies C2 to hide the team server |\n| T1090.004 | Proxy: Domain Fronting | CDN fronting routes beacon traffic through a trusted high-reputation domain |\n| T1071.001 | Application Layer Protocol: Web Protocols | C2 is tunneled over HTTP\u002FHTTPS shaped by the malleable profile |\n| T1573.002 | Encrypted Channel: Asymmetric Cryptography | TLS termination at the redirector encrypts the beacon channel |\n| T1583.006 | Acquire Infrastructure: Web Services | Disposable VPS\u002FCDN edges are acquired for resilient C2 |\n\n## Workflow\n\n### 1. Lab and firewall the team server\nPlace the team server on a private host. Restrict its C2 port to the redirector's IP only.\n```bash\n# On the team server: only the redirector (203.0.113.10) may reach 443\u002Ftcp\nsudo ufw default deny incoming\nsudo ufw allow from 203.0.113.10 to any port 443 proto tcp\nsudo ufw allow OpenSSH\nsudo ufw enable\n```\n\n### 2. Dumb-pipe redirector (socat \u002F iptables)\nFor quick separation with no filtering, forward the C2 port to the team server.\n```bash\n# socat foreground forward of 443 -> team server\nsocat TCP4-LISTEN:443,fork,reuseaddr TCP4:10.0.0.2:443\n\n# Or iptables DNAT (persistent)\nsysctl -w net.ipv4.ip_forward=1\niptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 10.0.0.2:443\niptables -t nat -A POSTROUTING -p tcp -d 10.0.0.2 --dport 443 -j MASQUERADE\n```\n\n### 3. Filtering nginx reverse-proxy redirector\nOnly proxy requests whose URI matches the malleable profile; send everything else a `302` to a decoy. Replace the location regex and User-Agent with values from your profile.\n```nginx\n# \u002Fetc\u002Fnginx\u002Fsites-available\u002Fredirector.conf\nserver {\n    listen 443 ssl;\n    server_name cdn.example.com;\n\n    ssl_certificate     \u002Fetc\u002Fletsencrypt\u002Flive\u002Fcdn.example.com\u002Ffullchain.pem;\n    ssl_certificate_key \u002Fetc\u002Fletsencrypt\u002Flive\u002Fcdn.example.com\u002Fprivkey.pem;\n\n    # Proxy ONLY profile-matching C2 URIs to the hidden team server\n    location ~ ^\u002F(api\u002Fv2\u002Fjobs|cm\u002F[a-z0-9]+|push) {\n        # Require the implant's exact User-Agent\n        if ($http_user_agent != \"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36\") {\n            return 302 https:\u002F\u002Fwww.legitimate-decoy.com\u002F;\n        }\n        proxy_pass https:\u002F\u002F10.0.0.2;\n        proxy_ssl_verify off;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $remote_addr;\n    }\n\n    # Everything else -> benign decoy\n    location \u002F {\n        return 302 https:\u002F\u002Fwww.legitimate-decoy.com\u002F;\n    }\n}\n```\n```bash\nsudo ln -s \u002Fetc\u002Fnginx\u002Fsites-available\u002Fredirector.conf \u002Fetc\u002Fnginx\u002Fsites-enabled\u002F\nsudo nginx -t && sudo systemctl reload nginx\n```\n\n### 4. Apache mod_rewrite redirector\nApache's `[P]` flag proxies matching requests to the team server; non-matches get a `302` redirect. This is the format `cs2modrewrite` produces.\n```apache\n# \u002Fetc\u002Fapache2\u002Fsites-available\u002Fredirector.conf  (inside \u003CVirtualHost *:443>)\nRewriteEngine On\nSSLProxyEngine On\n# Require the implant User-Agent\nRewriteCond %{HTTP_USER_AGENT} \"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36\" [NC]\n# Match valid C2 URIs (GET\u002FPOST\u002Fstager) from the malleable profile\nRewriteCond %{REQUEST_URI} ^\u002F(api\u002Fv2\u002Fjobs|cm\u002F[a-z0-9]+|push)\u002F?$\n# Proxy to the hidden team server, preserving the URI\nRewriteRule ^.*$ https:\u002F\u002F10.0.0.2%{REQUEST_URI} [P,L]\n# Everything else -> decoy site\nRewriteRule ^.*$ https:\u002F\u002Fwww.legitimate-decoy.com\u002F [R=302,L]\n```\n```bash\nsudo a2ensite redirector && sudo apache2ctl configtest && sudo systemctl reload apache2\n```\n\n### 5. Generate rules from a malleable profile\nLet `cs2modrewrite` build the Apache or nginx rules directly from your Cobalt Strike profile so the filter exactly matches beacon traffic.\n```bash\ncd cs2modrewrite\n# Apache mod_rewrite rules\npython3 cs2modrewrite.py -i havex.profile -c https:\u002F\u002F10.0.0.2 \\\n  -r https:\u002F\u002Fwww.legitimate-decoy.com -o \u002Fetc\u002Fapache2\u002Fredirect.rules\n# nginx config\npython3 cs2nginx.py -i havex.profile -c https:\u002F\u002F10.0.0.2 \\\n  -r https:\u002F\u002Fwww.legitimate-decoy.com -H cdn.example.com > \u002Fetc\u002Fnginx\u002Fsites-available\u002Fc2.conf\n```\n\n### 6. Terminate TLS with Let's Encrypt\nIssue a valid certificate so beacon HTTPS does not throw TLS warnings and the edge looks legitimate.\n```bash\nsudo certbot --nginx -d cdn.example.com --agree-tos -m ops@example.com --redirect\n# Verify auto-renewal\nsudo certbot renew --dry-run\n```\n\n### 7. Apply OPSEC controls\nLayer defenses against blue-team analysis: validate headers, geofence to the target country, divert sandboxes, and rotate edges. Consider CDN\u002Fdomain fronting (T1090.004) where supported.\n```bash\n# Example: drop non-target geographies at the firewall with ipset\u002FGeoIP,\n# require a custom auth header in the profile, and rotate the redirector\n# domain\u002FIP on a schedule. Check the redirector only forwards matched traffic:\ncurl -k https:\u002F\u002Fcdn.example.com\u002F                       # expect 302 to decoy\ncurl -k -A \"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36\" \\\n  https:\u002F\u002Fcdn.example.com\u002Fapi\u002Fv2\u002Fjobs                  # expect proxied response\n```\n\n## Tools and Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| nginx | Filtering reverse-proxy redirector | https:\u002F\u002Fnginx.org\u002F |\n| Apache mod_rewrite | `[P]` proxy + `302` decoy redirector | https:\u002F\u002Fhttpd.apache.org\u002Fdocs\u002Fcurrent\u002Fmod\u002Fmod_rewrite.html |\n| cs2modrewrite | Generate Apache\u002Fnginx rules from CS profile | https:\u002F\u002Fgithub.com\u002Fthreatexpress\u002Fcs2modrewrite |\n| RedWarden | Malleable-aware filtering C2 reverse proxy | https:\u002F\u002Fgithub.com\u002Fmgeeky\u002FRedWarden |\n| redi | Automated nginx + Let's Encrypt CS redirector | https:\u002F\u002Fgithub.com\u002Ftaherio\u002Fredi |\n| socat | Dumb-pipe TCP forwarder | http:\u002F\u002Fwww.dest-unreach.org\u002Fsocat\u002F |\n| Let's Encrypt \u002F certbot | Free TLS certificates | https:\u002F\u002Fcertbot.eff.org\u002F |\n| ired.team | Red-team infrastructure reference | https:\u002F\u002Fwww.ired.team\u002Foffensive-security\u002Fred-team-infrastructure |\n\n## Validation Criteria\n\n- [ ] Team server firewalled to accept only the redirector source IP on the C2 port.\n- [ ] Redirector deployed (dumb pipe and\u002For filtering reverse proxy).\n- [ ] Filter rules derived from the actual malleable C2 profile (URI + User-Agent + headers).\n- [ ] Non-matching requests return a `302` to a benign decoy site (verified with curl).\n- [ ] Matching beacon requests are proxied to the hidden team server (verified with curl).\n- [ ] Valid TLS certificate issued and auto-renewal confirmed.\n- [ ] OPSEC controls applied (UA\u002Fheader validation, geofencing, decoy diversion).\n- [ ] Domain categorization \u002F CDN fronting considered where applicable.\n- [ ] Infrastructure rotation and decommissioning plan documented.\n- [ ] All activity confined to the authorized engagement scope.\n","# Building C2 Redirector Infrastructure\n\n> **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.\n\n## Overview\n\nA C2 redirector is an intermediary host that sits between victim implants and the real team server. Beacons connect to the redirector's public domain\u002FIP; 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.\n\nRedirectors come in two flavors. **Dumb pipes** (socat, iptables NAT) blindly forward a port and provide separation but no filtering. **Smart\u002Ffiltering 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\u002Fnginx rules from a Cobalt Strike Malleable C2 profile.\n\nThis 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\u002FCDN fronting, header validation, geo\u002FUA filtering) for resilient, low-attribution infrastructure.\n\n## When to Use\n\n- Standing up red-team C2 that must survive blue-team triage and domain takedown requests.\n- Separating a hidden team server from any internet-facing host during an engagement.\n- Filtering implant traffic so only profile-matching requests reach the backend, diverting scanners.\n- Adding TLS termination, domain categorization, and CDN\u002Fdomain fronting to an HTTP(S) listener.\n- Teaching defenders how external-proxy C2 (T1090.002) is constructed so they can detect it.\n\n## Prerequisites\n\n- One or more disposable cloud VPS instances (the redirector edge) and a separate, firewalled team-server host.\n- A registered domain with controllable DNS, ideally aged\u002Fcategorized.\n- Root on the redirector host. Install the web server and TLS tooling:\n  ```bash\n  # Debian\u002FUbuntu redirector\n  sudo apt update\n  sudo apt install -y nginx apache2 socat certbot python3-certbot-nginx git\n  # Enable Apache proxy modules if using mod_rewrite redirector\n  sudo a2enmod rewrite proxy proxy_http ssl headers\n  ```\n- The C2 framework's Malleable C2 profile (Cobalt Strike `.profile`, Sliver\u002FHavoc HTTP profile) defining URIs, User-Agent, and headers.\n- `cs2modrewrite` to auto-generate rules from a Cobalt Strike profile:\n  ```bash\n  git clone https:\u002F\u002Fgithub.com\u002Fthreatexpress\u002Fcs2modrewrite\n  ```\n- Firewall the team server so it only accepts the redirector's source IP on the C2 port.\n\n## Objectives\n\n- Deploy a dumb-pipe redirector (socat\u002Fiptables) for fast port separation.\n- Deploy a filtering nginx reverse-proxy redirector keyed to a malleable profile.\n- Deploy an Apache `mod_rewrite` redirector with `[P]` proxying and `302` decoy fallback.\n- Auto-generate redirector rules from a Cobalt Strike profile with `cs2modrewrite`.\n- Terminate TLS with Let's Encrypt and harden the public edge.\n- Apply OPSEC: header\u002FUA validation, geo filtering, decoy diversion, and infra rotation.\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Official Name | Relevance |\n|--------------|---------------|-----------|\n| T1090.002 | Proxy: External Proxy | The redirector is an external intermediary that proxies C2 to hide the team server |\n| T1090.004 | Proxy: Domain Fronting | CDN fronting routes beacon traffic through a trusted high-reputation domain |\n| T1071.001 | Application Layer Protocol: Web Protocols | C2 is tunneled over HTTP\u002FHTTPS shaped by the malleable profile |\n| T1573.002 | Encrypted Channel: Asymmetric Cryptography | TLS termination at the redirector encrypts the beacon channel |\n| T1583.006 | Acquire Infrastructure: Web Services | Disposable VPS\u002FCDN edges are acquired for resilient C2 |\n\n## Workflow\n\n### 1. Lab and firewall the team server\nPlace the team server on a private host. Restrict its C2 port to the redirector's IP only.\n```bash\n# On the team server: only the redirector (203.0.113.10) may reach 443\u002Ftcp\nsudo ufw default deny incoming\nsudo ufw allow from 203.0.113.10 to any port 443 proto tcp\nsudo ufw allow OpenSSH\nsudo ufw enable\n```\n\n### 2. Dumb-pipe redirector (socat \u002F iptables)\nFor quick separation with no filtering, forward the C2 port to the team server.\n```bash\n# socat foreground forward of 443 -> team server\nsocat TCP4-LISTEN:443,fork,reuseaddr TCP4:10.0.0.2:443\n\n# Or iptables DNAT (persistent)\nsysctl -w net.ipv4.ip_forward=1\niptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 10.0.0.2:443\niptables -t nat -A POSTROUTING -p tcp -d 10.0.0.2 --dport 443 -j MASQUERADE\n```\n\n### 3. Filtering nginx reverse-proxy redirector\nOnly proxy requests whose URI matches the malleable profile; send everything else a `302` to a decoy. Replace the location regex and User-Agent with values from your profile.\n```nginx\n# \u002Fetc\u002Fnginx\u002Fsites-available\u002Fredirector.conf\nserver {\n    listen 443 ssl;\n    server_name cdn.example.com;\n\n    ssl_certificate     \u002Fetc\u002Fletsencrypt\u002Flive\u002Fcdn.example.com\u002Ffullchain.pem;\n    ssl_certificate_key \u002Fetc\u002Fletsencrypt\u002Flive\u002Fcdn.example.com\u002Fprivkey.pem;\n\n    # Proxy ONLY profile-matching C2 URIs to the hidden team server\n    location ~ ^\u002F(api\u002Fv2\u002Fjobs|cm\u002F[a-z0-9]+|push) {\n        # Require the implant's exact User-Agent\n        if ($http_user_agent != \"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36\") {\n            return 302 https:\u002F\u002Fwww.legitimate-decoy.com\u002F;\n        }\n        proxy_pass https:\u002F\u002F10.0.0.2;\n        proxy_ssl_verify off;\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $remote_addr;\n    }\n\n    # Everything else -> benign decoy\n    location \u002F {\n        return 302 https:\u002F\u002Fwww.legitimate-decoy.com\u002F;\n    }\n}\n```\n```bash\nsudo ln -s \u002Fetc\u002Fnginx\u002Fsites-available\u002Fredirector.conf \u002Fetc\u002Fnginx\u002Fsites-enabled\u002F\nsudo nginx -t && sudo systemctl reload nginx\n```\n\n### 4. Apache mod_rewrite redirector\nApache's `[P]` flag proxies matching requests to the team server; non-matches get a `302` redirect. This is the format `cs2modrewrite` produces.\n```apache\n# \u002Fetc\u002Fapache2\u002Fsites-available\u002Fredirector.conf  (inside \u003CVirtualHost *:443>)\nRewriteEngine On\nSSLProxyEngine On\n# Require the implant User-Agent\nRewriteCond %{HTTP_USER_AGENT} \"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36\" [NC]\n# Match valid C2 URIs (GET\u002FPOST\u002Fstager) from the malleable profile\nRewriteCond %{REQUEST_URI} ^\u002F(api\u002Fv2\u002Fjobs|cm\u002F[a-z0-9]+|push)\u002F?$\n# Proxy to the hidden team server, preserving the URI\nRewriteRule ^.*$ https:\u002F\u002F10.0.0.2%{REQUEST_URI} [P,L]\n# Everything else -> decoy site\nRewriteRule ^.*$ https:\u002F\u002Fwww.legitimate-decoy.com\u002F [R=302,L]\n```\n```bash\nsudo a2ensite redirector && sudo apache2ctl configtest && sudo systemctl reload apache2\n```\n\n### 5. Generate rules from a malleable profile\nLet `cs2modrewrite` build the Apache or nginx rules directly from your Cobalt Strike profile so the filter exactly matches beacon traffic.\n```bash\ncd cs2modrewrite\n# Apache mod_rewrite rules\npython3 cs2modrewrite.py -i havex.profile -c https:\u002F\u002F10.0.0.2 \\\n  -r https:\u002F\u002Fwww.legitimate-decoy.com -o \u002Fetc\u002Fapache2\u002Fredirect.rules\n# nginx config\npython3 cs2nginx.py -i havex.profile -c https:\u002F\u002F10.0.0.2 \\\n  -r https:\u002F\u002Fwww.legitimate-decoy.com -H cdn.example.com > \u002Fetc\u002Fnginx\u002Fsites-available\u002Fc2.conf\n```\n\n### 6. Terminate TLS with Let's Encrypt\nIssue a valid certificate so beacon HTTPS does not throw TLS warnings and the edge looks legitimate.\n```bash\nsudo certbot --nginx -d cdn.example.com --agree-tos -m ops@example.com --redirect\n# Verify auto-renewal\nsudo certbot renew --dry-run\n```\n\n### 7. Apply OPSEC controls\nLayer defenses against blue-team analysis: validate headers, geofence to the target country, divert sandboxes, and rotate edges. Consider CDN\u002Fdomain fronting (T1090.004) where supported.\n```bash\n# Example: drop non-target geographies at the firewall with ipset\u002FGeoIP,\n# require a custom auth header in the profile, and rotate the redirector\n# domain\u002FIP on a schedule. Check the redirector only forwards matched traffic:\ncurl -k https:\u002F\u002Fcdn.example.com\u002F                       # expect 302 to decoy\ncurl -k -A \"Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36\" \\\n  https:\u002F\u002Fcdn.example.com\u002Fapi\u002Fv2\u002Fjobs                  # expect proxied response\n```\n\n## Tools and Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| nginx | Filtering reverse-proxy redirector | https:\u002F\u002Fnginx.org\u002F |\n| Apache mod_rewrite | `[P]` proxy + `302` decoy redirector | https:\u002F\u002Fhttpd.apache.org\u002Fdocs\u002Fcurrent\u002Fmod\u002Fmod_rewrite.html |\n| cs2modrewrite | Generate Apache\u002Fnginx rules from CS profile | https:\u002F\u002Fgithub.com\u002Fthreatexpress\u002Fcs2modrewrite |\n| RedWarden | Malleable-aware filtering C2 reverse proxy | https:\u002F\u002Fgithub.com\u002Fmgeeky\u002FRedWarden |\n| redi | Automated nginx + Let's Encrypt CS redirector | https:\u002F\u002Fgithub.com\u002Ftaherio\u002Fredi |\n| socat | Dumb-pipe TCP forwarder | http:\u002F\u002Fwww.dest-unreach.org\u002Fsocat\u002F |\n| Let's Encrypt \u002F certbot | Free TLS certificates | https:\u002F\u002Fcertbot.eff.org\u002F |\n| ired.team | Red-team infrastructure reference | https:\u002F\u002Fwww.ired.team\u002Foffensive-security\u002Fred-team-infrastructure |\n\n## Validation Criteria\n\n- [ ] Team server firewalled to accept only the redirector source IP on the C2 port.\n- [ ] Redirector deployed (dumb pipe and\u002For filtering reverse proxy).\n- [ ] Filter rules derived from the actual malleable C2 profile (URI + User-Agent + headers).\n- [ ] Non-matching requests return a `302` to a benign decoy site (verified with curl).\n- [ ] Matching beacon requests are proxied to the hidden team server (verified with curl).\n- [ ] Valid TLS certificate issued and auto-renewal confirmed.\n- [ ] OPSEC controls applied (UA\u002Fheader validation, geofencing, decoy diversion).\n- [ ] Domain categorization \u002F CDN fronting considered where applicable.\n- [ ] Infrastructure rotation and decommissioning plan documented.\n- [ ] All activity confined to the authorized engagement scope.\n",{"name":5,"tags":25,"author":34,"domain":35,"license":15,"version":36,"nist_csf":37,"subdomain":39,"description":7,"mitre_attack":40},[26,27,28,29,30,31,32,33],"red-team","c2-infrastructure","redirector","nginx","apache-mod-rewrite","malleable-c2","opsec","traffic-filtering","mahipal","cybersecurity","1.0",[38],"DE.CM-01","red-teaming",[41],"T1090.002","main","8a3b3de73262a4c4db64523949360f3c599c2fb1","Anthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure",0,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use","https:\u002F\u002Fgithub.com\u002FSaiVatsal","https:\u002F\u002Fsaivatsal.github.io\u002FPortfolio\u002F","The Longer It Takes The Stronger It Becomes ","2026-09-21 22:45:58",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add SaiVatsal\u002FSkills-I-Use --skill building-c2-redirector-infrastructure",{"tool":57,"command":58},"bunx","bunx skills add SaiVatsal\u002FSkills-I-Use --skill building-c2-redirector-infrastructure",{"tool":60,"command":61},"pnpm","pnpm dlx skills add SaiVatsal\u002FSkills-I-Use --skill building-c2-redirector-infrastructure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002FSKILL.md",true,[65,69,75,79],{"path":66,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fapi-reference.md","REFERENCE","参考文档",2195,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002Freferences\u002Fapi-reference.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fstandards.md",1819,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002Freferences\u002Fstandards.md",{"path":80,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":84},"scripts\u002Fagent.py","SCRIPT","脚本",4818,"https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002FAnthropic-Cybersecurity-Skills-main\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002Fscripts\u002Fagent.py",[86,94,102,111,118,125],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":90,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":20},"01M7DJZP6E6KMBQV4CZSDPZEZ8","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":98,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":20},"01M7DJZFTS5TS06K2TV3MDTE67","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":20},"01M7DJRK4SRQ908F2TJM6EZ7EV","ui-styling","Create beautiful, accessible user interfaces with shadcn\u002Fui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.","MIT","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fui-styling\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fui-styling\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":20},"01M7DJR902059VEQP23PVM2WA0","design","Comprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social\u002Fads\u002Fweb\u002Fprint), icon design (15 styles, SVG, Gemini 3.1 Pro), social photos (HTML→screenshot, multi-platform). Actions: design logo, create CIP, generate mockups, build slides, design banner, generate icon, create social photos, social media images, brand identity, design system. Platforms: Facebook, Twitter, LinkedIn, YouTube, Instagram, Pinterest, TikTok, Threads, Google Ads.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fdesign\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":20},"01M7DJR56QF5N6XYTCPCFHFMNP","design-system","Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing\u002Ftypography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fdesign-system\u002FSKILL.md",[],[],{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":106,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":20},"01M7DJQXB6M0SFF7NX8J5N01AH","banner-design","Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with AI-generated visuals. Actions: design, create, generate banner. Platforms: Facebook, Twitter\u002FX, LinkedIn, YouTube, Instagram, Google Display, website hero, print. Styles: minimalist, gradient, bold typography, photo-based, illustrated, geometric, retro, glassmorphism, 3D, neon, duotone, editorial, collage. Uses ui-ux-pro-max, frontend-design, ai-artist, ai-multimodal skills.","https:\u002F\u002Fgithub.com\u002FSaiVatsal\u002FSkills-I-Use\u002Fblob\u002Fmain\u002Fui-ux-pro-max-skill-main\u002Fcli\u002Fassets\u002Fskills\u002Fbanner-design\u002FSKILL.md",[],[]]