Page cover

AD Enumeration TOOL

Tools

Ldapsearch

(https://devconnected.com/how-to-search-ldap-using-ldapsearch-examples/) (https://devconnected.com/how-to-setup-openldap-server-on-debian-10/)

HackTricks Offensive WMI - Active Directory Enumeration (Part 5)

  • LLL-> shorten output, remove componets and version

  • x- simple authentication (password)

  • H - hostname with protocol

    • h- Ip addr

  • D - Bind DN

    • Windows userPrincipalName are acceptable.

  • w - password

  • b - base to search from


fold title='nmap Script for ldap'
 locate -r nse$|grep ldap
/usr/share/nmap/scripts/ldap-brute.nse
/usr/share/nmap/scripts/ldap-novell-getpass.nse
/usr/share/nmap/scripts/ldap-rootdse.nse
/usr/share/nmap/scripts/ldap-search.nse

ldap example

Dumping only admin or users.


kerbrute

username Enum

Downgrade - its means downgrade the hash type. when kerberos choose their hash type the default is 23 often times they choose 18 which is more upgraded hash hashcat unable to crack it.

on the AD env. kerberos hash type cannot be changed 23 to 18 because of not all application are support 18 hash type. so they are gonna set the group policy to choose 18 hash type first for any application. then choose 23 is that application does not have 18. often times they are gonna set a group policy to monitor 23 hash type like who are gonna use it. for prevent malicious purpose.


Bloodhound.py

impacket-getTGT 'absolute.htb/d.klay:Darkmoonsky248girl' -dc-ip 10.10.11.181

delete the DB MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE n,r and restart bloodhound.

Get a ticket

Sometime its hard to get a ticket [kerberos only care about 2 thing time and auth creds]:

Impacket-getST-Creds

Topics

DNS

  • AD-DS relies heavily on DNS, especially SRV records for service discovery. most usefull & common ones:

Domain Meta-data Trough Ldap

  • domainFunctionality

  • forestFunctionality

  • DomainControlerFunctionality


MS-RPC

samba

  • rpcclient

  • smbclient

  • net

  • Impacket [ropnop binaries are also good]


Ldap

389-LDAP,636-LDAPS(SSL),3269-LDAP Global Catalog best is do nmap.

Last updated