Aller au contenu
Skillpedia
Sécurité35k · #7693

building-c2-redirector-infrastructure

Ce qu’il fait

Cet outil vous aide à mettre en place un serveur intermédiaire (redirecteur) pour masquer votre serveur principal de commande et de contrôle (C2). Il filtre le trafic afin que seules les communications légitimes provenant de votre programme (implant) atteignent le serveur principal, tandis que le trafic suspect est redirigé vers un site web ordinaire.

Quand l’utiliser

  • ✓Lorsque vous devez masquer le serveur principal face aux attaques.
  • ✓Pour vous assurer que seul le trafic attendu atteint le serveur C2.
  • ✓Pour rediriger les curieux et les contrôles de sécurité vers un site leurre inoffensif.

Lien du skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-c2-redirector-infrastructure/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-c2-redirector-infrastructure/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Mets en place un redirecteur pour masquer mon serveur C2, en redirigeant le trafic invalide vers example.com.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Il utilise des logiciels comme Nginx ou Apache pour inspecter les connexions entrantes. Si une connexion semble légitime (c'est-à-dire qu'elle correspond à un profil prédéfini), elle est transmise au serveur C2. Sinon, elle est redirigée vers un site leurre.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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.
  • cs2modrewrite to 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_rewrite redirector with [P] proxying and 302 decoy 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

…

Questions fréquentes

Qu'est-ce qu'un « redirecteur C2 » ?

C'est un serveur placé entre votre programme malveillant (implant) et le serveur de contrôle principal. Il permet de masquer le serveur principal et de filtrer le trafic.

Qu'est-ce qu'un « profil C2 malléable » (Malleable C2 profile) ?

C'est un ensemble de règles qui définissent l'apparence du trafic de votre programme (par exemple, les adresses, les en-têtes, etc.). Le redirecteur s'appuie sur ces règles pour reconnaître le bon trafic.

Que signifie « OPSEC » dans ce contexte ?

OPSEC (Operational Security, sécurité opérationnelle) désigne les mesures prises pour éviter d'être détecté ou identifié, comme masquer le vrai serveur et faire paraître le trafic normal.

Détails

Description originale de l’auteur

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

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularité

Étoiles GitHub
35k
Position au classement
#7693
Licence
Apache-2.0
Mis à jour
31/08/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires