root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat inject.md
// writeups

Inject

11 Mar 2023 · 10 min read · root access
Inject - maquina de Hack The Box

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/passwd and the project's pom.xml, uncovering Spring Cloud Function 3.2.2, vulnerable to CVE-2022-22963 (SpEL injection). That gives RCE as frank; an XML file in their home with cleartext credentials leads to phil. Finally, an automated root task runs Ansible playbooks from a directory writable by the staff group (which phil belongs to): we drop a malicious playbook that sets the SUID bit on bash and get root. Path: LFI → SpEL RCE → frank → phil → Ansible → root.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.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.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.