Using Tomcat Manager to execute code
In Chapter 4, Testing Authentication and Session Management, we obtained the Tomcat Manager credentials and mentioned that this could lead us to execute code in the server. In this recipe, we will use such credentials to log in to the manager and upload a new application that will allow us to execute operating system commands within the server.
How to do it...
For this recipe, we come back to our OWASP BWA machine vm_1
, and start from the point where we already know the credentials for the Tomcat server:
- Browse to
http://192.168.56.11:8080/manager/html
and, when asked for username and password, use the ones obtained previously—root
as username andowaspbwa
as the password:

- Once inside the manager, look for the section WAR file to deploy and click on the
Browse
button. - Kali includes a collection of web-shells in
/usr/share/laudanum
. Browse there and select the/usr/share/laudanum/jsp/cmd.war
file:

- After it has loaded, click
Deploy
:

- Verify that you have a new...