HTB - Cap Writeup
๐พ Machine Overview
This is a writeup of the machine Cap from HTB, itโs an easy difficulty Linux machine which featured IDOR, PCAP forensics, and exploiting a Linux capability.
๐ Enumeration
I started off with an Nmap scan of the box:
1 | nmap -sV -sC -T4 -Pn 10.10.10.245 |
We can see SSH, FTP, and Web.
๐ FTP
I checked for anonymous FTP without any success.
We can see from our scan that this is running vsftpd 3.0.3. I found this exploit but itโs just a DOS.
๐ Web
Moving on to the website, weโre greeted with a fancy little security dashboard.

Thereโs some interesting pages including ip and netstat output.


Whatโs really interesting is the โSecurity Snapshotโ tab. Each time we browse to this page weโre given the opportunity to download a random network capture.

Itโs not really IDOR because thereโs no authentication for this app - but we can tumble the numerical ID here to find new PCAPs.

Using Burp Intruder we can tumble the values to discover that thereโs 12 PCAP files. I used the following command to download them all.
1 | for i in {0..13}; do wget "http://10.10.10.245/download/$i"; done |
Opening them in Wireshark, I saw cleartext credentials for Nathanโs FTP account.

We can use these to SSH in as Nathan and grab the user flag
โซ Privesc
As Nathan I dropped and ran LinPEAS which flagged some interesting Linux capabilities. Capabilities can let a binary perform a privileged action without being run as root or having full permissions.
1 | โโโโโโโโโโโโฃ Capabilities |
Notably we see /usr/bin/python3.8 = cap_setuid,cap_net_bind_service+eip. This means that the Python binary can be used to manipulate itโs own process ID to impersonate the root user.
We can run the following command to upgrade to a root shell and grab the flag.
1 | nathan@cap:~$ python3.8 -c 'import os; os.setuid(0); os.system("/bin/bash")' |
YIPPEE!!!!
- Title: HTB - Cap Writeup
- Author: Liam Geyer
- Created at : 2025-04-28 00:00:00
- Updated at : 2026-01-10 20:50:17
- Link: https://lfgberg.org/2025/04/28/htb/cap/
- License: This work is licensed under CC BY-NC-SA 4.0.