Guides: VPN, private email, and the defender's handbook

Learn how VPNs work and how to choose one, in five levels from the basics to measurement evidence, plus private email and a handbook of tables for defenders.

Start at level 0 if a VPN is new to you, or jump to the level that fits your question. Each guide is short, explains every term it uses, and links to the page where you can check the figures yourself.

VPN

Level 0: Basics

What a VPN is, what it does, and whether you need one.

Level 1: First steps

Choose a VPN, set it up, and check that it works.

Level 2: Know your provider

Who runs a VPN, what it tracks, and what its figures mean.

Level 3: How it works

Protocols, encryption, leaks, and geoblocking, explained simply.

Level 4: Expert

How measurements locate servers, and how to read the evidence.

Private email

Defender's handbook

Reference tables for watching industrial and office networks.

Ports and protocols

Many industrial protocols were designed without encryption or login. The secured variants came later, often on a port of their own.

Industrial protocols
ProtocolPortUsed forSecured variant
Modbus/TCPTCP 502Industrial automation in every sector: controllers (PLCs), remote units, sensors, energy metersModbus/TCP Security: TLS with certificates and roles (TCP 802)
DNP3TCP 20000Control systems of power utilities, also water, oil and gas; dominant in North AmericaSecure Authentication (SAv5); DNP3 over TLS (19999)
IEC 60870-5-104TCP 2404Remote control of power grids, mainly outside North AmericaTLS (IEC 62351-3) plus authentication (IEC 62351-5) (TCP 19998)
ICCP (TASE.2)TCP 102Data exchange between the control centers of grid operatorsSecure ICCP: ICCP through TLS (TCP 3782)
S7comm (ISO-TSAP)TCP 102Siemens S7 controllers: programming, HMI, data exchange; the same port carries MMS (IEC 61850, ICCP)TLS for S7-1200 and S7-1500, the default since TIA Portal V17; classic S7comm has none
EtherNet/IP, CIPTCP 44818, UDP 2222Factory automation: 44818 for messages, 2222 for cyclic I/OCIP Security (TLS and DTLS) (2221)
PROFINETLayer 2 (EtherType 0x8892); UDP 34962–34964Factory automation: real-time I/O and device naming (DCP) run directly on Ethernet; UDP 34964 sets up connectionsSecurity classes 1 to 3 (34965, 34966)
OPC UATCP 4840Vendor-neutral data exchange, the successor to OPC Classic; UDP 4840 for publish-subscribeBuilt in: security modes None, Sign and SignAndEncrypt (4843)
OPC DA (OPC Classic)TCP 135, then a port from 49152–65535Older Windows-based OPC over DCOMNone in the protocol; Windows has enforced stricter DCOM authentication since March 14, 2023
BACnet/IPUDP 47808Building automation: heating, ventilation, lighting, access controlBACnet Secure Connect: TLS over WebSockets
Office and network protocols that also run in plants
ProtocolPortUsed forSecured variant
SMBTCP 445Windows file and printer sharingSMB 3 encryption and signing; SMB over QUIC with TLS 1.3 (UDP 443)
NetBIOSUDP 137, 138, TCP 139Older Windows name resolution and SMB1; SMB2 and later do not use these portsNone
LLMNRUDP 5355Windows name lookup when DNS fails; attackers answer it with forged replies to collect loginsNone
mDNSUDP 5353Name lookup in the .local domain: printers, IoT devices, Apple BonjourNone
DNSUDP, TCP 53Name resolution; TCP for large answers and zone transfersDNS over TLS and over QUIC (853), over HTTPS (443); DNSSEC signs but does not encrypt
DHCPUDP 67, 68Automatic IPv4 addresses; DHCPv6 uses UDP 546 and 547None in common use
SNMPUDP 161, 162Monitoring network devices: 161 for queries, 162 for trapsSNMPv3 with authentication and encryption, or SNMP over TLS and DTLS; versions 1 and 2c send the community string in cleartext (10161, 10162)
SyslogUDP 514Log messages; TCP 514 is registered to rsh, not to syslogSyslog over TLS (TCP 6514)
FTPTCP 21, 20File transfer in cleartext: 21 for commands, 20 for data in active modeFTPS (TLS); SFTP is a separate protocol inside SSH (990, TCP 22)
TelnetTCP 23Remote console in cleartext, passwords includedSSH (TCP 22)
LLDP, CDPLayer 2Neighbor discovery between switches and devices, with names, software versions and VLANs; PROFINET uses LLDP for its topologyNone
ARPLayer 2 (EtherType 0x0806)Finds the MAC address for an IPv4 address on the local networkNone: replies are not authenticated
ICMPIP protocol 1 (ICMPv6: 58)Ping and error messages; in IPv6 also neighbor discoveryNone

Wireshark display filters

Type these into Wireshark's filter bar to narrow a capture down to one protocol or to signs of trouble. The field names are checked against the Wireshark display filter reference.

