Cap HTB CTF Machine

Friday, Nov 14, 2025 | 2 minute read

Marcelo Bregieira
Cap HTB CTF Machine

Cap is an Linux machine running an HTTP server that performs administrative functions including performing network captures.

Let’s Get to Work!

First of all, like with all other machines, we have an IP address. Let’s start with enumeration. nmap result We see that three ports are open: 21 (FTP), 22 (SSH), and 80 (HTTP).

Let’s take a look at the HTTP service.

We’re presented with a dashboard. As we explore the site, which doesn’t have many active features, we navigate to Security Snapshot. nmap result From the URL, we notice it’s set to http://10.10.10.245/data/245. nmap result Examining the requests through BurpSuite, we see there’s no cookie or ID associated with it.

Smells like a vulnerability!

We change the URL to another number (a lower one) and can see other users’ data! Generally, the first entries tend to be the most interesting. nmap result So, we go to http://10.10.10.245/data/0 and download the file, which results in a .pcap file that we can analyze in Wireshark.

Analyzing the file, within the FTP protocol, we find a password in plain text, giving us the credentials nathan:B<snip>!. nmap result Let’s move on to the other services, starting with FTP. Using the credentials obtained from the .pcap file, we gain access! nmap result From there, we retrieve our first flag in user.txt. nmap result Now, let’s try the SSH service. Using the same credentials, we gain access again! nmap result Now, we want to escalate privileges to root! Using the command getcap -r / 2>/dev/null, we check which binaries have elevated privileges. nmap result We notice that python3.8 has some elevated capabilities. Let’s investigate further. After a quick search on GTFObins, we find that if CAP_SETUID is enabled on the Python binary, we can escalate privileges. nmap result As we can see from our getcap output, it’s enabled. So, using the command suggested by GTFObins, we escalate our privileges to root. nmap result And that’s how we obtain the root flag in the root folder. nmap result Another machine completed! On to the next one!

© 2024 - 2026 My Cybersecurity Blog

🌱 Powered by Hugo with theme Dream.

Who am I?

Hi! I’m Marcelo Bregieira, a Cybersecurity Engineer and First Sergeant in the Portuguese National Guard (GNR), working as digital forensics team leader.

I hold the Certified Penetration Testing Specialist (CPTS) certification from Hack The Box, and I have a strong passion in offensive security, vulnerability research, and real-world security challenges.

This blog is mainly dedicated to technical write-ups from Capture The Flag (CTF) challenges, labs, and other hands-on cybersecurity exercises. My goal is to document methodologies, tools, and lessons learned while solving these challenges, in a way that can help others improve their technical skills.

Occasionally, I will also explore other topics related to cybersecurity, such as digital forensics, investigative techniques, and security research.

Cybersecurity is a constantly evolving field, and continuous learning is essential. Through this blog, I hope to share knowledge, document my learning journey, and contribute to a stronger and safer digital ecosystem.

For contact me: mbregieira@hotmail.com