🌐DnsAdmins

🎯 Overview

DnsAdmins group members have access to DNS information and can manipulate DNS service configuration. Since the Windows DNS service runs as NT AUTHORITY\SYSTEM, membership in this group can be leveraged for privilege escalation on Domain Controllers or dedicated DNS servers through custom DLL plugin injection.

πŸ”§ Attack Mechanism

DNS Plugin Architecture

# Key attack components:
- DNS management performed over RPC
- ServerLevelPluginDll registry key allows custom DLL loading
- Zero verification of DLL path or content
- DNS service restart loads the custom DLL as SYSTEM
- Full path specification required for successful exploitation

Attack Flow

  1. Generate malicious DLL (msfvenom or custom code)

  2. Host DLL on accessible network share or local path

  3. Configure ServerLevelPluginDll registry key via dnscmd

  4. Restart DNS service to trigger DLL loading

  5. Execute payload with SYSTEM privileges

  6. Clean up registry and restore service

πŸ” Group Membership Verification

Check DnsAdmins Membership

Alternative Verification

πŸ’£ Custom DLL Generation

Method 1: MSFVenom Payload

Method 2: Reverse Shell Payload

Method 3: Custom Mimilib.dll

🌐 DLL Hosting and Delivery

HTTP Server Method

SMB Share Method

πŸ” DNS Service Configuration

Test Non-Privileged Access

Load DLL as DnsAdmins Member

Alternative UNC Path

πŸ”„ DNS Service Manipulation

Check Service Permissions

Find User SID

Analyze Service Permissions

Service Restart Sequence

Stop DNS Service

Start DNS Service

Verify Privilege Escalation

🎯 HTB Academy Lab Solution

Lab Environment

  • Credentials: netadm:HTB_@cademy_stdnt!

  • Access Method: RDP

  • Objective: Leverage DnsAdmins membership to escalate privileges and retrieve flag

Complete Step-by-Step Walkthrough

1. Connect to Target via RDP

2. Generate Malicious DLL (On Pwnbox/Attack Machine)

3. Start HTTP Server for DLL Delivery

4. Download DLL to Target (PowerShell)

5. Configure DNS Plugin (Command Prompt)

6. Restart DNS Service

7. Verify Privilege Escalation

8. Sign Out and Reconnect

9. Access Administrator Desktop and Retrieve Flag

Key Success Indicators

  1. βœ… DLL Generation: 8704 bytes adduser.dll created successfully

  2. βœ… HTTP Server: Python server serving on port 7777

  3. βœ… DLL Download: adduser.dll present in C:\Users\netadm\

  4. βœ… Registry Configuration: "Registry property serverlevelplugindll successfully reset"

  5. βœ… DNS Service Restart: Both stop and start commands complete successfully

  6. βœ… Privilege Escalation: netadm appears in Domain Admins group

  7. βœ… Administrator Access: Can read files in C:\Users\Administrator\Desktop\DnsAdmins\

Alternative Attack Methods

Method A: Direct Administrator Access

Method B: Service Account Technique

🧹 Cleanup and Restoration

⚠️ Important Considerations

Registry Cleanup

Verify Registry Key

Remove Registry Key

Service Restoration

DNS Functionality Test

🌐 WPAD Attack Alternative

Global Query Block List Manipulation

Disable Global Query Block

Create WPAD Record

Traffic Interception

πŸ” Detection Indicators

Registry Monitoring

Service Activity

Network Indicators

πŸ›‘οΈ Defense Strategies

Group Membership Hardening

DNS Service Protection

Detection Rules

πŸ“‹ DnsAdmins Exploitation Checklist

Prerequisites

DLL Generation

Service Exploitation

Flag Retrieval

Cleanup

πŸ’‘ Key Takeaways

  1. DnsAdmins membership enables SYSTEM-level code execution on DNS servers

  2. Custom DLL injection through ServerLevelPluginDll registry key

  3. DNS service restart required to trigger malicious DLL loading

  4. Full path specification mandatory for successful exploitation

  5. Destructive nature requires careful coordination with client

  6. Domain Controller impact - DNS disruption affects entire domain

  7. Multiple attack vectors - user addition, reverse shells, WPAD attacks

  8. Cleanup essential - registry restoration and service stability


DnsAdmins group privilege escalation represents one of the most powerful Windows built-in group attacks, capable of achieving Domain Admin privileges through DNS service manipulation.

Last updated