root@sparrow:~/writeups$ cat spookifier.md
// writeups
Spookifier
4 Nov 2022
· 3 min read
· user access
A web app that "stylises" text. User input ends up concatenated inside a Mako template, enabling SSTI and, from there, command execution and flag disclosure.
Challenge overview
| Field | Value |
|---|---|
| Platform | Hack The Box · Challenge |
| Category | Web |
| Difficulty | Very Easy |
| State | Retired |
| Files | main.py · routes.py · util.py · templates/index.html |
Attack map
[Web] text input
│
▼
[util.py] generate_render() → Mako
│
▼
[SSTI ${7*7}=49] confirmed
│
▼
[RCE] os.popen('cat /flag.txt')
│
▼
[FLAG]App web que "estiliza" texto. El input del usuario acaba concatenado dentro de una plantilla Mako, lo que permite SSTI y, de ahí, ejecución de comandos y lectura de la flag.
Ficha del challenge
| Campo | Valor |
|---|---|
| Plataforma | Hack The Box · Challenge |
| Categoría | Web |
| Dificultad | Very Easy |
| Estado | Retirado |
| Archivos | main.py · routes.py · util.py · templates/index.html |
Mapa del ataque
[Web] input de texto
│
▼
[util.py] generate_render() → Mako
│
▼
[SSTI ${7*7}=49] confirmado
│
▼
[RCE] os.popen('cat /flag.txt')
│
▼
[FLAG]
🔒 Free account required
This is USER ACCESS content — free to unlock, no payment. The rest of the write-up (and everything else at this level) opens up once you're signed in.
Create a free account🔒 Registro gratuito requerido
Esto es contenido de nivel USER ACCESS — se desbloquea gratis, sin pago. El resto del writeup (y todo lo demás de este nivel) se abre en cuanto inicies sesión.
Crear una cuenta gratis