Common attacks and weaknesses
- Servers without password, or with 8-character passwords easily brute forced.
- Unencrypted sessions.
- Exposed industrial HMIs and home computers.
VNC remote desktop. Displays 5901, 5902... map to additional screens.
The server streams its screen to the client, and the client sends back mouse clicks and keystrokes. It travels in clear text: anyone on the path can read it.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| rfb | 5900 | TCP, UDP | Remote Framebuffer | RFC 6143 | 2006-03 |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :5900' # process listening on 5900
sudo lsof -nP -i :5900macOS
sudo lsof -nP -i :5900
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 5900 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 5900 netstat -ano | findstr :5900
From another machine
nmap -p 5900 -sV <host> sudo nmap -sU -p 5900 <host> nc -zv <host> 5900
Block it in the firewall
sudo ufw deny 5900/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 5900" -Direction Inbound -LocalPort 5900 -Protocol TCP -Action Block # Windows
VNC remote desktop. Displays 5901, 5902... map to additional screens.
Port 5900 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 9/10 (critical) when exposed to the Internet. Servers without password, or with 8-character passwords easily brute forced. Never expose VNC directly: tunnel it through SSH or a VPN.
On Linux run "ss -ltnup 'sport = :5900'", on macOS "lsof -nP -i :5900", and on Windows "netstat -ano | findstr :5900" to see the local process. From another machine, "nmap -p 5900 <host>" shows whether it is reachable.