WIREGUARD
UDP 51820
WG0
WINTUN
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting Covert WireGuard Tunnels: Handshakes, Interfaces and Services

WireGuard is quiet by design: UDP, no banners, no negotiation. Its handshake messages are fixed in size, which is the one thing it cannot hide.

Scroll

WireGuard is a fast, modern VPN that an operator can set up in minutes to carry all traffic from a compromised host to infrastructure they control. It is legitimate, widely used and unauthenticated from the network’s point of view, so detection depends on spotting unsanctioned instances: by handshake shape on the wire, and by interface, driver and service artifacts on the endpoint.

Signals at a Glance

SignalWhereATT&CK
UDP flows to an external host with 148-byte initiation and 92-byte response packetsSuricata, Zeek packet data, NGFWT1572
Outbound UDP 51820 (default listen port)Firewall, Zeek conn.logT1572
wg, wg-quick or wireguard.exe execution; a wg0 interface on a host with no VPN roleauditd, Sysmon, EDRT1572
wintun.dll loaded or WireGuardTunnel service installed on a Windows endpointSysmon 7, service event 7045T1543.003
Persistent keepalive at 25-second intervals with small packetsFlow, NetFlowT1572

Handshake and Port Signals

The WireGuard protocol begins with a handshake initiation of 148 bytes whose first four bytes are the message type 01 00 00 00, answered by a 92-byte response with type 2. Data packets are encrypted, but keepalives are a fixed 32-byte payload. Operators can change the listen port, so match the structure and treat 51820 as a hint:

# Suricata - WireGuard handshake initiation (local sid range; validate before use)
alert udp $HOME_NET any -> $EXTERNAL_NET any (msg:"HUNT WireGuard handshake initiation to external host"; dsize:148; content:"|01 00 00 00|"; depth:4; threshold:type limit, track by_src, count 1, seconds 3600; classtype:policy-violation; sid:9100002; rev:1;)
# tune/validate: allow-list approved remote-access gateways (by destination)
# and run in hunt mode first; random UDP can occasionally match 148 bytes.

Interface, Driver and Service Artifacts

On Linux the interface is typically created by wg-quick up from a config in /etc/wireguard/. On Windows, the official client installs the Wintun driver and runs each tunnel as a service named WireGuardTunnel$name. Both provide high-value host signals:

// Microsoft Defender XDR (KQL) - WireGuard on endpoints
union
(DeviceProcessEvents
  | where FileName in~ ("wg", "wg-quick", "wireguard.exe", "wg.exe")
       or ProcessCommandLine has_any ("wg-quick up", "/installtunnelservice")
  | project Timestamp, DeviceName, Signal="process", Detail=ProcessCommandLine),
(DeviceImageLoadEvents
  | where FileName =~ "wintun.dll"
  | project Timestamp, DeviceName, Signal="wintun", Detail=InitiatingProcessFileName),
(DeviceEvents
  | where ActionType == "ServiceInstalled" and AdditionalFields has "WireGuardTunnel"
  | project Timestamp, DeviceName, Signal="service", Detail=AdditionalFields)
| order by Timestamp desc
// tune/validate: join to your approved VPN client inventory and exclude it.
Vetted sources

Use the WireGuard protocol whitepaper for message sizes, SigmaHQ and Elastic coverage for WireGuard and Wintun, Splunk ESCU service-install analytics, Suricata and NGFW app-ID for UDP VPN identification. Always baseline your own environment — sanctioned WireGuard use exists and must be listed before these detections are enforced.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026