
HTB - Support
Scope
Enumeration
Nmap Scan
┌──(kali㉿kali)-[~/…/HTB/machines/Support]
└─$ nmap -F $ip -Pn
PORT STATE SERVICE
53/tcp open domain
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
5985/tcp open wsman
┌──(kali㉿kali)-[~/…/HTB/machines/Support]
└─$ nmap -p- --min-rate 10000 $ip -Pn -vv
PORT STATE SERVICE REASON
53/tcp open domain syn-ack
135/tcp open msrpc syn-ack
139/tcp open netbios-ssn syn-ack
445/tcp open microsoft-ds syn-ack
464/tcp open kpasswd5 syn-ack
593/tcp open http-rpc-epmap syn-ack
636/tcp open ldapssl syn-ack
3268/tcp open globalcatLDAP syn-ack
5985/tcp open wsman syn-ack
9389/tcp open adws syn-ack
49757/tcp open unknown syn-ack
┌──(kali㉿kali)-[~/…/HTB/machines/Support]
└─$ nmap -p53,135,139,445,464,593,636,3268,5985,49757 $ip -Pn -oN script-scan -sCV
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
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: support.htb0., Site: Default-First-Site-Name)
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49757/tcp open msrpc Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: 4s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2024-07-05T22:01:48
|_ start_date: N/A
┌──(kali㉿kali)-[~/…/HTB/machines/Support]
└─$ sudo nmap -sU $ip --min-rate 10000 --open -v -oN udp-scan -p1-10000
PORT STATE SERVICE
53/udp open domain
88/udp open kerberos-sec
123/udp open ntp
389/udp open ldapDNS
RPC
SMB
I opened a file and list share names in it, Then I created a for loop to find accessible share
I will mount the remote share on my kali machine to easily navigate the share
UserInfo.exe.zip File looks interesting, So I will copy it to windows machine
I've downloaded dnSpy.exe before, So I decided to open the files with it, Under LdapQuery tab there is interesting information here

A user has a name support\ldap but the password is protected
I clicked on getPassword() Function to see its content
I can say that it's a decryption function to get the password in secure way involving base64 encoding and xor operation, So I asked chatGPT to rewrite this function in python to be able to run it on my host and here is the code
Run it and you will get the password
I verified with crackmapexec and Success :)
Initial Access
I tried to connect with winRM but failed So I decided to continue enumerating the domain with bloodhound-python and rpcclient
I Created a zip file to upload it to bloodhound GUI after starting it
I put custom query to bloodhound to see which user can PSRemote to the machine

I can also see that support User exists from rpcclient command
I searched for this account on bloodhound and knew that support account is a member of SHARED SUPPORT ACCOUNTS which has GenericAll rights on DC.SUPPORT.HTB which is an attack path known as Resource based constrianed delegation (RBCD), So If I have the support I can takeover the DC


I search a lot to get the syntax of ldapsearch as it's confusing for me to get information from ldap about user support
There is a value in info field, So I will try to connect to the machine with it and I got a hit :)
We knew from bloodhound that we can PSRemote with user support, So I fired up evil-winrm and waited for a shell access
Privilege Escalation
The path to domain admins is already obvious now. We can get the help of this post if we want to perform attack from Linux:
We need a fake computer account and the name of the machine account that we can write attribute on.
The machine's name is DC$

For some reason, I couldn't connect with psexec.py or dump hashes with secretsdump.py, So I switched to crackmpaexec
Last updated
