My Tomcat Host: 1 Walkthrough Vulnhub

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

In this article, we are going to solve another boot2root challenge MY Tomcat Host 1 id create by Akanksha Sachin Verma. This is an intermediate-level machine you can download here this machine link

Description

This boot to root VM is designed for testing your basic enumeration skills and concepts. Goal: Get the root flag of the target.

Network Scanning

First we scanning our local network using netdiscover command

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

Now we have a target IP address our next step is scanning all ports and running service target machine using the namp command

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

We can see the nmap output our target two ports are open 22 SSH, and 8080 http tomcat apache server.

Enumeration

so I decided to browse HTTP service target and we see a tomcat landing page

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

click the manager app button we see a password promote is open I login with default tomcat username and password

  • username: tomcat
  • password: tomcat

and we successful login the tomcat manager

without wasting our time create a java reverse shell using msfvenom and output format is .war

and start our net-cat listener port 4545

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

uploading our shell target machine

our shell is uploaded successfully and we can see our payload in deploy now executing our shell click the shell name

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

and we get a reverse connection tomcat user target machine we can identified our current user using the id command

now we without wasting our time we use the command sudo -l to check for sudo privileges

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

and we found a openjdk java binary file sudoers file our next step is exploiting the java privileges

again create a java reverse shell out put format is .jar

setup our msfconsole multi handler payload listener

java Privilege Escalation

I move the /tmp directory and download our shell target machine using the curl command

now executing our shell using sudo

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub

and we see new meterpreter session is open we can identified our new shel using id command and output is our current shell is root

by changing directory /root we found our root flag proof.txt

My Tomcat Host: 1 Walkthrough Vulnhub | My Tomcat Host: 1 Write-up Vulnhub
Infosec Warrior- 3 Vulnhub Walkthrough link