Common attacks and weaknesses
- Flask debug mode (Werkzeug console) allows remote code execution.
- Unauthenticated private registries leaking images and secrets.
Default for Flask development servers and Docker registries; macOS uses it for AirPlay Receiver.
A browser sends an HTTP request to port 5000 and the Flask / Docker registry / UPnP server sends the page back. It travels in clear text: anyone on the path can read it, passwords included.
Unofficial use. The IANA assignment below differs from what is usually found on this port in practice.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| commplex-main | 5000 | TCP, UDP | - | - |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :5000' # process listening on 5000
sudo lsof -nP -i :5000macOS
sudo lsof -nP -i :5000
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 5000 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 5000 netstat -ano | findstr :5000
From another machine
nmap -p 5000 -sV <host> sudo nmap -sU -p 5000 <host> nc -zv <host> 5000
Block it in the firewall
sudo ufw deny 5000/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 5000" -Direction Inbound -LocalPort 5000 -Protocol TCP -Action Block # Windows
Default for Flask development servers and Docker registries; macOS uses it for AirPlay Receiver.
Port 5000 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 5/10 (moderate) when exposed to the Internet. Flask debug mode (Werkzeug console) allows remote code execution. Never run debug mode on reachable interfaces.
On Linux run "ss -ltnup 'sport = :5000'", on macOS "lsof -nP -i :5000", and on Windows "netstat -ano | findstr :5000" to see the local process. From another machine, "nmap -p 5000 <host>" shows whether it is reachable.