This repository contains an intentionally vulnerable blind XSS lab for controlled demonstrations. Use it only in an isolated environment that you own.
- un formulario publico en
cross.fitalmacena contenido controlado por el atacante - un panel interno en
backend.cross.fitrenderiza ese contenido mas tarde - un navegador privilegiado automatizado actua como puente hacia el backend interno
- un JWT guardado en
localStoragepuede ser robado y reutilizado explicitamente - mitigaciones como escaping contextual y CSP bloquean el flujo vulnerable
Este repo asume una unica maquina con Kali Linux que cumple dos roles al mismo tiempo:
- host Docker que ejecuta los contenedores
- maquina atacante desde la que se navega
cross.fity se levantan listeners HTTP
Consecuencia practica:
cross.fitdebe resolver al propio host Kalibackend.cross.fitno debe agregarse al/etc/hostsdel host- los callbacks desde contenedores al host normalmente usan
172.28.0.1
- Indice documental
- Setup Kali mismo host
- Guia paso a paso en espanol
- Guia paso a paso en ingles
- Referencia de payloads
- Plan del laboratorio
- Instala Docker Engine y Docker Compose plugin en Kali siguiendo docs/setup-kali-same-host.md.
- Agrega
cross.fital/etc/hostsdel host. No agreguesbackend.cross.fit. - Copia el archivo de entorno:
cp .env.example .env- Levanta el laboratorio:
docker compose up --build -d- Si vas a servir helpers externos:
python3 -m http.server 8000- Si vas a capturar exfiltracion estructurada:
python3 tools/collector.pyEntrada publica:
curl -i http://cross.fit/Aislamiento del backend:
curl -i -H "Host: backend.cross.fit" http://container_machine_ip/Acceso interno desde el worker:
docker compose exec -T worker wget -S -O- http://backend.cross.fit/loginEsperado:
cross.fitresponde desde el proxy publico- el host no expone
backend.cross.fit - el worker si puede acceder al backend interno
El laboratorio arranca por defecto en modo vulnerable. Para validar mitigaciones:
LAB_MODE=mitigated docker compose up -d --build internal-app workerEn ese modo:
- el sink HTML deja de renderizar crudo
- CSP bloquea scripts y handlers inline
- el flujo de robo y exfiltracion deja de ejecutarse
.
|-- docker-compose.yml
|-- db/
|-- docs/
|-- nginx/
|-- public-app/
|-- internal-app/
|-- tools/
`-- worker/
Este laboratorio incluye deliberadamente:
- almacenamiento de HTML controlado por el atacante
- renderizado inseguro en la vista interna vulnerable
- credenciales estaticas de laboratorio
- un JWT accesible desde
localStorage
- a public form on
cross.fitstores attacker-controlled content - an internal panel on
backend.cross.fitrenders that content later - an automated privileged browser acts as the bridge into the internal backend
- a JWT stored in
localStoragecan be stolen and replayed explicitly - mitigations such as contextual escaping and CSP block the vulnerable flow
This repo assumes a single Kali Linux machine playing both roles at the same time:
- Docker host running the containers
- attacker machine used to browse
cross.fitand run HTTP listeners
Practical consequences:
cross.fitshould resolve to the Kali host itselfbackend.cross.fitmust not be added to the host/etc/hosts- callbacks from containers back to the host will usually use
172.28.0.1
- Documentation index
- Kali same-host setup
- Spanish step-by-step guide
- English step-by-step guide
- Payload reference
- Lab plan
- Install Docker Engine and the Docker Compose plugin on Kali using docs/setup-kali-same-host.md.
- Add
cross.fitto the host/etc/hosts. Do not addbackend.cross.fit. - Copy the environment file:
cp .env.example .env- Start the lab:
docker compose up --build -d- If you plan to serve external helpers:
python3 -m http.server 8000- If you plan to capture structured exfiltration:
python3 tools/collector.pyPublic entrypoint:
curl -i http://cross.fit/Backend isolation:
curl -i -H "Host: backend.cross.fit" http://container_machine_ip/Internal access from the worker:
docker compose exec -T worker wget -S -O- http://backend.cross.fit/loginExpected:
cross.fitresponds from the public proxy- the host does not expose
backend.cross.fit - the worker can access the internal backend
The lab starts in vulnerable mode by default. To validate mitigations:
LAB_MODE=mitigated docker compose up -d --build internal-app workerIn that mode:
- the HTML sink no longer renders raw attacker content
- CSP blocks inline scripts and handlers
- the theft and exfiltration flow stops executing
.
|-- docker-compose.yml
|-- db/
|-- docs/
|-- nginx/
|-- public-app/
|-- internal-app/
|-- tools/
`-- worker/
This lab intentionally includes:
- attacker-controlled HTML stored through the public flow
- unsafe rendering in the vulnerable internal view
- static lab credentials
- a JWT accessible from
localStorage
- OWASP Cross-Site Scripting:
https://owasp.org/www-community/attacks/xss/ - OWASP XSS Prevention Cheat Sheet:
https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html - MDN Web Storage API:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API - Docker Compose Networking:
https://docs.docker.com/compose/how-tos/networking/ - Nginx access controls:
https://nginx.org/en/docs/http/ngx_http_access_module.html