Intentions
Executive summary — Intentions is an image gallery built on Laravel (PHP backend) with a single-page Vue frontend, and none of its steps rely on a public CVE: the whole chain is built by stringing together application-specific logic and design flaws. An administration JavaScript bundle leaked without any access control reveals a privileged API v2. A second-order SQL injection in the user's genre-preference flow extracts the administrators' bcrypt hashes — hashes that, thanks to a login endpoint that compares the client-supplied hash instead of the password, turn straight into working credentials without ever needing to be cracked. With an admin session, abusing ImageMagick's pseudo-protocols (
vid:/msl:/caption:) delivers remote code execution aswww-data. The.envfile and the git history leak a developer's real password for the jump to a system user, and the final escalation abuses thecap_dac_read_searchLinux capability on a "copyright scanner" binary, turning it into an MD5 oracle that rebuilds root's private SSH key one byte at a time, never reading it directly.
| Platform | Hack The Box |
| Operating system | Ubuntu 22.04 (Jammy) — nginx 1.18.0 + PHP/Laravel, MySQL, ImageMagick (Imagick) |
| Difficulty | Hard |
| Status | Retired |
| Target IP | <TARGET_IP> |
Attack map
[80/HTTP] Laravel SPA -- admin.js leaked without authorization
| reveals the API v2 (admin) routes
v
[2nd-order SQLi] genres -> feed -- space filter (/**/) and # terminator
| UNION SELECT ... from users -> bcrypt hashes for steve and greg (admin=1)
v
[AUTH] POST /api/v2/auth/login {email,hash} -- compares the SUPPLIED hash
| logs in as steve WITHOUT cracking bcrypt -> admin session
v
[RCE] /api/v2/admin/image/modify -- path=vid:msl:/tmp/php* + MSL file
| Imagick processes the upload as a script -> webshell -> www-data
v
[POST-EXP] .env + git history (HOME=/tmp) -- test commit
| greg's real password leaked -> SSH -> user.txt
v
[ROOT] /opt/scanner/scanner (cap_dac_read_search) -- byte-by-byte MD5 oracle
| /root/.ssh/id_rsa rebuilt without ever reading it -> SSH root -> root.txt
1. Reconnaissance
A ttl≈63 on the ping suggests Linux (initial TTL 64, one router hop). Full high-rate TCP port scan:
sudo nmap -p- --min-rate 3000 -T4 -Pn -oN nmap-allports.txt <TARGET_IP>
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Only two ports. Version and script detection against both:
sudo nmap -p22,80 -sCV -Pn -oN nmap-services.txt <TARGET_IP>
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Intentions
OpenSSH 8.9p1 Ubuntu 3ubuntu0.1identifies Ubuntu 22.04 (Jammy). With only SSH and nginx exposed, the real attack surface is entirely HTTP — SSH will be the destination once credentials are obtained, not the way in.
Root Access unlocks the content you can't see — everything else on the site is already open.
See Root Access plansNo account? Create one free then upgrade from your console.