Post

Escaping the Corridor - TryHackMe: A Guide to IDOR and MD5 Obfuscation

Can you escape the Corridor?

Escaping the Corridor - TryHackMe: A Guide to IDOR and MD5 Obfuscation

Can you escape the Corridor?


Escaping the Corridor — TryHackMe Room Walkthrough

Can you escape the Corridor?image

Room link: https://tryhackme.com/room/corridor

Escaping the Corridor: A Guide to IDOR and MD5 Obfuscation

In the world of Capture The Flag (CTF) challenges, sometimes the most complex-looking URLs are hiding very simple logic. This write-up explores the “Corridor” room on TryHackMe, a challenge designed to test your ability to spot Insecure Direct Object Reference (IDOR) vulnerability.

The Challenge

Upon entering the “Corridor,” you are placed in a strange hallway and asked to find your way back. The room explicitly hints that you should examine URL endpoints, noting that the hexadecimal values found there look “an awful lot like a hash”.

The objective is to uncover website locations you were not expected to access by manipulating these values.

Step 1: Reconnaissance and Pattern Recognition

As I navigated the site, I noticed the URL structure changed as I entered different “rooms.”image

For example, one URL ended in the hash: 8f14e45fceea167a5a36dedd4bea2543image

Suspecting this was a hash, I utilized a cracking tool to identify the algorithm and the plaintext value.

  • The Hash: 8f14e45fceea167a5a36dedd4bea2543.- The Algorithm: The tool identified it as MD5.- The Result: The hash cracked instantly to the number 7.

image

Step 2: The Logic Gap

This revelation confirmed the IDOR vulnerability. The website organizes rooms numerically, but instead of using id=7, it uses id=md5(7).

I observed that the visible doors in the corridor are numbered from 1 to 13. To capture the flag, I needed to find a room number that existed on the server but wasn’t listed in the UI.

Step 3: exploiting the Vulnerability

My first instinct was to check the next sequential number.

  • Input: 14.- MD5 Hash: aab3238922bcc25a6f606eb525ffdc56.

image

  • Result: When I navigated to this hash, the server returned a 404 Not Found.

image

Since moving forward (to 14) didn’t work, I decided to move backward. In array indexing and computer science, counting often starts at zero.

I used an MD5 encrypter to generate the hash for the number 0:

  • Input: 0.- MD5 Hash: cfcd208495d565ef66e7dff9f98764da.

image

I manually constructed the malicious URL by appending this new hash to the base IP address:

http://<MACHINE_IP>/cfcd208495d565ef66e7dff9f98764da

Conclusion

The exploit was successful. Navigating to the hash for room “0” bypassed the restricted user interface and revealed the hidden page containing the flag.image

Thank you for reading my write-up. I hope you found it helpful.

This post is licensed under CC BY 4.0 by the author.