RootMe
Task 1: Deploy the machine
Deploy the machine

No answer needed
Task 2: Reconnaissance
Scan the machine, how many ports are open?
Let's run a
nmapscan to see which ports are open.
There are two open ports:
22
ssh
80
http
Answer
What version of Apache is running?
Answer
What service is running on port 22?
Answer
Find directories on the web server using the GoBuster tool.
We can find directories with the following command:
No answer needed
What is the hidden directory?
Answer
Task 3: Getting a shell
user.txt
In order to get a reverse shell, we have to first go to the
/paneldirectory.

There are multiple ways of obtaining a reverse shell. We will be using a
phpreverse shell.We will be using the
/usr/share/webshells/php/php-reverse-shell.phpscript after making some modifications.

We have to replace the IP address with our own IP address which we can find using the
ipcommand. We can also change the port to any particular port we want like9999.
Once we have replaced the IP address we are ready to upload our
php-reverse-shell.phpfile.

Let's click on the
Uploadbutton next.

Looks like
phpis not allowed.There is a workaround for this, we can try to change the file extension to
php5to see if that is allowed.

Let's hit
Upload.

Our file upload has been successful.
We can now use
netcatto listen for requests.
Next, let's go to the
/uploadsfolder.

On clicking on the
php-reverse-shell.php5link, a request will be sent to our IP address on the9999port which will be caught by ournetcatlistener.
We have our reverse shell.
Let's find the
user.txtfile using thefindcommand.
Now we simply have to
catthe file.
Answer
Task 4: Privilege escalation
Search for files with SUID permission, which file is weird?
Again, we can use the
findcommand to find the relevant file.
Out of all the binaries with the SUID bit set, the
/usr/bin/pythonbinary is the most unusual.
Answer
Find a form to escalate your privileges.
We will be using the
pythonutility to escalate our privilege since it already has the SUID bit set.But before we do that, we need to check out GTFObins for a shell script.

We have to use the selected script with the
/usr/bin/pythoninterpreter.
We have successfully escalated our privilege to
root.
No answer needed
root.txt
Let's find the
root.txtfile.
All we have to do now is
catthe file.
Answer
Last updated
Was this helpful?