Common attacks and weaknesses
- Unauthenticated reads of cluster configuration and secrets.
Apache ZooKeeper client port.
The client sends a request to port 2181 and the ZooKeeper service answers. It travels in clear text: anyone on the path can read it.
Unofficial use. The IANA assignment below differs from what is usually found on this port in practice.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| eforward | 2181 | TCP, UDP | eforward | - | - |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :2181' # process listening on 2181
sudo lsof -nP -i :2181macOS
sudo lsof -nP -i :2181
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 2181 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 2181 netstat -ano | findstr :2181
From another machine
nmap -p 2181 -sV <host> sudo nmap -sU -p 2181 <host> nc -zv <host> 2181
Block it in the firewall
sudo ufw deny 2181/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 2181" -Direction Inbound -LocalPort 2181 -Protocol TCP -Action Block # Windows
Apache ZooKeeper client port.
Port 2181 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 7/10 (high) when exposed to the Internet. Unauthenticated reads of cluster configuration and secrets. Enable SASL authentication and restrict to cluster members.
On Linux run "ss -ltnup 'sport = :2181'", on macOS "lsof -nP -i :2181", and on Windows "netstat -ano | findstr :2181" to see the local process. From another machine, "nmap -p 2181 <host>" shows whether it is reachable.