El Bandito — TryHackMe Writeup
Discovered Nginx on port 80 and a Java Spring Boot application on port 8080.
Identified a WebSocket endpoint and an SSRF vulnerability via an 'isOnline' status checker on port 8080.
Used the SSRF to point to an attacker-controlled server returning HTTP 101 Switching Protocols, bypassing the Nginx proxy to access restricted Spring Actuators (/trace) and extracting credentials.
Logged into the chat application on port 80 with the stolen credentials and performed HTTP Request Smuggling to capture another user's session cookie containing the final flag.
▸Introduction
El Bandito is a Hard-rated TryHackMe machine focused heavily on web exploitation, specifically Request Smuggling. The machine requires chaining an SSRF vulnerability to perform WebSocket Request Smuggling to bypass an NGINX reverse proxy, allowing access to restricted Spring Boot Actuator endpoints. The second phase involves HTTP Request Smuggling within a chat application to hijack a simulated user's session cookie.
▸Reconnaissance
Port Scanning
Initial host discovery and port enumeration using rustscan and nmap:
Port Scan Output Summary:
Recon Notes: Two main web servers are running. Port 80 hosts an Nginx reverse proxy, while port 8080 runs a Java Spring Boot application. We will begin enumeration on port 8080 to identify exposed Actuator endpoints.
▸Enumeration
Web Enumeration (Port 8080)
Visiting the application on port 8080 reveals a "Services" page and a "Burn Token" page.

Looking at the source code of the "Burn Token" page, we notice references to a WebSocket connection (/ws).
Directory Fuzzing
Using gobuster or ffuf to uncover hidden directories:
We can identify standard Spring Boot Actuator paths, but they return a 403 Forbidden error, indicating the Nginx proxy is blocking direct access.
▸First Flag: WebSocket Request Smuggling
The SSRF Vulnerability
On the "/Services" page, there is an online status checker that makes requests to URLs (e.g., http://bandito.websocket.thm). Intercepting this request in Burp Suite reveals an SSRF vulnerability at the /isOnline?url= endpoint.

Bypassing Nginx via WebSocket Upgrade
To bypass the proxy restrictions on the Spring Actuator endpoints, we can use WebSocket Request Smuggling. We need to trick Nginx into believing a WebSocket connection has been established. Nginx looks for an HTTP 101 Switching Protocols response from the backend.
We can achieve this by hosting a rogue server that always responds with 101 Switching Protocols and pointing the SSRF to our attacker IP.
1. Start the Server (Python):
2. Smuggle the Request:
In Burp Suite Repeater, we modify the original request to point the SSRF to our server, effectively creating a blind tunnel to smuggle our HTTP requests to the restricted endpoints.
Important: Don't forget to disable 'Update Content-Length' in Burp Suite Repeater settings, otherwise this request will fail.

Extracting Credentials and Flag 1
With the tunnel established, we can bypass the proxy and query the restricted /trace actuator endpoint. The trace logs reveal two highly sensitive, custom directories:
/admin-creds/admin-flag
By smuggling requests to these endpoints, we can retrieve a set of credentials and the first flag!
Credentials Found: hAckLIEN:YouCanCatchUsInYourDreams404
▸Second Flag: HTTP Request Smuggling (Chat App)
Enumerating the Chat Application (Port 80)
Moving back to port 80, the main page appears empty, but checking the source code reveals a script at /static/messages.js. Navigating to /access presents a login panel.
Using the credentials harvested from port 8080 (hAckLIEN:YouCanCatchUsInYourDreams404), we log into a chat application interface.

Cookie Hijacking via Request Smuggling
The application features a chat between users (e.g., Jack and Oliver). We need to steal a session cookie from one of the simulated users. By analyzing the traffic when sending messages, we identify an HTTP Request Smuggling vulnerability in the message posting mechanism.
We craft a smuggled HTTP request payload that forces the victim's browser (simulated by a backend bot) to append their request (including their session cookie) to the body of a message sent to us.
Smuggled Payload Structure:
Important: Make sure to disable 'Update Content-Length' in Burp Suite Repeater settings, and set the Content-Length manually to a high range (e.g., 900).

Once the bot processes the smuggled request, the hijacked cookie appears in our chat window, revealing the final flag.

▸Summary & Key Takeaways
El Bandito is an excellent deep-dive into advanced proxy bypass and request smuggling techniques:
- WebSocket Request Smuggling: Combining an SSRF with a rogue 101 response server allows attackers to bypass reverse proxy restrictions and access protected backend administrative endpoints (Spring Boot Actuators).
- HTTP Request Smuggling: Exploiting desyncs between frontend proxies and backend servers can lead to critical session hijacking and data exfiltration.
▸References

Red Team Consultant · Penetration Tester · Bug Bounty Hunter
Offensive security professional with 250+ vulnerabilities reported across 50+ organizations including Atlassian, Vimeo, and AT&T. Sharing research, tools, and field notes.