> ## Documentation Index
> Fetch the complete documentation index at: https://www.0101isnothacking.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# LDAP enumeration

> LDAP enumeration cheat sheet for ports 389, 636, 3268, and 3269.

Lightweight Directory Access Protocol (LDAP) uses ports 389 and 636. Ports 3268 and 3269 are used for Global Catalog queries in Active Directory.

## Check default open ports

```sh theme={null}
nmap -p 389,636,3268,3269 $ip
```

## Banner grabbing

```sh theme={null}
nmap -p 389,636,3268,3269 -sV $ip
nxc ldap $ip
```

## Nmap scripts

```sh theme={null}
sudo nmap -p 389,636,3268,3269 -sVC -A $ip
sudo nmap -p 389,636,3268,3269 --script ldap-rootdse $ip
```

## Anonymous access

```sh theme={null}
nmap -p 389,636,3268,3269 --script ldap-rootdse $ip
ldapsearch -x -H ldap://$ip -b "DC=example,DC=com" "(objectClass=person)" cn
```

## Steps

![LDAP enumeration steps](https://mintcdn.com/non-9fcb5a21/P-t86H21MW2fT7Il/images/4de726c70b03.png?fit=max\&auto=format\&n=P-t86H21MW2fT7Il\&q=85\&s=1f31b789250b52f447f582780b2164d2)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.