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

Photobomb

8 Oct 2022 · 10 min read · root access
Photobomb - maquina de Hack The Box

Executive summary — Photobomb is a very instructive Easy Linux box: an exposed JavaScript file (photobomb.js) leaks the Basic Auth credentials (pH0t0:b0Mb!) that unlock the printing panel /printer. That panel builds a system command from the filetype parameter without sanitising it, allowing command injection and a shell as wizard. Escalation abuses sudo with SETENV over a cleanup script that calls find without an absolute path: a textbook PATH hijack turns it into root. Path: creds in JS → command injection → PATH hijack → root.

PlatformHack The Box
Operating systemLinux
DifficultyEasy
StatusRetired
Target IP10.129.228.60

Attack map

[80] photobomb.htb (vhost) → photobomb.js leaks creds  pH0t0:b0Mb!
   │  Basic-Auth → /printer panel
   ▼
[RCE]  command injection in the filetype parameter (POST /printer)
   ▼
[SHELL]  wizard  (user.txt)
   │  sudo -l → (root) SETENV NOPASSWD /opt/cleanup.sh (calls find without an absolute path)
   ▼
[ROOT]  PATH hijacking (SETENV) → fake find → chmod 4755 /bin/bash → bash -p

1. Initial reconnaissance

nmap -sC -sV -oN nmap/targeted 10.129.228.60
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu
80/tcp open  http    nginx 1.18.0 (Ubuntu)

Only two services exposed: SSH and HTTP. The web server responds pointing to a virtual host, photobomb.htb, that doesn't resolve yet in our /etc/hosts — the obvious entry point is port 80.

🔒 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.