389, 636, 3268, 3269 - LDAP

LDAP (Lightweight Directory Access Protocol) is used for locating various entities within networks. LDAP directories are structured to be usable across multiple servers with each server having a replicated and sychronized version of the directory referred to as a Directory System Agent (DSA).

The LDAP directory resembles a tree hierarchy, starting with the root directory at the top. This branches down to countries, which further divides into organizations, and then to organizational units representing various divisions or departments, finally reaching the individual entities level, including both people and shared resources like files and printers.

Default port: 389 and 636(ldaps). Global Catalog (LDAP in ActiveDirectory) is available by default on ports 3268, and 3269 for LDAPS.

Anonymous Access

Valid Credentials

Using NetExec (nxc) to grab BloodHound collection

nxc ldap dc01.certified.htb -u judith.mader -p judith09 --bloodhound --collection All --dns-tcp --dns-server 10.10.11.41

If you have valid credentials to login to the LDAP server, you can dump all the information about the Domain Admin using:

Enumeration

Nmap Scripts

windapsearch (works with anonymous access)

To test anonymous access, dont input a username or password

ldapsearch

Grab Domain Name

Dump as much as possible from LDAP with ldapsearch with anonymous logon

Custom Query for ldapsearch to grab the usernames of objects in LDAP

Custom Query using ldapsearch searching for objects classified as Person

If you find something saying that the "bind must be completed" means that the credentials are incorrect.

You can extract everything from a domain using:

Extract users:

Extract computers:

Extract my info:

Extract Domain Admins:

Extract Domain Users:

Extract Enterprise Admins:

Extract Administrators:

Extract Remote Desktop Group:

To see if you have access to any password you can use grep after executing one of the queries:

Last updated