Common attacks and weaknesses
- Anyone reaching the port can read and write PLC registers and change physical processes.
Industrial control protocol for PLCs. It has no authentication.
A controller sends commands to an industrial device on port 502, which acts on the physical process. It travels in clear text: anyone on the path can read it.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| mbap | 502 | TCP, UDP | Modbus Application Protocol | - | 2014-06-10 |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :502' # process listening on 502
sudo lsof -nP -i :502macOS
sudo lsof -nP -i :502
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 502 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 502 netstat -ano | findstr :502
From another machine
nmap -p 502 -sV <host> sudo nmap -sU -p 502 <host> nc -zv <host> 502
Block it in the firewall
sudo ufw deny 502/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 502" -Direction Inbound -LocalPort 502 -Protocol TCP -Action Block # Windows
Industrial control protocol for PLCs. It has no authentication.
Port 502 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 10/10 (critical) when exposed to the Internet. Anyone reaching the port can read and write PLC registers and change physical processes. Never expose to the Internet; isolate OT networks and use protocol-aware firewalls.
On Linux run "ss -ltnup 'sport = :502'", on macOS "lsof -nP -i :502", and on Windows "netstat -ano | findstr :502" to see the local process. From another machine, "nmap -p 502 <host>" shows whether it is reachable.