Privacy Tools Guide

TSPU boxes are deep packet inspection systems deployed at Russian ISP chokepoints that identify VPN protocols by analyzing traffic patterns, TLS fingerprints, and handshake sequences. Defeat TSPU by using NaiveProxy (disguises as HTTPS), Shadowsocks with obfuscation plugins, or custom tools that mimic legitimate traffic. Avoid default VPN client signatures; compile custom clients. Developers building resilient applications should implement domain fronting, rotate server IPs frequently, and use traffic morphing techniques that make encrypted traffic statistically indistinguishable from normal browsing.

What Are TSPU Deep Packet Inspection Boxes?

Deep packet inspection boxes are specialized network appliances that examine data packets beyond just header information. Unlike basic firewalls that look at source and destination IP addresses and ports, DPI systems inspect the payload—the actual data inside the packet.

In Russia’s internet infrastructure, these boxes are deployed by Roskomnadzor (the Federal Service for Supervision of Communications) at ISP-level interconnection points. They maintain blacklists of IP addresses, domains, and protocol signatures. When traffic matches known patterns associated with VPN or proxy protocols, the system can either drop the packets or reset connections.

The technical name “TSPU” appears in regulatory documents describing equipment required for “technical measures to restrict access to information.” While the exact hardware varies (vendors include Cisco, Juniper, and specialized Russian systems like DPI-9000), the underlying detection mechanisms follow predictable patterns.

How DPI Systems Detect VPN Traffic

Modern DPI boxes use multiple detection strategies simultaneously. Understanding these methods helps when designing protocols that resist classification.

Protocol Signature Matching

The simplest detection method looks for known protocol fingerprints. OpenVPN, for example, has distinctive handshake patterns. When you connect to an OpenVPN server, the initial handshake includes specific TLS handshake messages and cipher suite negotiations that DPI systems recognize.

# Example: OpenVPN handshake has recognizable TLS patterns
# Client Hello with specific extensions and cipher suites
# Server Hello response with VPN-specific certificate patterns

# A DPI system might flag this OpenVPN handshake:
# - TLS version: 0x03 0x03 (TLS 1.3)
# - Cipher suite: 0x00 0x17 (TLS_AES_256_GCM_SHA384)
# - Extension: 0x00 0x17 (application_layer_protocol_negotiation)
# - GRE header detection for OpenVPN over UDP

WireGuard is harder to detect because it looks like random noise on the wire. However, DPI systems can still identify WireGuard by analyzing packet sizes, timing patterns, and endpoint behavior.

Port and IP-Based Blocking

Many DPI systems maintain blocklists of known VPN server IP addresses. If your VPN provider uses static IPs or a limited pool, those addresses eventually get added to the blacklist. This is why providers with rotating IP addresses and obfuscated servers remain more accessible.

# Simple port-based blocking example (what DPI might see)
# Block common VPN ports
iptables -A INPUT -p tcp --dport 1194 -j DROP  # OpenVPN
iptables -A INPUT -p udp --dport 51820 -j DROP  # WireGuard
iptables -A INPUT -p tcp --dport 443 -j ACCEPT  # HTTPS allowed

# But OpenVPN over port 443 mimics HTTPS traffic
# DPI with TLS inspection can still distinguish it

Statistical Analysis and Machine Learning

Advanced DPI systems analyze traffic patterns to identify encrypted tunnels. They look at:

# Simplified entropy calculation for traffic analysis
import math

def calculate_entropy(data):
    if not data:
        return 0

    byte_counts = [0] * 256
    for byte in data:
        byte_counts[byte] += 1

    entropy = 0
    total = len(data)
    for count in byte_counts:
        if count > 0:
            probability = count / total
            entropy -= probability * math.log2(probability)

    return entropy

# High entropy (>7.5) suggests encryption
# Natural language English: ~4.5-5.0 entropy
# Compressed data: ~7.0-7.9 entropy
# Properly encrypted: 7.95-8.0 entropy

How TSPU Boxes Block VPN Connections

Detection is only part of the system. Once identified, DPI boxes employ various blocking techniques.

TCP RST Injection

When DPI detects VPN handshake attempts, it can inject forged TCP RST (reset) packets to both endpoints. Both the client and server receive packets appearing to come from each other, causing them to terminate the connection.

# Conceptual TCP RST injection
# DPI sees OpenVPN handshake → injects spoofed RST packets
# Client receives: "Server says: reset connection"
# Server receives: "Client says: reset connection"
# Both sides close sockets thinking the other initiated

This works because TCP relies on sequence numbers, and modern DPI systems track these accurately enough to inject valid-looking resets.

DNS Poisoning and SNI Filtering

For HTTPS-based VPNs (like methods that tunnel through port 443), DPI systems can:

  1. SNI filtering: Examine the Server Name Indication in TLS ClientHello messages
  2. DNS manipulation: Return wrong IP addresses for VPN provider domains
  3. Certificate inspection: Identify known VPN certificates
# Example: TLS ClientHello with SNI
# The DPI box can read:
# - Extension: server_name (0x00)
# - Length: 0x00 0x0f (15 bytes)
# - Type: 0x00 (host_name)
# - Value: vpn-provider.example.com

# If the SNI matches a blocked domain → connection dropped

Bandwidth Throttling

Rather than completely blocking VPN traffic, some systems throttle connections to unusable speeds. This is harder to detect because the connection “works” but performs terribly.

Building Resilient VPN Solutions

Developers working on privacy tools can implement several strategies to resist DPI detection:

Protocol Obfuscation

Using protocols that mimic legitimate traffic makes detection harder:

# Example: Encapsulating WireGuard in HTTP/3
# WireGuard packets wrapped in QUIC (HTTP/3) look like web traffic
# Packet structure:
# [QUIC header] [HTTP/3 frames] [WireGuard encrypted packet]
#
# To DPI: appears as normal HTTPS traffic to quic.google.com

Dynamic IP Rotation

Implementing automatic server switching when blocking occurs:

# Conceptual dynamic rotation logic
def get_available_server():
    servers = fetch_server_list()  # Multiple endpoints
    for server in servers:
        if is_reachable(server):
            return server
    return None  # All blocked, return to mesh/bridge

# Use domain fronting: connect to CDN, tunnel to VPN
# SNI shows cloudflare.com, actual destination is VPN server

TLS Fingerprint Manipulation

VPN clients can modify their TLS fingerprints to appear as common browsers:

# OpenVPN with tls-crypt or.obfsproxy
# Or WireGuard with noise protocol wrapper

# Change TLS fingerprint to match Chrome on Linux
# Different ClientHello patterns confuse basic DPI classifiers

Detecting If You’re Behind DPI

Power users can verify whether their traffic is being inspected:

# Test for TCP injection
curl -v https://example.com
# Look for: "Connection reset by peer" or unusual delays

# Test DNS manipulation
dig +short google.com
# Compare against known good DNS (8.8.8.8)

# Test for packet inspection
sudo tcpdump -i any -c 100 -A | grep -i "tls|https"
# Watch for unexpected packets or modified responses

Built by theluckystrike — More at zovo.one