# LDAP ## Get Domain Use the `ldapsearch` tool to receive information from an LDAP server. ```sh ldapsearch -H ldap://$TARGET_IP -x -s base namingcontexts ``` * Use found namingcontexts DC ```sh ldapsearch -H ldap://$TARGET_IP -x -b 'DC=,DC= ``` * Authenticated LDAP Search ```sh ldapsearch -H ldap://$TARGET_IP -x -b 'DC=,DC=' -D '\' -W > outfile ``` ## Domain Dump If a set of LDAP credentials is known dump the domain via ```sh ldapdomaindump $TARGET_IP -u '\' -p '' --no-json --no-grep ``` The result is a set of HTML files, take a look at them.