githubEdit

Apache Tomcat Pentesting

Apache Tomcat is an implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies.

Directories

Below are common directories for Apache Tomcat.

/examples
/examples/jsp/cal/login.html
/examples/jsp/error/error.html
/examples/jsp/snp/snoop.jsp
/examples/servlet/HelloWorldEXample
/examples/servlet/JndiServlet
/examples/servlet/RequestHeaderExample
/examples/servlet/RequestInfoExample
/examples/servlet/RequestParamExample

/host-manager

/manager
/manager/jmxproxy/?qry=STUFF
/manager/status
/manager/status/all
# We can execute commands in /manager/text/ directory
/manager/text/{command}?{parameters}
/manager/text/deploy?path=/foo
/manager/text/list
/manager/text/resources
/manager/text/serverinfo
/manager/text/vminfo

Directory Discovery

To enumerate directories automatically, use fuzzing tools.

Credentials

Below are common credentials for the manager app in Tomcat.

User Enumeration

Brute Force Credentials

Remote Code Execution (RCE)

Using Metasploit

Uploading WAR file (Reverse Shell)

First create a war file using Msfvenom.

Then upload this file.

Start a listener in local machine.

Now access to https://example.com/shell.

We should get a shell.

Investigation From Inside

If we are in the target system, we can retrieve information about credentials.

Last updated