TCP · Port 389IANA Registered

Port 389 — LDAP (Lightweight Directory Access Protocol)

Hierarchical directory service protocol for looking up and authenticating users, computers, and permissions across an enterprise network.

⚡ Primary Use Cases & Environments

  • ✓Microsoft Active Directory
  • ✓OpenLDAP user authentication
  • ✓Single Sign-On (SSO) backend directory lookups

🛡️ Security & Vulnerability Analysis

Plaintext LDAP transmits passwords across the network. Use LDAPS (port 636) or enforce LDAP StartTLS.

🔧 Network Diagnostics & Inspection

1. Check Active Listening Sockets (Local Host)
Terminal Command
$ sudo ss -tuln | grep :389
Inspects whether any local process daemon is bound to port 389.
2. Remote Port & Service Scan (Nmap)
Terminal Command
$ nmap -p 389 -sV --script ldap-rootdse <target-ip>
Probes target IP to determine whether port 389 is open, closed, or filtered.
3. Wireshark Capture / Display Filter
ldap or tcp.port == 389Wireshark Filter

🔥 Firewall Configuration Rules (UFW & iptables)

UFW (Uncomplicated Firewall)
Terminal Command
$ sudo ufw allow 389/tcp
Applies a persistent Linux UFW firewall rule for port 389.
iptables Command
Terminal Command
$ sudo iptables -A INPUT -p tcp --dport 389 -j ACCEPT
Appends a direct netfilter kernel rule to the INPUT chain for port 389.

❓ Frequently Asked Questions (FAQ)

Should port 389 ever be accessible from the public internet?

Never. LDAP contains full user catalogs and credentials. It must be restricted to internal corporate subnets or accessible only through an authenticated VPN.

Related Networking Tools & Guides