Skip to main content

How to Set Up OPSEC-Safe C2 Infrastructure


Objective​

Design and deploy Command and Control (C2) infrastructure that protects operator identity, masks traffic, and mimics real-world adversary TTPs. OPSEC-safe C2 setups reduce the risk of detection, blacklisting, and attribution during Red Team engagements.


Prerequisites​

  • A defined scope and Rules of Engagement (RoE)
  • Threat model or TTPs selected
  • Infrastructure provisioning resources (cloud, VPS providers)
  • Familiarity with one or more C2 frameworks (e.g., Cobalt Strike, Mythic, Sliver)

Step-by-Step Instructions​


🧱 1. Architect a Multi-Tier C2 Infrastructure​

Use a staged C2 architecture with at least:

  • Beacon/implant β†’ Redirector (traffic routing only)
  • Redirector β†’ Backend C2 server (handles logic, staging, post-ex)

This isolates detection and blocks direct connection to the operator’s C2 server.

Example Layout:

[Target] β†’ [Redirector: nginx/CDN] β†’ [Backend C2 Server: CS, Mythic]

πŸ•΅οΈ 2. Provision Infrastructure with OPSEC in Mind​

Use providers that allow alias registration or crypto payments.

  • Providers: Vultr, DigitalOcean, OVH, BuyVM, Shinjiru, etc.
  • Use burner email addresses and avoid personal billing info
  • Register infrastructure under pseudonyms or temporary accounts

πŸ“Œ Tip: Consider chaining through VPN + TOR + clean VM when provisioning.


🌐 3. Set Up Redirectors Using NGINX or Apache​

Redirectors forward only specific implant traffic to the backend.

  • NGINX Example Config:
location /update {
proxy_pass https://backendc2[.]com;
proxy_set_header Host backendc2.com;
}
  • Tools: Apache, NGINX, socat, HAProxy, or Cobalt Strike’s redirector.rb

Use TLS with valid certs (Let’s Encrypt or custom) and domain fronting if desired.


πŸͺͺ 4. Register Domains and Set Up TLS​

  • Use reputable-looking domains (cdn-update.net, support-gateway.com)
  • Register via Namecheap, Gandi, Njalla, or Epik
  • Setup Let’s Encrypt certs or mimic common providers (e.g., GoDaddy, Cloudflare)

Optional:

  • Use Cloudflare as a protective CDN or to simulate domain fronting
  • Avoid newly registered domains unless simulating commodity threats

πŸ” 5. Configure C2 Profile for Stealth​

In your C2 (e.g., Cobalt Strike, Mythic):

  • Set User-Agent to legit traffic (Mozilla/5.0, Outlook/16.0, etc.)
  • Mimic headers used by real SaaS tools (e.g., Slack, O365, Zoom)
  • Use long sleep intervals and jitter (e.g., 900s Β±50%)

Sample CS Profile Snippet:

set useragent "Mozilla/5.0 (Windows NT 10.0; Win64; x64)";
http-get {
set uri "/update";
client {
header "Accept" "*/*";
header "Host" "cdn-update.com";
}
}

πŸ§ͺ 6. Test Before Launching​

  • Run whois, dig, and curl to confirm resolution and proxy behavior
  • Verify endpoint detection does not flag implant callbacks
  • Use Wireshark to analyze packet structure and TLS negotiation

πŸ”₯ 7. Maintain OPSEC Throughout the Engagement​

  • Rotate domains and infrastructure on detection or compromise
  • Avoid hosting multiple client ops from the same backend
  • Re-image or destroy VPS and domains after the op ends

Keep logs offline, and separate operator actions by engagement.


Summary​

A hardened, well-segmented C2 infrastructure is your lifeline during a Red Team op. Treat its setup with the same rigor as payload development β€” because if your C2 burns, so does your access, stealth, and credibility.

Build it right, obfuscate it well, and rotate it like a pro.