[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B55TYRAN50TW0MGNEX4960":3,"skill-same:01M7B55TYRAN50TW0MGNEX4960":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":13,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M7B55TYRAN50TW0MGNEX4960","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.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\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":24,"author":33,"domain":34,"license":14,"version":35,"nist_csf":36,"subdomain":38,"description":7,"mitre_attack":39},[25,26,27,28,29,30,31,32],"red-team","c2-infrastructure","redirector","nginx","apache-mod-rewrite","malleable-c2","opsec","traffic-filtering","mahipal","cybersecurity","1.0",[37],"DE.CM-01","red-teaming",[40],"T1090.002","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fbuilding-c2-redirector-infrastructure","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill building-c2-redirector-infrastructure",{"tool":53,"command":54},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill building-c2-redirector-infrastructure",{"tool":56,"command":57},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill building-c2-redirector-infrastructure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002FSKILL.md",true,[61,65,71,75],{"path":62,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fapi-reference.md","REFERENCE","参考文档",2195,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002Freferences\u002Fapi-reference.md",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fstandards.md",1819,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002Freferences\u002Fstandards.md",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"scripts\u002Fagent.py","SCRIPT","脚本",4818,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fbuilding-c2-redirector-infrastructure\u002Fscripts\u002Fagent.py",[82,90,97,104,111,118],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]