Common attacks and weaknesses
- Anonymous binds leaking users, groups and the domain structure.
- Clear-text simple binds exposing passwords.
- LDAP relay attacks without signing and channel binding; UDP 389 (CLDAP) used for DDoS amplification.
Directory access, used by Active Directory and OpenLDAP.
The client proves who it is on port 389 and gets an answer (or a ticket) it can use with other services. Encryption is optional: traffic is only protected if TLS is enabled on the server and the client.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| ldap | 389 | TCP, UDP | Lightweight Directory Access Protocol | - | - |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :389' # process listening on 389
sudo lsof -nP -i :389macOS
sudo lsof -nP -i :389
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 389 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 389 netstat -ano | findstr :389
From another machine
nmap -p 389 -sV <host> sudo nmap -sU -p 389 <host> nc -zv <host> 389
Block it in the firewall
sudo ufw deny 389/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 389" -Direction Inbound -LocalPort 389 -Protocol TCP -Action Block # Windows
Directory access, used by Active Directory and OpenLDAP.
Port 389 is registered for TCP and UDP.
It is rated 6/10 (high) when exposed to the Internet. Anonymous binds leaking users, groups and the domain structure. Require LDAP signing and channel binding, or LDAPS.
On Linux run "ss -ltnup 'sport = :389'", on macOS "lsof -nP -i :389", and on Windows "netstat -ano | findstr :389" to see the local process. From another machine, "nmap -p 389 <host>" shows whether it is reachable.