Stars
Last updated
Last updated
To begin with, we obtain the IP of the victim machine using the following command:
And now we perform a quick scan of all its ports to see which ones are open.
Now we conduct a more detailed scan of those ports.
We enter the website hosted on this machine and come across the following text:
I decide to list directories and files using the Gobuster tool, and we come across a .txt file that gives us a clue.
We also obtain a possible username.
The next step is to use Burp Suite, where we come across a Cookie that appears to be text in Base64 format.
We decode it, and this is the result:
It turns out we have found a new hidden file on the website. It seems to be the private key for SSH access.
But it seems we can't use it yet, as sshnote.txt file mentioned. I create a file called id_rsa.txt with the content of the private key and decide to quickly create a program using AI to automate the process of combining and testing the private key until eventually one combination is correct. Here's the code:
Finally, we give permissions to the file, execute it, and we're in:
And we obtain the User Flag.
Now, with the command "sudo -l" we observe that we can execute the chgrp binary as the root user with sudo without a password.
Let's see how it's used with the following command:
So, we can change the group of the files we want. What I do is change the group of the file /etc/shadow to sophie.
We open it with cat and copy the line where root is located, then paste it into a file on our local machine named shadow.txt. Now, we'll open the file /etc/passwd and do the same as before, but copy and paste the content into a file named passwd.txt.
Now, let's decrypt the root user's password. To do this, we'll use unshadow and John The Ripper:
And we find the root password:
Finally, we access root and obtain the Root Flag.