How VPN Detection Actually Works — The Research-Backed 7-Layer Method
By Fizzah Mehtab · · updated · 6 min read
The 7 layers a modern VPN detector combines, from IP lists and TCP/TLS fingerprints to SNITCH RTT timing (NDSS 2025), active probing and browser signals.
Much of what gets written about VPN detection is wrong, or describes how it worked ten years ago. This post goes through the seven layers a modern detection service combines, drawing on published research and on what we learned building IPLogs.
Layer 1 — IP intelligence
Before any fingerprinting, ask the cheapest question there is: is this IP already on a list? Most of the weight comes from three kinds of list.
- VPN operator ASNs. A few providers run their own networks: Proton AG (AS209103), Mullvad's 31173 Services (AS39351) and SoftEther (AS36599). Most VPN servers sit on rented hosting instead, such as M247 or Datacamp, where the ASN alone says nothing about one address.
- Datacenter and hosting ASNs. Real end-user devices very rarely connect from AWS, Google Cloud, Azure, DigitalOcean, Hetzner, OVH, Vultr or Leaseweb. CDNs and ordinary cloud workloads live on those networks too, so the
dc_ipsignal carries little weight alone, but it adds up with other layers. - Tor exit list. The Tor Project publishes its current exit list and updates it every few minutes. Pulling it hourly is enough, and an IP on it is a Tor exit with near-perfect confidence.
Lists give you the most precise answers of any layer, and they are also the easiest to get around: an operator only has to rent residential IPs. So treat this layer as the starting point.
Layer 2 — TCP/IP fingerprinting
A host's TCP/IP stack gives away its operating system and often its role. An iPhone sends a TTL of 64, a TCP window of 65535 with scaling, and an MSS of 1460 on Ethernet. A Linux server in a datacenter sends different values. Commercial VPN servers usually run Linux and forward traffic through a kernel tunnel, so what the far end sees is a Linux stack even when the client claims to be iOS or Windows. We derive three signals from this:
mtu_anomaly: the MSS is not one of the standard 1460/1440/1380 values, which fits a tunnel wrapping the inner payload.ttl_os_mismatch: the TTL is 63 instead of 64, meaning one extra routing hop, in this case a VPN server.tcp_window_anomaly: the initial TCP window is not the kernel default for the OS the client claims.
Layer 3 — TLS / JA3 / JA4 fingerprinting
A TLS ClientHello is full of client-specific preferences: the cipher suites and their order, elliptic curves, extensions, ALPN strings and supported versions. JA3 (2017) and JA4 (2023) hash that ClientHello deterministically. Byte-identical clients get the same hash, and clients built on different libraries get different ones. OpenVPN over TCP/443 produces a JA3 hash that no mainstream browser produces. Our post on JA3 and JA4 explained covers the details.
Layer 4 — RTT analysis (SNITCH, NDSS 2025)
The SNITCH paper (NDSS 2025) rests on a simple observation. On a direct connection, the TCP handshake and the TLS handshake take almost the same round-trip time. Put a VPN server in the middle and the TLS handshake has to cross the tunnel, while the TCP handshake only reaches the tunnel ingress. The gap between the two reveals the extra hops.
The SNITCH paper reports a true-positive rate above 95% on commercial VPN endpoints at a per-connection false-positive rate below 1% on residential ISPs — from a single RTT pair.
IPLogs implements SNITCH by measuring the handshake timings in the browser with PerformanceResourceTiming, sending them to the detection engine and applying the paper's statistical test. A related cross-layer RTT check compares the TCP RTT with the distance you would expect from the IP's location. If a user appears to be in Frankfurt but their TCP RTT puts them two hops from Chicago, that raises a geo_rtt_mismatch signal.
Layer 5 — Active probing
Once the passive layers make an endpoint look suspicious, you can probe it directly on well-known VPN ports. The GFW developed this technique for censorship, and it works just as well for detection.
- OpenVPN HARD_RESET. Send an OpenVPN reset packet to UDP/1194. A real OpenVPN server answers with its own HARD_RESET, while an ordinary host drops the packet or sends a RST. A reply produces a high-confidence
active_probe_openvpnsignal. - WireGuard handshake init. Send a MESSAGE_INITIATION packet to UDP/51820. A WireGuard peer replies with a handshake response, and anything else stays silent.
- IKEv2 SA_INIT. Send a small IKE SA_INIT on UDP/500, and a real VPN server replies with the matching SA_INIT_RESPONSE.
- REALITY cert-switch. REALITY is an obfuscation scheme used by current anti-GFW proxies, and it impersonates a real website. Probe it with a fuzzed SNI and the server switches to a different certificate, which makes SNI fuzzing a cheap test.
Probing raises an ethical point, since you are sending packets to a third party's machine. Anyone who runs active probes should rate-limit them hard and honor opt-out requests.
Layer 6 — Client-side signals
When a browser is on the other end, it can tell you things the network can't. Three cross-checks are worth running.
- Timezone vs IP geo. A browser that reports
America/New_Yorkfrom an IP in Frankfurt is a strong VPN signal. - Language vs region. A browser reporting
en-USfrom an IP in Taipei is mildly suspicious, and how much it means depends on the local population. - WebRTC ICE leak. Opening an
RTCPeerConnectionstarts ICE gathering, which sends the browser to a STUN server, and the STUN server reports back the browser's real public IP (the one its NAT uses). If that differs from the HTTP source IP, the browser is behind a VPN that doesn't tunnel UDP.
These are cheap to collect and just as easy to spoof, so we use them to support other evidence and never as the main reason for a verdict.
Layer 7 — Port and network sanity
The last layer collects smaller heuristics: services on non-standard ports, reverse DNS that doesn't resolve back, hosting-provider naming patterns in the PTR record, and unusually small fleets for the reported city. Each carries little weight, but together they can raise confidence in a verdict.
How to combine the seven layers
Each signal carries a weight between 0.05 and 0.95, and the weights of the signals that match are summed into a score between 0 and 1. Thresholds turn the score into one of four verdicts: clean below 0.30, suspicious from 0.30 to 0.60, vpn_likely from 0.60 to 0.85, and vpn_detected at 0.85 or above. One heavy signal, such as tor_exit at 0.95, can reach detected by itself, but most detected verdicts come from two or three mid-weight signals agreeing.
Allowlisting matters more than people expect. The major CDNs (Cloudflare, Akamai, Fastly, Google, Microsoft, Apple, Meta, Netflix) and public DNS anycast addresses have to be excluded explicitly, or the datacenter-ASN layer starts flagging real end users. In our experience, a wrong allowlist causes more false-positive complaints than anything else.
Try the pipeline
Everything described above runs in IPLogs. Paste any IP and the matched-signal list shows how much each layer contributed to the verdict.
References & data sources
- NDSS Symposium 2025, where the SNITCH RTT-delta and cross-layer RTT papers discussed in Layer 4 were presented.
- IPLogs aggregated VPN-provider dataset (CC-BY 4.0) — the per-relay ingestion output described in Layer 1, published for reuse.
- IPLogs ground-truth benchmark — the 0.3% false-positive / 0.9% false-negative measurement behind the weighting choices above.