Post

Swsctfjournal8

Topic: Cyborg

Run a nmap scan.

alt text

Website page.

alt text

For more recon, I will run dirsearch.

alt text

I find two directories; /etc/ and /admin/

Looking at admin i see this page.

alt text

Navigating to the /admin path I see this page as well.

alt text

It seems like conversations between admin and a message from alex about how to set up proxy.

In /etc/ we find,

alt text

Theres a squid directory, if we open it we found a passwd file with a hash

alt text

Now we can try to crack it using John the ripper

alt text

alt text

And we found a password: squidward

I tried to see if that was a password for ssh connection but it failed, so, after investigating further the website I found out that we can download a tar file form the dropdown menu on the admin page that we found

alt text

Now let’s run tar -xvf archive.tar to extract the files and directories of the .tar file

alt text

Now we can explore some files, let’s check out README

alt text

It seems like a Backup Borg repository, we have to install Borg, let’s use “sudo apt install borgbackup -y” to do so

After that we can list the repository using “borg list home/field/dev/final_archive

alt text

this is where the password we found comes into play

alt text

Now, in borg we can use the command “mount” to mount a Borg repository as a FUSE (Filesystem in Userspace) virtual file system. This feature allows us to browse the contents of a Borg repository as if it were a regular file system. We need to create a folder to store the repository also

alt text

Now we can navigate trought the repo like a file system, if we go to documents directory of the alex user, we can find the password for alex

alt text

Now we can obtain an ssh shell for the alex user with that credentials

alt text

For the privilege escalation the process is very straight forward, just run “sudo -l” and we can see that alex can run /etc/mp3backups/backup.sh as sudo, so we can echo the shebang into the backup.sh and run it as sudo

alt text

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

Trending Tags