Search 🔎🖥️

TryHackMe|CMSpit WriteUp\Walkthrough (English)

CMSpit

Room Link: https://tryhackme.com/r/room/cmspit

================================================================

  • sudo nmap -vv IP we have 2 open ports 80 and 22. Visit the website on port 80 and you will immediately know the name of the CMS which is cockpit.
  • To know the version, visit the source code then search (ctrl+f) “ver” and you will get the version.
  • Start msfconsole and search for “cockpit”. You have an exploit module that will reveal the users and get you a shell exploit/multi/http/cockpit_cms_rce. First, run the module without specifying any user to make it print the available users' names then choose any of them and and rerun the exploit. Set the rhosts and the lhost then run the exploit.
  • Now set the user as admin and rerun the exploit. Take the new password and login to the webserver using the browser as the admin.

Go to /finder. From there upload a php reverse shell.


Set up a listener in your device and run the shell by visiting the shell IP/[shell name].
  • In the question, it needs you to give the email address of Skidy. So just change the username in the module to Skidy and run it.
  • Back to point 4. You will get a shell in your device /bin/bash -i to get a bash shell. cd /var/www/html/cockpit list the contents and you will find a webflag.php file. Cat it and retrieve the web flag ✨.
  • Look around in the machine and see how many users have a home directory. There is only one user called stux. cd stux then ls -al cat the contents of .dbshell here you will find the password for stux and the database flag ✨.
  • su stux then paste the password. now that you are stux you can view the user.txt file and retrieve the flag 😊.
  • Now to get the root flag sudo -l. The user stux is allowed to run exifool as root. Go to GTFObins and search for exiftool. Go to sudo

The LFILE is the file to which you want to copy the contents. The input file is the file from which you want to take the inputs. So
LFILE=/tmp/rootflag
INPUT=/root/root.txt we knew the file name from the question
sudo exiftool -filename=$LFILE $INPUT
run these three commands then you will get the root flag in /tmp/rootflag file. Go and retrieve it ✨.

Comments

Popular posts from this blog

TryHackMe|Blog WriteUp\Walkthrough (Arabic)

eJPTv2 Exam Review (Arabic)

TryHackMe|Blueprint WriteUp\Walkthrough (Arabic)