Detecting WG tunnelling?

I'm trying to understand how WG tunnels are detected.

Consider a topology like this.

Laptop (BT, WiFI disabled, physically connected to Beryl WG tunnel) --- (Flint WG server at home internet connection in home country to internet)

Laptop uses CompanyA VPN to connect (VPN within a VPN I guess)

How could CompanyA "know" that the traffic originated via a country to country WG tunnel?

I can't get my head around how the packet coming out at the head end router would show WG origination. I guess you could look at maybe RTT or TTL. I'm missing something here...

EDIT: ipleak and all DNS checks show the endpoint "home country" so if you are WG from EMEA to US it does show the US address, and it's a home address not a VPN service. DNS is cloudflare. All is good... usually

Please discuss

Under normal circumstances they can't.

They will just see your home ip.

The only indicator could be the added latency which is not really something you can change, but you can also tell them you are on bad wifi, tcp on the other hand maybe works a little better.

the difference between udp and tcp is that udp does not have a keep alive mechanism, so if a packet is lost it is lost contributing to more latency, tcp resents the packet this way you may lag less because the home server must receive the packet.

just to explain this further:

vpns encapisulate hops, so your public ip turns into the companies one, and the endpoint visible at the remote company is your home ip from the server.

It is not possible for them to do any of the deep packet inspection or look into your tunnel.

1 Like

Hi,

Thank you for the response but if the tunnel is not detectable, how is browserleaks.com reporting it ?

Is there a way to fix this?

FlintA -- wg vpn -- FlintB -- Internet

Perhaps something like changing the outgoing MTU to 1500 on the outgoing FlintB or something?

See my test results below.

image

That site looks to open common ports for vpn.

To demonstrate im currently connected to a wireguard server on Mullvad, by chance the same ip also hosts a openvpn server, and it reports openvpn, even though i do not use it.

This isn't a hard indicator, you could also say you portforwarded it for a game server for example the business would not know the difference only that it is a known commonality with vpn ports.

You can also make it look closed by using udp protocol.

wireguard is a much better option for this since the vpn does not respond, its faster aswell, although both should be fine aslong the protocol is set to udp.

Thanks, not sure that I am following.

Do you mean change the WG tunnel protocol to UDP?

1 Like

Jup, the port which is open on the server needs to be only open for udp and the vpn needs to use udp protocol, it must not have tcp open because tcp can respond with a icmp packet that the port was unreachable, blocked that packet gives them knowledge that port is open.

Thanks xize11.
I hate to ask but how do I do that? Change the WG VPN to use UDP on the FlintB server side?

Thx

Wireguard by default uses udp.

However you need to check firewall rules.

Please go to advanced settings -> login (same credentials as gl ui) -> network -> firewall -> traffic rules tab.

can you see the rule of the vpn server with the open vpn port?

what does the protocol say?, it must be udp only.

If not i'd recommend making a copy of this rule and disable the generated one by gl firmware, im not sure if they automatic allow tcp too but for hiding a wireguard vpn server this needs to be udp only😉

Got it, yep it looks like this,

Thanks

1 Like

I edited the wgserver_allow rule and removed TCP but it still shows as a Generic tunnel or VPN

image

Could it be the MTU is also the giveaway ?

Thanks

The MTU is not issue, the mtu is not what browserleaks detect.

But if you test it on the laptop with the corporate vpn active (which is openvpn likely), then the site reflects the corporate vpn and it sees a open port on their side :slight_smile:

Unfortunately you are wrong with your assumption.

MTU is the one they detect. Port detection isn't working like that.
The MTU will give a pretty good hint. 1492 is the MTU for PPPoE, for example.
1420 for any VPN. 1380 for OpenVPN UDP ... :wink:

How would a external site detect mtu? :thinking:

MTU is only for maximum transmission unit, how big a packet is allowed.

I still think they look to common ports and then look to mtu.

Browserleaks doesn't show a vpn for me on wireguard.

However the firewall rule is generated with tcp open, this is subject to the detection.

Don't know how, but they do.
I tried it with different MTUs.

1 Like

Just checked again :wink:

They look to the response from tcp port which supplies them the mtu.

So if tcp is closed and udp does not respond like in wireguard it works.

They also call it tcp/ip fingerprint that makes sense :+1:

This can't be.

I don‘t expose any ports since I am using Mullvad via WireGuard. And even without VPN they detect the correct MTU on my side.

But mullvad hosts other servers aswell on their ip, these are tcp opened :slight_smile:

Mine says im using openvpn :yum:

But without VPN they detect PPPoE on my side, but my router does not reply to ICMP nor any ports. :sweat_smile:

This is also false :slight_smile:

The site is trolling just tested it with 1500 mtu, it shows it as linux kernel 2.0 with 1492 mtu, also the location shows in braband when other sites say amsterdam.

It looks to the next hop which likely has this exposed so it must be the pppoe server.

Pppoe is also tcp :+1:

Looking at it, they seem to detect the MTU and hops on their server. It is very likely they simply have low level access to the webserver connections. Their webserver will of course need to figure out what MTU to use (using PMTUD), so it can send the biggest possible packages back. Hops is very likely result from TTYL.

Based on the MTU they just guess it might be a VPN, because a VPN needs to have a lower MTU as it needs a bit for overhead to transmit its own data.