All writeups

Cap

Easy HackTheBox Completed
EnumerationWebLinuxPrivesc

4 April 2026

HackTheBox — Cap (Easy)

Recon

nmap -sC -sV 10.129.19.233

FTP, SSH and a web app on 80: vsftpd 3.0.3 on 21, OpenSSH 8.2p1 on 22, and Gunicorn serving a "Security Dashboard" on 80.

Tried anonymous FTP first — no luck, it just rejected the login. So onto the web app. "Security Dashboard" had three things in the menu: /capture (a 5-second PCAP, always bounces you to /data/1), /ip (ifconfig output) and /netstat.

The fact that /capture always redirected to /data/1 made me curious what /data/0 would do. And there it was — a download button for an earlier PCAP that wasn't mine. Classic IDOR; the ID is just a sequential number with no access check.

Foothold

Pulled /download/0 and ran it through tshark:

curl -s http://10.129.19.233/download/0 -o capture.pcap
tshark -r capture.pcap -Y "ftp" -T fields -e ftp.request.command -e ftp.request.arg

FTP is plaintext, so the creds were just sitting there:

USER  nathan
PASS  [REDACTED]

Same password worked on SSH (credential reuse, of course):

ssh nathan@10.129.19.233

And user.txt was there. ([REDACTED])

Privesc

Checked capabilities — that is usually the first thing I do on a box named "Cap", and the name turned out to be a double hint (PCAP and capabilities):

getcap -r / 2>/dev/null
/usr/bin/python3.8 = cap_setuid,cap_net_bind_service+eip

cap_setuid on the Python binary means it can set its own UID to 0 without being SUID. Straight from GTFOBins:

python3.8 -c 'import os; os.setuid(0); os.system("bash")'

uid=0(root)

Root, root.txt. ([REDACTED])

What I took away

Whenever an endpoint redirects to /data/1, try /data/0 — sequential IDs without an access check are an IDOR waiting to happen. And the box name was a giveaway in hindsight: "Cap" pointed at both the capture file and Linux capabilities, I just didn't connect it until I was already at the getcap stage.

Want to try this CTF challenge yourself? Click here
🔒 Protect your IP while hacking — use a VPN NordVPN →
🚩 New to CTF? TryHackMe is perfect for beginners TryHackMe →