top of page

Swamp CTF 2025 - Web Walkthrough Part 1

  • Writer: Akshay Jain
    Akshay Jain
  • Apr 3
  • 2 min read

Swamp CTF Web Challenge 1: Serialies

Description:

We are given a link to the server and the zip file containing the source code


Walkthrough:

Upon visiting the provided URL, we are met with an error page. However, the error description hints at a potential subdirectory: /error


Error Page
Error Page

Navigating to /error doesn’t reveal anything useful, so we proceed with directory enumeration. Since the application lacks visible routes, I use Gobuster, a powerful directory brute-force scanning tool, to discover hidden paths.

Gobuster is a brute-force scanner tool to enumerate directories and files of websites. It will also assist in finding DNS subdomains and virtual host names. Gobuster is written in the Go programming language and is designed to function similarly to other tools like Dirbuster.

The general syntax for directory enumeration using gobuster is:

gobuster dir -u <url> -w <wordlist.txt> -x <file_extensions>

While waiting for the scan results, I pivoted to source code analysis to look for additional clues. While scanning through the code, I stumbled upon a function referencing another hidden subdirectory - /api/person


/api/person
/api/person

Upon visiting the sub directory we find JACKPOT!!

We uncover a list of user records. Scanning through these records, we find a special attribute - a flag embedded in one of the user entries!


Swamp CTF Web Challenge 1: Serialies

Description:

We are given a link to the server and the zip file containing the source code



Walkthrough:

Since we are provided with the link, I visited the link to understand what the application is about and to my surprise it displays an error page.







Error Page

The error description however gives us a hint related to /error sub directory. I visited the sub directory but no useful information there. 
As an attempt to check what other sub directories are present, I initiated a directory enumeration scan using 'gobuster'.

Gobuster is a brute-force scanner tool to enumerate directories and files of websites. It will also assist in finding DNS subdomains and virtual host names. Gobuster is written in the Go programming language and is designed to function similarly to other tools like Dirbuster.

The general syntax for directory enumeration using gobuster is:

gobuster dir -u <url> -w <wordlist.txt> -x <file_extensions>



While the scan was running, I decided to dig through the source code to see if we find any other useful information. While browsing through the code, I cam across an interesting function which hinted towards the presence of another sub directory - /api/person







/api/person



Upon visiting the sub directory we find JACKPOT!!

We come across a list of people with all their attributes that have been created up until now. Browsing through the list of users, we come across one such user which has the flag set as one of the attributes







Flag Captured!
Flag Captured!

And thus Flag Captured! - swampCTF{f1l3_r34d_4nd_d3s3r14l1z3_pwn4g3_x7q9z2r5v8}


Swamp CTF Web Challenge 2: Hidden Message-Board

Description:

Somewhere on this message-board is a hidden flag. Nothing has worked so far but we have noticed a weird comment in the HTML. Maybe it's a clue?

We are given a link to the server


Walkthrough:

As usual, we first visit the link to get a feel of the application and understand what it does and features are available to us.

The application appears to be a message board that simply displays the message you enter


Message Board
Message Board

Seeing the description and that it accepts HTML tags as input, my brain immediately shifted towards XSS.

I tried to work with a few payloads to observer the intended behavior and how the application handles the payloads. Since XSS attempts failed, I turned to browser Developer Tools for deeper insights. Inspecting the page’s HTML source code, I discovered an unusual parameter influencing the flag’s value:


Clue 1
Clue 1??

Despite multiple attempts to manipulate the parameter (e.g., injecting it via comments and scripts), nothing seemed to work.


So I resumed my journey of code exploration to see if there are anymore hints. Upon spending an hour on code review, I came across the /static/js/bundle.js file where in I find a reference to the file from where the flag value is being captured


Flag reference
Flag reference

So visiting the sub directory - http://chals.swampctf.com:43333/static/media/flag.d93dd6a8616cc31d36db.txt reveals the flag - swampCTF{Cr0ss_S1t3_Scr1pt1ng_0r_XSS_c4n_ch4ng3_w3bs1t3s}


I hope you found this walkthrough as enjoyable to read as I did while solving these challenges! If you have any thoughts, feel free to share them in the comments. Would you like to see more CTF walkthroughs like this?

Join the community forum to connect with fellow cybersecurity enthusiasts, form teams, and participate in upcoming CTF events!


-AJ



1 Comment

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Akshay Jain
Akshay Jain
Apr 03

A useful broser extension to view raw webpage response is - JSON Formatter. This allows you to pretty print the output and display it in a more readable format

Like
bottom of page