🌐 Paginator
A detailed write-up of the Web challenge 'Paginator' from NullCon Goa HackIM CTF - 2025
📊 Challenge Overview
Category Details Additional Info 🏆 Event Nullcon Goa HackIM 2025 CTF Event Link 🔰 Category Web 🌐 💎 Points 500 Out of 500 total ⭐ Difficulty 🟢 Easy Personal Rating: 1/10 👤 Author @gehaxelt Profile 🎮 Solves (At the time of flag submission) 257 solve rate 📅 Date 01-02-2025 Nullcon Goa HackIM 2025 CTF 🦾 Solved By mH4ck3r0n3 Team: QnQSec
📝 Challenge Information
There can’t much go wrong with pagination, right? http://52.59.124.14:5012
🎯 Challenge Files & Infrastructure
Provided Files
1Files: None
🔍 Initial Analysis
First Steps
Initially, the website appears as follows:
When I clicked on
show pages 2,10, it showed me the rows from the database by setting the parameterp=2,10. Then, I decided to click the link to the source, which directed me to/?source:I saved the source in the file
source.php. As we can see, a QUERY is made that retrieves all the pages by setting a minimum and maximum ID based on the parameterpwe pass. Let’s move on to the exploitation.
🔬 Vulnerability Analysis
Potential Vulnerabilities
- SQL Injection
🎯 Solution Path
Exploitation Steps
Initial setup
As we can notice, there is a check on the minimum value, so when passing
/?p=1,10 OR 1=1, I getthis post is not accessible. Therefore, I need to bypass that check, perhaps by setting the minimum value to2, for example.
Exploitation
Indeed, the exploit payload is exactly as follows:
/?p=2,10 OR 1=1. The query would then be:SELECT * FROM pages WHERE id>= 2 AND id<= 10 OR 1=1By setting the minimum value to 2, we bypass the check. UsingOR 1=1ensures that the query returns all the pages, so the page with the flag will also be displayed.As we can see from the source, the flag is encoded in
base64. So, using the terminal, I perform the decode and obtain the flag:
1echo "RU5Pe1NRTDFfVzF0aF8wdVRfQzBtbTRfVzBya3NfU29tZUhvdyF9" | base64 -d
Flag capture
🛠️ Exploitation Process
Approach
The exploit sends the request with the SQL Injection payload as the
pparameter, and then it extracts the flag inbase64format using a regex and decodes it.
🚩 Flag Capture
Flag
Proof of Execution
🔧 Tools Used
Tool Purpose Python Exploit
💡 Key Learnings
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
📊 Final Statistics
| Metric | Value | Notes |
|---|---|---|
| Time to Solve | 00:02 | From start to flag |
| Global Ranking | 23/595 | Challenge ranking |
| Points Earned | 500 | Team contribution |
Created: 01-02-2025 • Last Modified: 01-02-2025 *Author: mH4ck3r0n3 • Team: QnQSec