Sitemap
Betelhem Solomon

Betelhem Solomon

Include CTF Walkthrough | THM

6 min readAug 13, 2025

--

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.”

Press enter or click to view image in full size

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.107
Press enter or click to view image in full size

The 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.

Press enter or click to view image in full size
Press enter or click to view image in full size

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.

Press enter or click to view image in full size

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 isAdmin field set to false. 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.
Press enter or click to view image in full size

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.

Press enter or click to view image in full size

Next, I tried the same trick on my own guest account. Boom — it worked. I was now an Admin.

Press enter or click to view image in full size

4. Discovering Sensitive API Data

Now with admin privileges, new doors opened. I found an API page listing usernames — but no passwords.

Press enter or click to view image in full size

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?”

Press enter or click to view image in full size

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.

Press enter or click to view image in full size

5. Credential Harvesting and Lateral Movement

I decoded those Base64 strings to get valid usernames and passwords for both the Review App and SysMon.

Press enter or click to view image in full size

Logging into SysMon with the stolen creds was smooth. Inside, I found Flag #1 waiting for me.

Press enter or click to view image in full size

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?”

Press enter or click to view image in full size
Press enter or click to view image in full size

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.

Press enter or click to view image in full size
Press enter or click to view image in full size

It worked. The contents of /etc/passwd came flooding back

Press enter or click to view image in full size

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.107
Press enter or click to view image in full size

7. Final Access & Flag #2

With joshua’s credentials, I gained remote SSH access:

ssh joshua@10.10.67.107

Exploring /var/www/html, the web root directory, I uncovered the second flag

Press enter or click to view image in full size

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.

--