Cyborg
Writeup of the Cyborg room on TryHackMe.
I visited the given IP
10.201.19.200and got a default Apache webpage as follows. I tried enumerating it by viewing it's source code but found nothing.
I ran a TCP Scan via Nmap on the IP and found ports 22,80 open. After that I ran a deep scan and got the following results.
root@ip-10-201-76-18:~/Desktop# nmap -sC -sV 10.201.19.200 -p 22,80 Starting Nmap 7.80 ( https://nmap.org ) at 2025-09-24 04:07 BST Nmap scan report for 10.201.19.200 Host is up (0.00013s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 2048 db:b2:70:f3:07:ac:32:00:3f:81:b8:d0:3a:89:f3:65 (RSA) | 256 68:e6:85:2f:69:65:5b:e7:c6:31:2c:8e:41:67:d7:ba (ECDSA) |_ 256 56:2c:79:92:ca:23:c3:91:49:35:fa:dd:69:7c:ca:ab (ED25519) 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: Apache2 Ubuntu Default Page: It works MAC Address: 16:FF:F9:19:7D:37 (Unknown) Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 7.90 secondsI found nothing of use in the Nmap scan which could help me gain an insight into how I could get into the system.
I ran a directory scan via Gobuster and found the following subdirectories.
/admin /etc /server-statusUpon visiting the
/adminsubdirectory I got the following webpage.
This seemed like some aspiring musician's portfolio, I looked around the website searching for some endpoint to compromise the target.
I visited the Admins page and found the following text.

This gave me a lot of information about the users that might be present on the system. The last message also conveyed something about Squid Proxy and some config file along with a backup named
music_archive.I visited the Archive dropdown on the navigation in the web page and downloaded an
archive.tarfile.I extracted it using
tar -xvf archive.tarand got the following contents inside it.
I spent a lot of time going through the contents of these files and folders. I opened the README and found the following text.

I visited the Borg Backup Repository link as given and learnt about extracting backup repositories using borg. https://borgbackup.readthedocs.io/en/stable/usage/extract.html
Here you can extract the contents of an archive and get the files and subdirectories present in it. I had never come across Borg or any similar tool hence I was stuck here for a long time due to which i had to refer a writeup to solve this.
I needed a passcode to extract the archive hence I checked the
/etcsubdirectory.
This seemed interesting.

There was a
passwdfile and asquid.confflie here. Remember the mention of Squid Proxy on the Admin page of the music website a few steps ago.The contents of
squid.confdidn't really have much information to use.
Hence I downloaded the
passwdfile and found the following hashed credential.music_archive:$apr1$BpZ.Q.1m$F0qqPwHSOG50URuOVQTTn.I tried cracking the password using John The Ripper and got the following result.

The password was cracked.
I installed Borg using
apt install borgbackup.I extracted the
final_archiverepository obtained fromarchive.tara few steps back using the following command. Here the repository contained backups and inside that I wanted to extract a specific archive known asmusic_archiveborg extract /home/field/dev/final_archive::music_archiveRemember
music_archivewas mentioned in the Admin Shoutbox on the webpage a few steps back.When the passcode was asked for I used the one I found after cracking the
passwdfile using John.After extracting the archive there was a new subdirectory named
/alexin the/homedirectory.
I enumerated the directory and found the following note in the Documents.

I found the password for the user alex which could be used to gain initial foothold on the target.
Initial foothold and Root Access
I used the password obtained in the previous step and connected to the target via SSH as shown below.

The user flag was found as follows.

I started enumerating the target looking for potential endpoints to escalate my privileges and gain root access.
I ran
sudo -lto check the commands I could run with sudo and I got the following output.
I checked the
backup.shfile and changed it's permissions.
I overwrote the file's code with
/bin/bash -pto run the bash program as privileged mode and get root access.I ran the
backup.shfile usingsudo ./backup.shand gained root privileges.I checked the root directory and obtained the root flag as follows.

Hope this writeup proved helpful to you! More of these coming soon in the future. Happy Hacking!
Last updated