惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
A
About on SuperTechFans
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
罗磊的独立博客
量子位
有赞技术团队
有赞技术团队
V
V2EX
Engineering at Meta
Engineering at Meta

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Hack The Box (HTB): Cap Machine (Full Walkthrough)
Abdelrahman A. Esmat · 2026-05-25 · via DEV Community

Abdelrahman A. Esmat

Welcome! In this article, we will try to solve the Cap Machine from HackTheBox and provide as many details as we can so it can be a reference for anyone who wants to recall any part of it.

Cap Machine Logo


Here are some details about the machine itself from the official website:

Level: Easy
OS: Linux
Machine URL: Hack The Box: Cap Machine
About: Cap is an easy difficulty Linux machine running an HTTP server that performs administrative functions including performing network captures. Improper controls result in Insecure Direct Object Reference (IDOR) giving access to another user’s capture. The capture contains plaintext credentials and can be used to gain foothold. A Linux capability is then leveraged to escalate to root.

Let’s get started:

Task 1: How many TCP ports are open?

Port Scanning with nmap

-Pn: if the machine is refusing the ping requests, port scan only.
-p-: if for scanning all ports.
-sC: Scan with default NSE scripts.
-sV: attempts to find the version of the service.
— min-rate 10000: Send packets no slower than 10000 per second.

So, as we can see, it’s 3 ports open: 21 (FTP), 22 (SSH), 80 (HTTP).

Answer: 3


Task 2: After running a “Security Snapshot”, the browser is redirected to a path of the format /[something]/[id], where [id] represents the id number of the scan. What is the [something]?

It’s a web enumeration task, let’s try the http port, so we write this domain in our website: http://10.129.5.192 (knowing that this ip is the target ip), and we get this page:

http://<target-ip>

  • with this side menu:

  • So we chose the third option as mentioned in the instructions of the task, and we got this page with this URL.

  • As we can see, the [something] part is data.

Answer: data.


Task 3: Are you able to get to other users’ scans?

We tried some ids from 0 to 10 on the URL instead of 1, and we found that ID 0 gives some packets in a .pcap file:

  • So, we downloaded the file, analysed it and found that it has network logs about the user and password of the account:

Username: nathan
Password: Buc**************
Answer: yes


Task 4: What is the ID of the PCAP file that contains sensitive data?

Answer: 0


Task 5: Which application layer protocol in the pcap file can the sensitive data be found in?

As we can see from the screenshot above from the wireshark analysis, it’s communicating via ftp.

Answer: ftp

Task 6: We’ve managed to collect Nathan’s FTP password. On what other service does this password work?

We’ll try getting access using ssh, by writing this command:

ssh nathan@10.129.5.192

And we got it:

  • When writing ls we found a file called user.txt, so we opened it using cat user.txt, and we found the user flag:

Answer: ssh


Task 7: Submit the flag located in the nathan user’s home directory.

Answer: d78******************************ba2


Task 8: What is the full path to the binary on this machine has special capabilities that can be abused to obtain root privileges?

To get the flag from the root’s home directory, we should do privilege escalation.

  • Assuming that the machine runs python as a root, we tried to run python commands so we run python3, then importing the os library to use it, choosing the user id 0 by writing this os.setuid(0), checking our privileges with os.system(‘whoami’), then we run the shell using os.system(‘sh’), then we accessed the root privileges so we open the file cat /root/root.txt, and we got the root flag.

Answer: /usr/bin/python3.8


Conclusion

This machine was a great exercise in enumeration and privilege escalation. It reinforced the importance of carefully analysing exposed services and reviewing file permissions for potential escalation vectors.

Thank you for reading this walkthrough. Any feedback or suggestions for improvement are always appreciated.