Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / ACTIVE DIRECTORY / DNS

DNSAdmins DLL Injection

This note documents detection patterns related to DNSAdmins DLL Injection within Active Directory environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4728Member added to security-enabled global groupCriticalAccount added to DNSAdmins group enabling privilege escalation.
Security5136Directory object modifiedHighDNS configuration modifications including ServerLevelPluginDll.
Security7045Service installedHighMalicious DLL or service may be installed prior to DNS service reload.
System7036Service state changedHighDNS service restart after plugin configuration change.
Security4688Process createdMediumExecution of dnscmd or PowerShell modifying DNS server configuration.
Sysmon7Image loadedCriticalDNS service loading attacker-controlled DLL file.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Modification of ServerLevelPluginDllRegistry change pointing to attacker DLLCriticalCore indicator of DNSAdmins privilege escalation.
DNS service restartService restart after plugin modificationHighRequired for malicious DLL to load.
DLL loaded by dns.exeUnusual library loaded into DNS service processCriticalStrong exploitation evidence.
Execution of dnscmd or PowerShell DNS commandsAdministrative command modifying DNS configurationHighOften used to configure malicious plugin.
DNSAdmins membership changeUser added to DNSAdmins groupCriticalPrecursor to attack.

Common Tools

ToolUsage
dnscmdConfigures ServerLevelPluginDll parameter for DNS server.
PowerShell DNS cmdletsUsed to manipulate DNS server configuration.
PowerViewEnumerates DNSAdmins privileges.
ImpacketUsed to execute commands on domain controllers.
Custom DLL payloadsExecuted within dns.exe process context.

Relevant Artifacts

  • Domain controller Security logs (4728, 5136, 4688)
  • System logs (7036 service state changes)
  • Registry modifications for DNS configuration
  • Sysmon logs (7 image load events)
  • EDR telemetry identifying DLL injection
  • DNS server operational logs
  • Prefetch artifacts for dnscmd or PowerShell execution
  • File system artifacts for malicious DLL

MITRE ATT&CK References

  • T1548 Abuse Elevation Control Mechanism
  • T1574.002 DLL Side-Loading
  • T1059 Command and Scripting Interpreter

Decision Tree

  1. Is the suspicious event present?
    • Identify DNSAdmins group modification or DNS configuration changes.
  2. What host generated the event?
    • Determine which system executed DNS configuration commands.
  3. Is the account expected to perform this action?
    • Investigate whether account normally administers DNS.
  4. Pivot:
    • Source host → inspect execution of dnscmd or PowerShell.
    • Registry → check ServerLevelPluginDll configuration.
    • Service events → review DNS service restart activity.
  5. Confirm exploitation
    • Determine whether dns.exe loaded attacker-controlled DLL.

Example Detection Templates

KQL

SecurityEvent
| where EventID == 4728
| where TargetUserName == "DNSAdmins"
SecurityEvent
| where EventID == 4688
| where Process has "dnscmd"

EQL

any where event.code == "4688"

Sigma

title: DNSAdmins DLL Injection Attempt
id: dnsadmins-dll-injection
status: experimental
description: Detects potential abuse of DNSAdmins to load malicious plugin DLL
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4688
    CommandLine|contains: dnscmd
  condition: selection
fields:
  - CommandLine
  - SubjectUserName
falsepositives:
  - Legitimate DNS administrative activity
level: high
tags:
  - attack.privilege_escalation

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Group membershipRestrict DNSAdmins membershipCriticalLimits privilege escalation path.
MonitoringAlert on ServerLevelPluginDll modificationsHighDetects attack configuration.
Service protectionMonitor dns.exe module loadsHighDetects malicious DLL execution.
Least privilegeLimit DNS administrative permissionsHighReduces attack surface.
Threat huntingReview DNS server configuration changesMediumIdentifies suspicious modifications.