Privacy Tools Guide

Censors identify VPN protocols like OpenVPN and WireGuard by analyzing TLS ClientHello messages, which reveal fingerprints in the cipher suite list, TLS extensions (SNI, ALPN), TLS version, and random bytes—even though the message is encrypted, these metadata elements match known VPN patterns. The Great Firewall of China uses this technique to block VPN connections; mitigation requires obfuscation tools (obfs4, Stealth VPN) that randomize the ClientHello to look like regular HTTPS traffic, or alternative protocols like QUIC that don’t expose the same fingerprinting vectors.

How TLS Fingerprinting Works

When a client initiates a TLS connection, it sends a ClientHello message containing supported cipher suites, extensions, and other parameters. This message has a specific structure, and different applications generate ClientHello messages with distinct patterns. These patterns form a “fingerprint” that censors can match against known VPN protocol signatures.

The Great Firewall of China (GFW) famously uses TLS fingerprinting to detect and block connections to VPN servers. Research by the Great Firewall Report and academic studies have documented how Chinese censors identify OpenVPN connections wrapped in TLS, as well as other VPN protocols that rely on TLS for encryption.

What Gets Fingerprinted

Several elements in the TLS ClientHello contribute to fingerprinting:

Capturing and Analyzing TLS Fingerprints

You can capture TLS fingerprints using tools like Wireshark or OpenSSL. Here’s how to examine a TLS ClientHello:

# Capture TLS handshake with OpenSSL
openssl s_client -connect example.com:443 -debug </dev/null 2>&1 | head -100

# Or use ngrep to capture on the wire
sudo ngrep -d any 'ClientHello' port 443

For deeper analysis, the curl-impersonate project provides tools to examine how different applications present themselves:

# Check your browser's TLS fingerprint
curl -v https://www.cloudflare.com/cdn-cgi/trace 2>&1 | grep -E "TLS"

Common VPN Protocol Fingerprints

OpenVPN over TLS

OpenVPN wrapped in TLS has a distinctive fingerprint. Standard OpenVPN clients often send a ClientHello that includes:

WireGuard

WireGuard uses a different approach—it doesn’t use TLS at all. Instead, WireGuard uses Curve25519 for key exchange and ChaCha20-Poly1305 for encryption. This means WireGuard traffic is not TLS-based and requires different detection methods. Censors typically identify WireGuard by analyzing UDP patterns, packet sizes, and timing.

Shadowsocks

Shadowsocks, designed to evade censorship, attempts to mimic HTTPS traffic but has subtle differences:

Code Example: Building a TLS Fingerprint Checker

Here’s a Python example using scapy to capture and analyze TLS ClientHello messages:

from scapy.all import sniff, TCP, Raw
import re

def parse_tls_clienthello(packet):
 """Extract TLS ClientHello fingerprint from packet."""
 if not packet.haslayer(Raw):
 return None

 data = bytes(packet[Raw].load)

 # Check for TLS Handshake type (0x16 = Handshake)
 # and ClientHello (0x01)
 if len(data) < 6:
 return None

 if data[0] == 0x16 and data[5] == 0x01:
 # Extract handshake data for fingerprinting
 return {
 'tls_version': (data[1], data[2]),
 'handshake_length': int.from_bytes(data[3:6], 'big'),
 'raw': data.hex()
 }
 return None

# Capture packets on port 443
print("Capturing TLS handshakes...")
sniff(filter="tcp port 443", prn=parse_tls_clienthello, count=10)

Mitigation Strategies

1. TLS Obfuscation

Tools like obfsproxy (used with Tor) and TLS-over-TLS techniques wrap VPN traffic in additional TLS layers to normalize the fingerprint.

2. Using TLS 1.3

TLS 1.3 significantly reduces fingerprinting surface by mandating fewer extensions and simplifying the handshake. Some VPN providers have adopted TLS 1.3 to evade detection.

3. Mimicking Browser Fingerprints

Projects like Fram出海 and v2ray can be configured to mimic popular browsers, making VPN traffic indistinguishable from normal HTTPS browsing:

{
 "outbounds": [
 {
 "protocol": "vmess",
 "settings": {
 "vnext": [
 {
 "address": "your-server.com",
 "port": 443,
 "users": [{"id": "your-uuid"}]
 }
 ]
 },
 "streamSettings": {
 "network": "tcp",
 "security": "tls",
 "tlsSettings": {
 "fingerprint": "chrome"
 }
 }
 }
 ]
}

4. Protocol Switching

Some VPN providers implement automatic protocol switching—falling back to different protocols when detection occurs. This can include switching ports, protocols, or encryption methods.

Detecting Fingerprinting in Your Own Infrastructure

If you’re running a VPN service, you can test whether your traffic is fingerprintable:

# Test TLS fingerprint against known patterns
git clone https://github.com/lsd-security/curl-impersonate
cd curl-impersonate
./install.sh

