C:\Seyi\Portfolio\writeups\crack_the_gate_1_ Y:0000PX
...\writeups\crack_the_gate_1 Y:0000PX

< back to write-ups

CTF // EASY crack_the_gate_1.md

// Crack the Gate 1

Web Exploitation · Easy · CyLab Security Academy (picoMini by CMU-Africa)

// Summary

A login page is given with no password. The page's hidden code, which any visitor's browser receives, contains a developer's note scrambled with a simple letter shift. Unscrambled, it says that adding a specific label to the login skips the password check. Browsers do not let users add custom labels, so the request is sent from a command-line tool with the label attached, and the site lets it through. Comparable to a note taped inside a shop window saying "staff: say 'dev access' at the door and the guard waves you in."

// Objective

Given: a login page. No password is given.
Asked: the flag, format academy{...}, behind the login.
Type: implied.

// Recon

Ctrl+U (view source) — : <!-- ABGR: Wnpx - grzcbenel olcnff: hfr urnqre "K-Qri-Npprff: lrf" -->
-decode the comment — NOTE: Jack - temporary bypass: use "X-Dev-Access: yes"

// Deduction

  1. No password is given → the way in is something the site exposes → read the .
  2. The comment is letter-shifted text in a note's shape (ABGR: lines up with NOTE:) → ROT13 → decode it.
  3. The bypass is an HTTP header → a browser form cannot add custom headers → send the login request by hand with .

// Solve

  1. Run:
    curl -X POST <challenge-url>/login \
              -H "X-Dev-Access: yes" \
              -H "Content-Type: application/json" \
              -d '{"email":"<email>","password":"<any>"}'
    Result: the flag in the response body.

The email used is not recorded.

// Answer

Plain: the flag is what the site shows to someone who is logged in. It was reached by using the developer's shortcut instead of a password.
Technical: the login handler returns the flag when the request carries X-Dev-Access: yes, regardless of the password. The header was taken from a ROT13-encoded comment in the served HTML.

// Root cause

Flaw: a developer is left in production and documented in client-visible HTML.
CWE: CWE-615, sensitive information in source code comments; CWE-288, authentication bypass using an alternate path.
Fix: remove debug bypasses before deployment; strip comments from served HTML; never base authentication on a client-supplied header.
Real-world impact: anyone who views the page source can log in as a user without a password and read or change that account.

// Transfer

  • Login with no credentials given → view source first.
  • Text in a note's shape that reads as gibberish → try ROT13 / Caesar (CyberChef).
  • The server trusts a header → curl or Burp Repeater; the browser cannot set it.

// Index

  1. 1HTTP requestThe message a browser sends to a website asking for a page or submitting a form.
  2. 2HTML commentA note in a page's code (<!-- ... -->) that the browser does not display but anyone can read in the source.
  3. 3ROT13Replacing each letter with the one 13 places later in the alphabet. It hides nothing; applying it again restores the text.
  4. 4HeaderA labelled line attached to a request (e.g. X-Dev-Access: yes) that the server can read.
  5. 5Page sourceThe code behind a web page, sent to every visitor's browser. Ctrl+U shows it.
  6. 6curlA command-line tool that sends a request exactly as written, including any headers.
  7. 7Authentication bypassGetting past a login check without valid credentials.