![toolsrus](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Toys_%22R%22_Us_logo.svg/1280px-Toys_%22R%22_Us_logo.svg.png)
Hello Guys!
In this Post I am going to share my ToolsRus CTF experience with you.
Your challenge is to use the tools listed below to enumerate a server, gathering information along
the way that will eventually lead to you taking over the machine.
This CTF Requires the following Tools:
- Dirbuster
- Hydra
- Nmap
- Nikto
- Metasploit
URL: ToolsRus CTF
Difficulty: Easy
Author: TryHackMe
First of all we will Enumerate the Machine.
I started with a Nmap Scan followed by a Gobuster Scan on Port 80 with the famous common.txt Wordlits.
![nmap](https://cdn.discordapp.com/attachments/723180241140318278/733051608207982602/unknown.png)
![gobuster](https://cdn.discordapp.com/attachments/723180241140318278/733052056235147354/unknown.png)
Once I navigated into the /guidelines Directory, I found a potential Username Bob.
![guidelines](https://cdn.discordapp.com/attachments/723180241140318278/733055470977286254/unknown.png)
The Port 1234 is open. It is running Apache Tomcat/7.0.88.
![tomcat](https://cdn.discordapp.com/attachments/723180241140318278/733056110038089774/unknown.png)
Here are the Results of Gobsuter on Port 1234:
![gobuster2](https://cdn.discordapp.com/attachments/723180241140318278/733056974241005689/unknown.png)
Next thing I did was a Bruteforce attack with rockyou on the /protected Direction, since it requires a Password.
![login](https://cdn.discordapp.com/attachments/723180241140318278/733058590042226768/unknown.png)
In order to crack the Passoword I used Hydra with the following Command:
$ hydra -l bob -P {YOUR WORDLIST} -f {MACHINE_IP} http-get /protected/
![hydra](https://cdn.discordapp.com/attachments/723180241140318278/733059086408482846/unknown.png)
As we got into the Site, we got a Picture saying “This Protected Page has now moved to a different Port”.
![protected](https://cdn.discordapp.com/attachments/723180241140318278/733059536910417920/unknown.png)
I ran Nikto against Port 1234 afterwards to find our new loginpage.
![nikto](https://cdn.discordapp.com/attachments/723180241140318278/733074665584459846/unknown.png)
I tried to login to the Tomcat Manager on Port 1234 with the same Credentials. It worked.
![tomcatmanager](https://cdn.discordapp.com/attachments/723180241140318278/733060078973878302/unknown.png)
As a Manager we have the ability to Upload a WAR File. You could created a WAR File with a Linux Payload and upload it.
![upload-tomcat](https://cdn.discordapp.com/attachments/723180241140318278/733062009540706444/unknown.png)
As it turns out, this Tomcat Server is very outdated and vulnerable. I found a Metasploit Module to ecploit the Manager on Port 1234.
The Module is called exploit/multi/http/tomcat_mgr_upload. It spwans a Meterpreter Session.
![shell](https://cdn.discordapp.com/attachments/723180241140318278/733076590526857317/unknown.png)
We get the Shell as the Root User. The next thing I did was getting the Root Flag, which is stored in /root/flag.txt.
![rootflag](https://cdn.discordapp.com/attachments/723180241140318278/733077167277211678/unknown.png)