<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: implementing-domain-fronting
description: >-
  Implement domain fronting techniques using CDN infrastructure to disguise C2 traffic as legitimate HTTPS communication to high-reputation domains.
domain: cybersecurity
subdomain: c2-frameworks
tags:
  - domain-fronting
  - cdn
  - https
  - traffic-masking
  - evasion
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1090.004"]
  cwe: ["CWE-300"]
  tools: ["CloudFront", "Azure CDN", "Fastly", "Cobalt Strike", "curl"]
---

# Implementing Domain Fronting

## Overview

Implement domain fronting techniques using CDN infrastructure to disguise C2 traffic as legitimate HTTPS communication to high-reputation domains.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `CloudFront` | Security tooling |
| `Azure CDN` | Security tooling |
| `Fastly` | Security tooling |
| `Cobalt Strike` | Security tooling |
| `curl` | Security tooling |
| Isolated lab environment for testing | Environment requirement |
| Authorization and signed Rules of Engagement (RoE) | Environment requirement |
| Relevant target samples or systems acquired through authorized channels | Environment requirement |

## Quick Reference

```bash
# Test domain fronting via curl
curl -s -H "Host: real-c2.example.com" \
    https://d1234567.cloudfront.net/beacon

# CloudFront configuration
# 1. Create distribution pointing to C2 origin
# 2. Configure alternate domain name
# 3. Set allowed HTTP methods to GET, POST

# Verify fronting works
curl -v -H "Host: real-c2.example.com" \
    https://high-reputation-domain.cloudfront.net/api/status 2>&1 | \
    grep "< HTTP"

# Detection: compare SNI with Host header
tshark -r capture.pcap -Y "ssl.handshake.extensions_server_name" \
    -T fields -e ssl.handshake.extensions_server_name -e http.host
```

## Workflow

### Step 1: Preparation and Reconnaissance

```bash
# Identify target and gather initial intelligence
file ./target_sample
cloudfront --version 2>/dev/null || echo "Install CloudFront"

# Set up working directory
mkdir -p /tmp/implementing-domain-fronting/{output,logs,artifacts}
```

### Step 2: Primary Analysis

```bash
# Execute primary analysis with CloudFront
# Refer to Quick Reference above for detailed commands
echo "[*] Running Implementing Domain Fronting with CloudFront..."

# Log all operations
script -q /tmp/implementing-domain-fronting/logs/session.log
```

### Step 3: Deep Investigation

```bash
# Apply Azure CDN for secondary analysis
echo "[*] Deep investigation with Azure CDN..."

# Cross-reference findings
diff /tmp/implementing-domain-fronting/output/primary.json /tmp/implementing-domain-fronting/output/secondary.json
```

### Step 4: Documentation and Reporting

```bash
# Generate structured findings report
cat <<'EOF' > /tmp/implementing-domain-fronting/output/report.json
{
  "technique": "implementing-domain-fronting",
  "domain": "c2-frameworks",
  "tools_used": ["CloudFront", "Azure CDN"],
  "findings": [],
  "recommendations": []
}
EOF
```

## Detection

```yaml
title: Domain Fronting Detection
id: 33c4f539-07e3-4714-a62a-a03e091abfc2
status: experimental
description: Detects suspicious activity related to implementing domain fronting techniques in c2 frameworks context
logsource:
  category: network_connection
  product: windows
detection:
  selection:
    DestinationPort: 443
    Initiated: "true"
  condition: selection
level: high
tags:
  - attack.t1090.004
  - attack.command_and_control
falsepositives:
  - Authorized penetration testing tools during scheduled assessments
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| Domain Fronting Detection | windows/network_connection | Sigma rule (high) |
| ATT&CK Coverage | MITRE ATT&CK | T1090.004 |

## Verification

- [ ] Environment and tools verified and operational
- [ ] Target samples acquired through authorized channels
- [ ] Primary analysis completed with findings documented
- [ ] Secondary validation performed with independent tooling
- [ ] All artifacts preserved in structured output directory
- [ ] Detection opportunities documented for blue team

## References

- [MITRE ATT&CK T1090.004](https://attack.mitre.org/techniques/T1090/004) — Related technique
- [CloudFront Documentation](https://cloudfront.org/) — Primary tooling
- [Azure CDN Reference](https://azurecdn.org/) — Secondary tooling
