Inject
Executive summary — Inject is a well-rounded Easy Linux box. A Spring image-upload app exposes an LFI (
/show_image?img=) that lets us read/etc/passwdand the project'spom.xml, uncovering Spring Cloud Function 3.2.2, vulnerable to CVE-2022-22963 (SpEL injection). That gives RCE asfrank; an XML file in their home with cleartext credentials leads tophil. Finally, an automated root task runs Ansible playbooks from a directory writable by thestaffgroup (whichphilbelongs to): we drop a malicious playbook that sets the SUID bit onbashand get root. Path: LFI → SpEL RCE → frank → phil → Ansible → root.
| Platform | Hack The Box |
| Operating system | Linux |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.228.213 |
Attack map
[8080] Spring app → /upload → /show_image?img=.. → LFI (path traversal)
│ read /etc/passwd (frank, phil) → pom.xml → Spring Cloud Function 3.2.2
▼
[RCE] CVE-2022-22963 (SpEL in header spring.cloud.function.routing-expression)
▼
[SHELL] frank → XML with creds → su phil (user.txt)
│ ps aux → root-run ansible-parallel task in /opt/automation/tasks
│ directory drwxrwxr-x, group staff (phil is a member) → group-writable
▼
[ROOT] malicious playbook (chmod +s /bin/bash) → bash -p → root.txt
1. Reconnaissance
nmap -sVC 10.129.228.213
22/tcp ssh
8080/tcp http
The interesting port is 8080. Opening http://10.129.228.213:8080 in the browser shows an application with two relevant sections:
Blogs
Upload
The /upload section lets us upload a file and then view it back — usually fertile ground for file-handling vulnerabilities.
Resumen ejecutivo — Inject es un Linux Easy muy completo. Una app Spring con subida de imagenes expone un LFI (
/show_image?img=) con el que leemos/etc/passwdy elpom.xmldel proyecto, descubriendo Spring Cloud Function 3.2.2, vulnerable a CVE-2022-22963 (inyeccion SpEL). Eso da RCE comofrank; un XML con credenciales en su home nos lleva aphil. Finalmente, una tarea automatizada de root ejecuta playbooks de Ansible desde un directorio escribible por el grupostaff(al que pertenecephil): soltamos un playbook malicioso que activa el SUID enbashy obtenemos root. Recorrido LFI → SpEL RCE → frank → phil → Ansible → root.
| Plataforma | Hack The Box |
| Sistema operativo | Linux |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.228.213 |
Mapa del ataque
[8080] Spring app → /upload → /show_image?img=.. → LFI (path traversal)
│ leer /etc/passwd (frank, phil) → pom.xml → Spring Cloud Function 3.2.2
▼
[RCE] CVE-2022-22963 (SpEL en cabecera spring.cloud.function.routing-expression)
▼
[SHELL] frank → XML con creds → su phil (user.txt)
│ ps aux → cron/servicio root ejecuta ansible-parallel en /opt/automation/tasks
│ directorio drwxrwxr-x, grupo staff (phil es miembro) → escribible
▼
[ROOT] playbook malicioso (chmod +s /bin/bash) → bash -p → root.txt
1. Reconocimiento
nmap -sVC 10.129.228.213
22/tcp ssh
8080/tcp http
El puerto interesante es el 8080. Al abrir http://10.129.228.213:8080 en el navegador vemos una aplicacion con dos secciones relevantes:
Blogs
Upload
La seccion /upload permite subir un fichero y despues visualizarlo, lo cual suele ser terreno fertil para vulnerabilidades de manejo de ficheros.
This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.
See Root Access plansNo account? Create one free then upgrade from your console.
Este contenido es solo para Root Access. Todo lo demás del sitio — el nivel gratuito, toda la biblioteca pública — sigue abierto.
Ver planes de Root Access¿Sin cuenta? Crea una gratis y luego mejora desde tu consola.