Vol. I · No. 46The protocol sectionSat, 10 Oct 2026
Layer 7 · Directory · the tree of users, groups and devices

LDAP

Lightweight Directory Access Protocol

LDAP is the read-mostly database an organisation keeps of itself. Users, groups, printers and servers live in a hierarchical tree of entries with attributes, and applications bind to it, search it, and read what they are allowed to — one directory that everything else asks about identity.

LDAP holds the organisation’s directory as a tree — bind to authenticate, search to find, and everything else reads from it.

Operates at
Layer 7
binary, not text
Ports
636 · 389
LDAPS · STARTTLS
Shape
A tree
DNs from leaf to root
Behind
Active Directory
and OpenLDAP, and more

How it works

A distinguished name is a path up the tree
cn=Anna Rai,ou=Engineering,dc=example,dc=com
Leftmost
The entry
this person, in this unit
Rightmost
The root
the organisation’s base DN

Read right to left it is a path down from the base: dc=com → dc=example → ou=Engineering → the entry itself.

The operations, and that is nearly all of them
BIND — authenticate
SEARCH — the one everyone uses
ADD
MODIFY
DELETE
COMPARE
UNBIND — close the session

A search takes a base DN, a scope and a filter like (&(objectClass=user)(memberOf=cn=admins,…)) — which is how an application asks “is this person in that group?” without holding the answer itself.

The main points

What LDAP does, step by step

1
Bind to the directory

A simple bind sends a DN and password; SASL binds use Kerberos or a certificate instead.

2
Search from a base

Give a base DN, a scope — base, one level or subtree — and a filter naming what you want.

3
Read the attributes

Entries come back as attribute/value pairs; ask only for the ones you need.

4
Modify if permitted

ADD, MODIFY and DELETE change the tree, subject to the directory’s own access controls.

Terms you will meet
DN — distinguished name — the full path
Base DN — where a search starts
objectClass — what kind of entry it is
Schema — which attributes are allowed
Filter — the query language, in parentheses
Referral — “that branch lives elsewhere”

In cybersecurity

LDAP holds the map of who everyone is, which makes it both a prize for reconnaissance and a place where one injection flaw can bypass a login.

Never plain 389

A simple bind sends the password in clear text — use LDAPS on 636 or STARTTLS, always.

LDAP injection

Unescaped input in a filter can turn a login check into a query that always matches.

Anonymous bind

If enabled, anyone can enumerate every user, group and machine in the organisation.

Service account sprawl

Bind accounts with read-everything rights end up in config files across the estate.

Signing and channel binding

Unsigned LDAP is relayable — the mitigation for a long-standing class of AD attacks.

Rich reconnaissance

Group membership and descriptions map an organisation’s privilege structure precisely.

Rides in the stack

IPTCPTLSLDAP

A long-lived TCP session carrying BER-encoded messages — compact and binary, not a text dialog like SMTP.

Works with

KerberosRADIUS

Operations & scopes

Operations
BINDauthenticate
SEARCHquery
MODIFYchange
UNBINDclose
Search scopes
basethis entry
oneits children
subthe whole branch
Filter(attr=value)