Cap
Executive summary — Cap is a very elegant Easy Linux box with no public exploit involved: everything rests on design flaws. An IDOR in a «security» dashboard lets us download another session's network capture (.pcap), where cleartext FTP credentials travel; with them we log into FTP and SSH (password reuse), and the final escalation abuses a Linux capability (
cap_setuid) granted topython3.8to become root without touchingsudoor SUID. An IDOR → PCAP → FTP/SSH → capabilities → root path.
| Platform | Hack The Box |
| Operating system | Linux |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.17.19 |
Attack map
[80] security dashboard · /capture → /data/1
│ IDOR: change the ID → /data/0 downloads 0.pcap (another session capture)
▼
[PCAP] Wireshark → cleartext FTP traffic → nathan:Buck3tH4TF0RM3!
▼
[FTP] login nathan → user.txt
▼
[SSH] nathan → interactive shell
│ find -perm -4000 → nothing useful · getcap → /usr/bin/python3.8 = cap_setuid+ep
▼
[ROOT] python3.8 -c "os.setuid(0); os.system('/bin/bash')"
1. Reconnaissance
As always, we start with a full port scan instead of trusting nmap's default top-1000: on HTB boxes you never know which «odd» service is hiding on a high port.
nmap -p- --open -n -T5 -v 10.129.17.19
Why these flags:
-p-→ scans all 65535 ports, not just the most common ones.--open→ only shows ports that answer as open, keeping the output clean.-n→ no DNS resolution, faster scan.-T5→ very aggressive timing template (lab network, no IDS to worry about).-v→ verbose mode, so ports show up as they're confirmed.
21/tcp open ftp
22/tcp open ssh
80/tcp open http
Analysis: three very classic services —FTP, SSH and HTTP—. The «web with something interesting + FTP with credentials + SSH to get in» pattern is common on Easy boxes, so we start with the web.
Resumen ejecutivo — Cap es un Linux Easy muy elegante en el que no hay un exploit público de por medio: todo se apoya en fallos de diseño. Un IDOR en un dashboard de «seguridad» permite descargar la captura de red (.pcap) de otra sesión, donde viajan credenciales FTP en texto claro; con ellas se entra por FTP y por SSH (reutilización de contraseña), y la escalada final abusa de una Linux capability (
cap_setuid) concedida apython3.8para convertirse en root sin pasar porsudoni por SUID. Recorrido IDOR → PCAP → FTP/SSH → capabilities → root.
| Plataforma | Hack The Box |
| Sistema operativo | Linux |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.17.19 |
Mapa del ataque
[80] dashboard de seguridad · /capture → /data/1
│ IDOR: cambiar el ID → /data/0 descarga 0.pcap (captura de otra sesión)
▼
[PCAP] Wireshark → tráfico FTP en claro → nathan:Buck3tH4TF0RM3!
▼
[FTP] login nathan → user.txt
▼
[SSH] nathan → shell interactiva
│ find -perm -4000 → nada útil · getcap → /usr/bin/python3.8 = cap_setuid+ep
▼
[ROOT] python3.8 -c "os.setuid(0); os.system('/bin/bash')"
1. Reconocimiento
Empezamos, como siempre, con un escaneo completo de puertos en lugar de fiarnos del top-1000 de nmap: en máquinas de HTB nunca se sabe qué servicio «raro» esconden en un puerto alto.
nmap -p- --open -n -T5 -v 10.129.17.19
Por qué estas flags:
-p-→ escanea los 65535 puertos, no solo los más comunes.--open→ muestra solo los puertos que responden abiertos, para no ensuciar la salida.-n→ sin resolución DNS, escaneo más rápido.-T5→ plantilla de tiempo muy agresiva (red de laboratorio, sin miedo a IDS).-v→ modo verbose, para ver los puertos según se van confirmando.
21/tcp open ftp
22/tcp open ssh
80/tcp open http
Análisis: tres servicios muy clásicos —FTP, SSH y HTTP—. El patrón «web con algo interesante + FTP con credenciales + SSH para entrar» es habitual en máquinas Easy, así que empezamos por la web.
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 accountEsto 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