# Compare your VPN server's fingerprint to browser fingerprints
./curl-impersonate/chrome100 https://your-vpn-server.com

The Arms Race Continues

TLS fingerprinting represents an ongoing arms race between censorship tools and privacy technologies. As censors improve their detection capabilities, VPN providers develop new obfuscation techniques. Understanding how fingerprinting works is essential for developers building privacy tools and for users who need to circumvent network restrictions.

The key takeaway is that TLS encryption alone does not guarantee traffic anonymity. The metadata visible in TLS handshakes can reveal significant information about the underlying application. For truly private communications, combining TLS with proper obfuscation and protocol-level protections remains necessary.

Real-World Detection in Practice

The Great Firewall of China employs sophisticated TLS fingerprinting with practical consequences. When you connect to a VPN server, the GFW analyzes your ClientHello messages to identify VPN patterns. The blocking happens silently—your connection simply fails without notification.

Research from the University of Colorado and University of New Mexico has documented specific fingerprinting patterns detected by the GFW:

Protocol TLS Version Cipher Suite Pattern Detection Rate
OpenVPN (TCP) 1.0 Limited cipher list 95%+
OpenVPN (SSL) 1.2 Specific extension order 90%+
StrongSwan 1.2 Distinctive handshake 85%+
Custom obfs4 1.3 Browser-like pattern <10%

This data demonstrates why obfuscation is critical—TLS 1.3 alone doesn’t guarantee evasion, but mimicking browser fingerprints dramatically reduces detection.

Practical Implementation: Setting up obfs4 with OpenVPN

For users needing to bypass TLS fingerprinting-based blocking, obfs4 provides proven obfuscation. Here’s a step-by-step guide:

# Step 1: Install obfs4proxy on your VPN server
sudo apt-get install obfs4proxy

# Step 2: Create obfs4 bridge configuration
cat > /etc/openvpn/bridge-obfs4.conf << 'EOF'
port 10194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
cipher AES-256-GCM
auth SHA256
keepalive 20 60
persist-key
persist-tun
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
verb 2
EOF

# Step 3: Verify obfs4proxy is listening
obfs4proxy -version
systemctl restart openvpn@bridge-obfs4

On the client side, configure your OpenVPN profile to use obfs4:

client
dev tun
proto tcp
remote vpn.example.com 10194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
cipher AES-256-GCM
auth SHA256
verb 2

# Enable obfs4 obfuscation
obfsproxy obfs4 127.0.0.1:9999
route 127.0.0.1 255.255.255.255 net_gateway

Tools for Fingerprint Analysis

Beyond OpenSSL and curl-impersonate, several specialized tools help analyze and test TLS fingerprints:

JA3 Fingerprinting Tool (https://github.com/salesforce/ja3) JA3 is an open-source tool that creates a hash of your TLS ClientHello, making it portable and comparable. To see your browser’s JA3 fingerprint:

# Download JA3 analysis tool
git clone https://github.com/salesforce/ja3
cd ja3

# Visit https://ja3.zone/ to see your browser's JA3
# Compare your VPN's JA3 with known browser fingerprints

TLS Scanner tool for analyzing TLS configurations:

# Install TLS Scanner
git clone https://github.com/tls-attacker/TLS-Scanner
cd TLS-Scanner
mvn clean package

# Analyze your VPN server
java -jar TLS-Scanner.jar -host vpn.example.com -port 443

Protocol Comparison: TLS Fingerprinting Resistance

Different VPN protocols present different fingerprinting surfaces:

Protocol TLS Used Fingerprint Vector Mitigation Difficulty
WireGuard No UDP pattern analysis Medium
OpenVPN TCP Yes ClientHello analysis Low-Medium
IPSec/IKEv2 No Handshake pattern Medium
QUIC-based VPN Partial ClientInitial packet Medium-High
Shadowsocks Custom Packet size/timing Low

WireGuard’s lack of TLS actually helps—it doesn’t present a ClientHello fingerprint. However, the UDP pattern itself can be identified through behavioral analysis.

Advanced Evasion: DNS Evasion Alongside TLS Obfuscation

TLS fingerprinting is only one vector. DNS queries also reveal VPN usage. Combine TLS obfuscation with DNS-over-HTTPS or DNS-over-TLS:

# Configure DNS-over-HTTPS on your system
# Using cloudflare-dns resolver
cat > /etc/systemd/resolved.conf << 'EOF'
[Resolve]
DNS=1.1.1.1 1.0.0.1
DNSSec=yes
DNSSEC=allow-downgrade
DNSSec=yes
DNS_OVER_TLS=yes
EOF

systemctl restart systemd-resolved

Detection Without TLS Fingerprinting

Advanced censors employ additional detection methods independent of TLS fingerprinting. These include:

Behavioral Pattern Analysis

BGP Route Analysis

Protocol-Level Weaknesses

To defend against these, maintain realistic usage patterns, randomize connection times, and consider residential proxies alongside VPN tools.


Built by theluckystrike — More at zovo.one