🌐 Irish-Name-Repo 3
A detailed write-up of the Web challenge 'Irish-Name-Repo 3' from PicoCTF - 2019
📊 Challenge Overview
Category Details Additional Info 🏆 Event PicoGym Event Link 🔰 Category Web 🌐 💎 Points 500 Out of 500 total ⭐ Difficulty 🟡 Medium Personal Rating: 2/10 👤 Author Xingyang Pan Profile 🎮 Solves (At the time of flag submission) 11.760 solve rate 📅 Date 23-02-2025 PicoGym 🦾 Solved By mH4ck3r0n3 Team:
📝 Challenge Information
There is a secure website running at https://jupiter.challenges.picoctf.org/problem/40742/ (link) or http://jupiter.challenges.picoctf.org:40742. Try to see if you can login as admin!
🎯 Challenge Files & Infrastructure
Provided Files
1
Files: None
🔍 Initial Analysis
First Steps
Initially, the website appears as follows:
This is the third in the series of
Irish-Name-Repo
challenges (Irish-Name-Repo 1, Irish-Name-Repo 2). Solving this challenge and inspecting the source of thelogin.html
page:As we can see, there is a
debug
parameter that is sent with a default value of0
in thePOST
request tologin.php
. By setting it to1
, I discovered that it was possible to view the executed query:As we can see in this case, we have the query
SELECT * FROM admin where password = ''
because I sent thepassword
parameter empty. By trying to send the payloadpassword=' OR 1=1 --
, I get:As we can see, in this case, we have the query
SELECT * FROM admin where password = ''
because I sent thepassword
parameter empty. By trying to send the payloadpassword=' OR 1=1 --
, I get:
1
SELECT * FROM admin where password = '' OR 1=1 -- '
So, I thought there might be some kind of filter applied, or encryption. Let’s move on to the exploitation phase.
🔬 Vulnerability Analysis
Potential Vulnerabilities
- SQL Injection
🎯 Solution Path
Exploitation Steps
Initial setup
First of all, we need to understand what kind of encoding is being applied to the text. Searching for cipher identifiers, I found the following: https://www.dcode.fr/cipher-identifier. Trying to input
BE 1=1 -- '
(the encoded text since it is the only part that differs from the original query), I couldn’t get anything.I received a
_Warning_ The text has a **short length**, this can affect the quantity and reliability of the results
. So I increased the length of the payload, for example, by sendingHi I'm mH4ck3r0n3 and I'm solving Irish-Name-Repo 3
, and I got:
1
SELECT * FROM admin where password = 'Uv V'z zU4px3e0a3 naq V'z fbyivat Vevfu-Anzr-Ercb 3'
So the encrypted text is:
Uv V'z zU4px3e0a3 naq V'z fbyivat Vevfu-Anzr-Ercb 3
. Trying to analyze this:I get as the first possible algorithm
ROT13
. So, I try to decode the encrypted text using CyberChef with theROT13
filter:As we can see, it has returned to the plain text previously sent as the payload:
Hi I'm mH4ck3r0n3 and I'm solving Irish-Name-Repo 3
. So it is aROT13 Encode
. Now that we know what type of algorithm is encoding our payload, let’s proceed to the exploitation phase.
Exploitation
The exploitation phase is very simple since by sending the payload
' OR 1=1 --
, the result is alwaysTrue
, because the final query becomes:
1
SELECT * FROM admin where password = '' OR 1=1 -- '
We will be able to access the
admin
page where the flag is contained. However, since aROT13 Encode
is applied to the payload, we can directly send aROT13 Encoded
payload, so that theROT13
text is converted to plain text, resulting in the final query as previously seen. This can be done using CyberChef with theROT13
filter:As we can see, we need to send the
ROT13
payload:' BE 1=1 --
. By doing so, we will be able to obtain the flag. (Another way to solve it was by directly sending the' OR 1=1 --
payload in plain text, extracting the encoded text by setting thedebug
value to1
, copying the encoded text, and sending it as a payload).
Flag capture
🛠️ Exploitation Process
Approach
The automatic exploit uses the
codecs
library to encode the payload inROT13
, then sends the request and extracts the flag from the response using a regex.
🚩 Flag Capture
Flag
Proof of Execution
🔧 Tools Used
Tool Purpose Python Exploit CyberChef Encoding DecodeFr Cipher Identification
💡 Key Learnings
Time Optimization
- To identify any encrypted text, immediately use https://www.dcode.fr/cipher-identifier.
- When we have a challenge that encrypts text and the algorithm is “bijective” or “reversible”, we can directly use the encrypted text provided by the challenge without wasting time figuring out which cipher was used for the encoding.
Skills Improved
- Binary Exploitation
- Reverse Engineering
- Web Exploitation
- Cryptography
- Forensics
- OSINT
- Miscellaneous
📚 References & Resources
Similar Challenges
Learning Resources
📊 Final Statistics
Metric | Value | Notes |
---|---|---|
Time to Solve | 00:10 | From start to flag |
Global Ranking (At the time of flag submission) | Challenge ranking | |
Points Earned | 500 | Team contribution |
Created: 23-02-2025 • Last Modified: 23-02-2025 *Author: mH4ck3r0n3 • Team: *