Exploitation
Topics
Common Vulnerabilities
Password Backtrace Disclosure Visiting /auth.jsp might reveal passwords in backtraces.
Double URL Encoding Vulnerabilities like CVE-2007-1860 allow management interface access via:
pathTomcat/%252E%252E/manager/htmlInsecure Example Scripts Apache Tomcat versions 4.x–7.x include examples susceptible to XSS or information disclosure. Examples:
/examples/jsp/num/numguess.jsp/examples/servlet/HelloWorldExampleCheck and restrict access to these paths.
Path Traversal Exploit path traversal with:
<tomcat_target_ip>/lalala/..;/manager/htmlor
http://<tomcat_target_ip>/;param=value/manager/html
Using Metasploit Framework
Leverage the tomcat_mgr_upload exploit available in Metasploit for Tomcat file upload vulnerabilities. Launch Metasploit and execute the following commands:
After exploitation, a reverse shell is obtained, allowing command execution via the meterpreter shell.
Remote Code Execution (RCE)
If you gain access to the /manager/html interface, you can upload and deploy a .war file to achieve RCE.
Example:
Metasploit can automate this:
To create a reverse shell WAR file:
Other Methods
TomcatWarDeployer Deploy shells or bind shells via:
Clusterd Automate testing:
Manual Web Shell Example JSP for command execution:
Package it into a WAR file and upload it.
Other Tools
Last updated