It is a CTF room on TryHackMe page if you are fan of Rick and Morty cartoon you should defently try to solve it. It is not that hard and you can solve it pretty fast.
- step: Start target machine that you will try to exploit and start Attackbox machine.
- step: As usually we try with nmap scan to check what ports are open on target machine with command:
- step: There is nothing much on the page but is it? We check the page source code where we find username which might be useful in next steps
- step: With use of the gobuster we scan webpage to find hidden files or directories I have used following command:
- step: We find the login.php access page but we are missing password. We check the robot.txt file and we get possible password candidate for login. Which turns out that it is actual username and pass.
- step: We end up on command panel where we can write some command like ls and we can see interesting files there with Q1 answer ingridient. We try opening filed with cat command File_name.txt but it doesnt allow us.
- step: In this step we check the clue.txt file which says that we should look around directories for second ingridient. We try to get to other directories in /home/rick/ we find the file second ingridients. Since the spaces in files names and linux arent good friends we need to use less command like this:
- step: with command
- step: we can try
- step: Since we cannot open file in it's folder we can try copying to other directory and change permissions:
- step: In browser open file via Target_IP/3rd.txt. and we can answer last Q3 in this room.
nmap -sC -sV Target_IP
With only 2 ports open we check the web page
gobuster dir -t 40 -u 10.10.151.87 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x html,php,txt -t 60
We try with less command File_name.txt voila we opened it and we can answer first Q1.
less '/home/rick/second ingredients'
And voila we have 2nd ingredient and we can answer the Q2.
sudo -l
we check what we can run as root.sudo ls -la /root
and we find 3rd.txtsudo cp /root/3rd.txt /var/www/html/ && chmod 777 3rd.txt
No comments:
Post a Comment