Include CTF Walkthrough | THM
Introduction
Hello
While progressing through the Web Application Pentester path on TryHackMe, I recently tackled the Include CTF challenge — right after finishing the Advanced Server-Side Attacks section.
That section was a crash course in some heavy-hitting vulnerabilities: insecure deserialization, SSRF, file inclusion and path traversal, race conditions, and prototype pollution. So, when I saw Include CTF pop up, I thought, “Perfect — time to put these fresh skills to the test.”
What I loved most about this CTF was how the vulnerabilities weren’t isolated “one-and-done” bugs. Each small win opened the door for the next, leading to a satisfying escalation chain. And honestly, those are my favorite types of CTFs — the ones where you feel like a digital detective, following a trail of breadcrumbs all the way to root.
Challenge Objectives
The task was simple in wording but broad in execution:
Use your server exploitation skills to take control of a web app.
Two specific flags were required:
- Flag 1: What is the flag value after logging in to the SysMon app?
- Flag 2: What is the content of the hidden text file in
/var/www/html?
With the goals clear, I moved on to reconnaissance and exploitation.
1. Reconnaissance — Scanning the Battlefield
I began with a full TCP port scan to map out the attack surface:
nmap -p- -Pn -n --open -T5 -vvv 10.10.67.107The scan revealed several interesting ports — SSH (22), mail services (25, 110, 143, 993, 995), and two HTTP services on 4000 and 50000.
2. Exploring the Web Apps
I visited both http://10.10.67.107:50000 and http://10.10.67.107:4000 to see what services were running.
The first one, http://10.10.67.107:50000, hosted the SysMon app. Since Flag 1 required logging into SysMon, my first instinct was to try some common default credentials — but no luck.
Switching over to http://10.10.67.107:4000, I found a Review App login page. This one was more welcoming — the credentials guest/guest were provided, and I was able to log in successfully.
Once inside, I explored the application as a normal user to understand its features. I even added a few friends just to see how the app handled data.
Two things caught my attention:
- The user profile page displayed an
isAdminfield set tofalse. That’s unusual — why would the client-side need to know about admin privileges? It immediately made me wonder if it could be manipulated. - A “Recommend an activity” form allowed me to submit suggestions. I started by submitting a normal recommendation to observe the request flow and see how the server processed it.
3. Flipping the Admin Switch
Inside the Review App, I decided to test a small hunch. On David’s profile, I noticed the isAdmin field was set to false. I wondered — what if I could just change this value?
Get Betelhem Solomon’s stories in your inbox
Join Medium for free to get updates from this writer.
I edited David’s profile, flipping isAdmin from false to true, and the change actually saved. That confirmed the server wasn’t validating this field at all.
Next, I tried the same trick on my own guest account. Boom — it worked. I was now an Admin.
4. Discovering Sensitive API Data
Now with admin privileges, new doors opened. I found an API page listing usernames — but no passwords.
Then I hit the Settings page, which let me change the background image. I wondered, “What if the background image URL could pull files from inside the network?”
I tried pointing it to the internal API URL I’d discovered earlier. And boom! The app fetched Base64-encoded user credentials for me. Jackpot.
5. Credential Harvesting and Lateral Movement
I decoded those Base64 strings to get valid usernames and passwords for both the Review App and SysMon.
Logging into SysMon with the stolen creds was smooth. Inside, I found Flag #1 waiting for me.
6. Digging Deeper — Path Traversal for Flag #2
Flag #2 required some root cause analysis, literally.
I tried SSH with the stolen SysMon creds, but no luck there.
Then I started poking around the SysMon interface. I noticed a function that let me set images by specifying paths. Immediately, I thought: “Path traversal?”
With Burp Suite Intruder, I fuzzed the image path input with https://github.com/danielmiessler/SecLists/blob/master/Fuzzing/LFI/LFI-Jhaddix.txt to try and pull the classic sensitive file.
It worked. The contents of /etc/passwd came flooding back
After successfully pulling the contents of /etc/passwd, I scanned through it and spotted two user accounts that stood out: joshua and charles. I thought, “Alright, these might be the next footholds.”
Time to get to work — I fired up Hydra to brute force SSH passwords for these users. After a bit of grinding, I finally cracked the password for joshua. Sweet!
joshua -p rockyou.txt ssh://10.10.67.1077. Final Access & Flag #2
With joshua’s credentials, I gained remote SSH access:
ssh joshua@10.10.67.107Exploring /var/www/html, the web root directory, I uncovered the second flag
Mitigation
- IDOR: Check permissions on the server, not in the browser.
- Path Traversal: Only allow file paths from a safe list.
- Brute Force SSH: Use strong passwords and lock accounts after failed attempts.
- LFI: Don’t include files based on user input.
- SSRF: Block requests to internal networks and use a safe-list of URLs.
Final Thoughts
This CTF was a textbook example of chaining small oversights into a full compromise. From a guest login to admin takeover, credential harvesting, lateral movement, and path traversal — it’s all about following the breadcrumbs patiently and creatively.








