DNS Server to Enterprise Admin: Exploiting ADIDNS Custom Policies
An attacker who is a local administrator of any Active Directory DNS server can create DNS policies and zone scopes to return attacker-controlled IP addresses only for specific source subnets, enabling a targeted man-in-the-middle attack. This allows interception of traffic from high-value hosts, such as domain admins or enterprise admins, and can be used for credential relay and potentially cross-domain escalation.
Published on medium.com
One of my favorite things about Active Directory is the sheer amount of obscure little features that can be misused by attackers. I have now been toying with and researching strange little ADIDNS features for a while, and I found one that in some very specific situations could be exploited by a half-privileged…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the DNS server's local administrator group grants sufficient privileges to create DNS policies and zone scopes, which are stored locally and not protected by AD permissions, allowing a local admin to redirect traffic for selected clients.
Impact
An attacker with local admin on a DNS server could intercept and relay authentication traffic from targeted high-privilege users, potentially escalating to domain admin or enterprise admin, though the attack requires specific conditions such as compromising a standalone DNS server and the target using that server.
What the attacker needed
Local admin on a DNS server; target uses that DNS server; target subnet known
The fix
Restrict local administrator access on DNS servers, enable SMB signing, and apply LAPS to prevent credential reuse; the text does not state a specific fix was applied.
How it was found
- Define a client subnet matching the target's IP address.
- Create a zone scope inside the main domain zone.
- Add an A record in the zone scope with the same name as the target host but pointing to the attacker's IP.
- Create a query resolution policy that applies the zone scope to clients in the defined subnet.
- Wait for the target to resolve the hostname and intercept traffic or relay authentication.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Active Directory DNS servers can have special rules called policies that change how names are resolved for certain clients. If an attacker gains local administrator access to one of these DNS servers, they can add a rule that makes a specific computer (like an admin's workstation) resolve a server name to the attacker's machine instead of the real one. Then, when the admin tries to connect to that server, they actually connect to the attacker, who can capture or relay their credentials.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.