The Threat Model Beyond DNS
In Part 1, we showed in a bounded Go lab that client-side DNS filters miss HTTP requests tunneled over a WebRTC DataChannel, since the remote peer handles DNS resolution.
Corporate networks, however, stack several extra controls behind DNS:
- Egress filtering: Blocking outbound UDP and limiting outbound traffic to TCP ports
80and443. - Forced relaying: Pushing WebRTC off direct peer-to-peer UDP onto TURN (
:3478) or TLS-wrapped TURNS (:443) relays. - Deep Packet Inspection (DPI): Passive sensors (
Suricata,Zeek) watching STUN handshakes, DTLS headers, and TLS metadata. - Forward proxy TLS inspection: Explicit (
HTTP CONNECT) or transparent proxies decrypting TLS with enterprise root CAs.
To test how WebRTC behaves against those layers, I built a repeatable local lab pinned to Coturn 4.12.0, mitmproxy 12.2.3, Suricata 8.0.5, and Zeek 8.0.8.
Multi-Transport Testbed Topology & Encapsulation Stack
The Part 2 lab wires five transport and interception paths between the client, relay, and offline packet sensors:
[ Signaling Broker (HTTP :18080) ]
^ ^
SDP Offer/Answer | | SDP Poll/Answer
| |
[ Test Client ] ---------+--------------------+---------> [ Go WebRTC Proxy ] ---> [ Target :19090 ]
|
|--- (Path A: Direct ICE UDP) -------------------------------------------> [ Go WebRTC Proxy ]
|--- (Path B: Explicit Forward Proxy — mitmproxy :8081) -----------------> (Tests HTTP CONNECT)
|=== (Path C: TURN Relay over UDP :3478) ==============> [ Coturn 4.12 ] => [ Go WebRTC Proxy ]
|=== (Path D: TURN Relay over TCP :3478) ==============> [ Coturn 4.12 ] => [ Go WebRTC Proxy ]
|=== (Path E: TURNS Relay over TLS 1.3 / TCP :443) ====> [ Coturn 4.12 ] => [ Go WebRTC Proxy ]
|
[ PCAP Capture Tap (loopback/bridge) ]
|
+---------------+---------------+
v v
[ Zeek 8.0.8 Container ] [ Suricata 8.0.5 Container ]
(conn.log, ssl.log, http.log) (eve.json, fast.log)
On Path E (turns: on port 443), the inner DTLS DataChannel rides inside an outer TLS 1.3 stream:
+-------------------------------------------------------------------------+
| Outer TCP (:443) -> Outer TLS 1.3 (SNI: turn.lab.example) |
| +-----------------------------------------------------------------+ |
| | TURN ChannelData / STUN Allocation Framing | |
| | +---------------------------------------------------------+ | |
| | | Inner DTLS 1.2 -> SCTP -> WebRTC DataChannel (HTTP GET) | | |
| | +---------------------------------------------------------+ | |
| +-----------------------------------------------------------------+ |
+-------------------------------------------------------------------------+
To keep the lab contained, Coturn blocks all IPv4 and IPv6 relay destinations by default except explicit testbed peers, and cmd/labcert generates short-lived local certificates for turns:.
Protocol Expectations & Sensor Hypotheses
Before running the matrix (documented in Part 3), we defined four protocol hypotheses to test:
- 1. TURN UDP (
:3478) — High metadata exposure: Inner DataChannel payloads stay DTLS-encrypted, but outer STUNALLOCATEandCREATE_PERMISSIONframes cross in plaintext—exposing transaction IDs, magic cookies (0x2112A442), and peer IPs. - 2. TURN TCP (
:3478) — Stream framing: Moves STUN and ChannelData onto TCP to survive UDP blocks, but stays vulnerable to port blocks and plaintext STUN inspection. - 3. TURNS over TLS/TCP (
:443) — Outer TLS wrapper: Hides inner STUN and DTLS headers inside TLS 1.3 on port443, while still exposing the outer TLS ClientHello (SNI, ALPN, and JA3/JA4). - 4. Explicit vs. transparent proxies: Explicit corporate proxies expect an
HTTP CONNECTtunnel. Since WebRTC opens direct UDP/TCP sockets, explicit proxy settings shouldn't catch WebRTC or TURNS—transparent routing and Layer 7 validation should be required.
Planned Controls Matrix & Next Steps
The P2-A through P2-F test runs evaluate five defensive layers:
- Client-side DNS filter: Misses all modes because the remote proxy handles DNS.
- Egress UDP firewall: Blocks direct UDP (
P2-A) and TURN UDP (P2-C), forcing TCP/TLS fallback. - Explicit forward proxy (
mitmproxy :8081): Tests whetherHTTP_PROXY/HTTPS_PROXYcaptures WebRTC sockets. - Layer 7 SNI / ALPN inspection: Tests what port-443
turns:handshakes reveal. - NIDS & EDR telemetry (
Zeek/Suricata): Checks whether default rules catch STUN/DTLS or need custom byte-offset signatures.
Continue to Part 3: Empirical Findings, Forward Proxy Boundaries, and Detection Engineering for the completed results, logs, and Suricata/EDR rules.
Repository: View the snowflake-inspired-webrtc-proxy-lab on GitHub | Artifacts: FINDINGS_PART2.md.