FilterShows
modbus || mbtcpAll Modbus/TCP traffic: the header (mbtcp) and the command (modbus)
modbus.func_code in {5,6,15,16,23}Modbus commands that write coils or registers
modbus.exception_codeModbus error responses; only they carry this field
mbtcp.unit_id == 1Modbus traffic to one device behind a gateway (unit 1)
s7commSiemens S7 communication, built in since Wireshark 2.0
dnp3DNP3
iec60870_104 || iec60870_asduIEC 60870-5-104; up to Wireshark 3.0 the filter was 104apci
enip || cipEtherNet/IP and CIP
bacnet || bvlc || bacappBACnet/IP: link, network and application layer
cdp || lldpNeighbor discovery, which gives away device names, software versions and VLANs
llmnr || nbns || mdnsBroadcast name lookups that attackers can answer with forged replies
tcp.flags.syn == 1 && tcp.flags.ack == 0Connection attempts; many to different ports or hosts suggest a scan
tcp.port in {102,502,2404,20000,44818}The usual TCP ports of industrial protocols at a glance
frame matches "password"Packets that contain the word password in any case, such as logins over Telnet or FTP
tcp.port != 502Everything except Modbus/TCP: since Wireshark 3.6, != means that no port equals 502, the same as !(tcp.port == 502)

These are display filters. Capture filters decide what is recorded at all. They use a different syntax, such as tcp port 502. contains looks for text and is case-sensitive; matches takes a regular expression and ignores case by default.

Modbus/TCP

Modbus has no login and no encryption: anyone who can reach port 502 can read and write. A request over TCP is a 7-byte header followed by the command.

A Modbus/TCP request
Transaction Identifier2 bytes
Protocol Identifier2 bytes
Length2 bytes
Unit Identifier1 byte
Function code1 byte
Datavariable
MBAP headerPDU
FieldBytesMeaningWireshark field
Transaction Identifier2Pairs request and response: the client sets it, the server copies itmbtcp.trans_id
Protocol Identifier20 for Modbus; frames with another value are discardedmbtcp.prot_id
Length2Number of bytes that follow: unit identifier plus PDUmbtcp.len
Unit Identifier1The device behind a gateway (1 to 247); 0xFF or 0 for a device reached directlymbtcp.unit_id
Function code1What the request does (table below)modbus.func_code
Data≤ 252Start address, count, values: up to 252 bytesmodbus.data
Function codes
CodeHexNamePurpose
10x01Read Coilsreads
20x02Read Discrete Inputsreads
30x03Read Holding Registersreads
40x04Read Input Registersreads
50x05Write Single Coilwrites
60x06Write Single Registerwrites
80x08Diagnosticsdiagnostics, mostly on serial lines
150x0FWrite Multiple Coilswrites
160x10Write Multiple Registerswrites
230x17Read/Write Multiple Registersreads and writes
430x2BEncapsulated Interface Transport (MEI 14: Read Device Identification)device information
65–72, 100–1100x41–0x48, 0x64–0x6EUser-defineddefined by the vendor, not unique
900x5ASchneider Electric UMAS (decoded by Wireshark)programs Schneider controllers
Exception codes
CodeNameMeaning
01Illegal FunctionThe device does not support this function code
02Illegal Data AddressThe address does not exist on the device
03Illegal Data ValueA value in the request is not allowed
04Server Device FailureThe device failed while carrying out the request
05AcknowledgeAccepted; a long programming command is still running
06Server Device BusyThe device is busy with a long command
08Memory Parity ErrorMemory error while reading a file record (functions 20 and 21)
0AGateway Path UnavailableThe gateway has no path to the target device
0BGateway Target Device Failed to RespondThe device behind the gateway did not answer

An error response repeats the function code plus 0x80 (0x03 becomes 0x83) and carries one of these codes. Code 07 (Negative Acknowledge) is an old Modicon code that the current specification no longer lists.

What to look for in Modbus traffic
SignFilterWhy it matters
Write commands from an unexpected hostmodbus.func_code in {5,6,15,16,23}Writes change the process. In normal operation only a few known systems send them, such as the HMI or the engineering station.
Many error responsesmodbus.exception_codeRequests for functions or addresses a device does not have: typical of a scan or a misconfigured client.
Device identificationmodbus.func_code == 43Returns vendor, product and version: useful for an inventory, and for an attacker.
Schneider programming trafficmodbus.func_code == 90UMAS programs Schneider controllers; it should come only from the engineering station.
Protocol identifier other than 0mbtcp.prot_id != 0Not Modbus: another protocol on port 502, or crafted packets.
Unit identifier 0mbtcp.unit_id == 0Behind a gateway, 0 is a broadcast: a write reaches every serial device, and none answers.
User-defined function codesmodbus.func_code >= 65 && modbus.func_code <= 72Vendor-specific, so two vendors may use the same code for different things. The second range is 100 to 110.