Hack The Box Edition: Curling

hAck The Box-3.png

Hack The Box: Curling   

Exploiting a vulnerable linux machine at target IP 10.10.10.150 known as Curling.

Strategy: 

Compromise the vulnerable machine in order to gain privileged access for the root. 

Tactics:

  • Perform a network scan. Using nmap to discover target Ip 10.10.10.150. Scanning it for all the vulnerable ports with Nikto and checking all the accessible directories with dirb. Nmap scan revealed that port 22 has a SSH service and  port 80 has an Apache server running and has a joomla service running on it. The target Ip has a cewl curling website running on it. Viewed the source page and found a secrets.txt and a username “Floris”. The secrets.txt file contained a hashed base64 text. Decoded that and it gave me a password “Curling2018!” which I used for user “floris”.

C1.png
C3comesbeforeC2.png
C2.png
  • To confirm the password for user “Floris” used burp suite to intercept a random login request. And used the cluster bomb intruder attack in burp suite for the username payload and the password payload. For this I needed a wordlist so used cewl to get a word list out of all the words on the cewl curling website blog. And got access to the system as user “Floris”. Got access to the control panel.

C4.png
  • Apparently I tried to upload a reverse php shell but for some reason was unsuccessful. So I got access to the media directory and used a php upload script so that I could upload a reverse tcp shell script to get access to the shell which worked. Also this website used the protostar theme, so linked the script with that theme directory. After successfully uploading the script, I got reverse shell using netcat.

C6.png
C7.png
  • I was currently logged in as “www-data” in the shell. Hovering inside the machine I found that user “floris” has a password_backup file present. The contents of the file are a hex dump. Copied the content and used cyberchef to decode the file. After decoding I got a password.txt file with a password for floris” and I then logged into the machine using ssh as floris. Exfiltrated to the user.txt file and infiltrated the admin area directory which contains an input and report file.

C8.png
C9user.png
  • The report contained the source of the main page website. To perform privilege escalation copied the reverse shell script to the apache web server and started it on the web machine. The vulnerable machine ran a cron job which kept refreshing the page. This basically gave me a reverse shell and got the root.txt file.

C10.png

Final Thoughts: This is great HTB machine. Did some reverse engineering, struggled a bit with escalating privileges and uploading a php script but overall had fun with this one, would rate it at a medium level difficulty CTF challenge.

Previous
Previous

What is a NoSQL Injection Attack?

Next
Next

What is the General Data Protection Regulation?