https://dreamhack.io/wargame/challenges/830
STEP 1~2๋ฅผ ๊ฑฐ์ณ FLAG ํ์ด์ง์ ๋๋ฌํ๋ฉด ํ๋๊ทธ๊ฐ ์ถ๋ ฅ๋๋ ๋ฌธ์ ์ด๋ค.
ํ๋๊ทธ๋ flag.txt ํ์ผ๊ณผ FLAG ๋ณ์์ ์๋ค.
ํ๋๊ทธ ํ์์ DH{...} ์ด๋ค.
step1์ ํด๊ฒฐํ๊ธฐ ์ํด ์ ์๋ app.py๋ฅผ ํ์ธํด ๋ณด์๋ค.
app.route("/step1", methods=["GET", "POST"])
def step1():
if request.method == "GET":
prm1 = request.args.get("param", "")
prm2 = request.args.get("param2", "")
step1_text = "param : " + prm1 + "\nparam2 : " + prm2 + "\n"
if prm1 == "getget" and prm2 == "rerequest":
return redirect(url_for("step2", prev_step_num = step1_num))
return render_template("step1.html", text = step1_text)
else:
return render_template("step1.html", text = "Not POST")
prm1 == "getget" and prm2 == "rerequest": ์ผ ๋ step2๋ฅผ returnํ๋๊ฑธ ํ์ธํ ์ ์๋ค.
์์๋ธ prm1๊ณผ prm2๋ฅผ ์
๋ ฅํ์ฌ step2๋ก ์ด๋ํ๋ค.

step2๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ์ฝ๋๋ฅผ ๋ค์ํ๋ฒ ํ์ธํด ๋ณธ๋ค.
@app.route("/flag", methods=["GET", "POST"])
def flag():
if request.method == "GET":
return render_template("flag.html", flag_txt="Not yet")
else:
prm1 = request.form.get("param", "")
prm2 = request.form.get("param2", "")
if prm1 == "pooost" and prm2 == "requeeest":
return render_template("flag.html", flag_txt=FLAG)
else:
return redirect(url_for("step2", prev_step_num = str(step1_num)))
return render_template("flag.html", flag_txt="Not yet")
except:
return render_template("flag.html", flag_txt="Not yet")
์ด๋ if prm1 == "pooost" and prm2 == "requeeest": ์ผ ๋๋ง flag.html๋ฅผ returnํ๋๊ฑธ ํ์ธํ ์ ์๋ค.
์์๋ธ prm1๊ณผ prm2๋ฅผ ์ ๋ ฅํ๋ค.

์ฑ๊ณต์ ์ผ๋ก ํ๋๊ทธ๋ฅผ ํ๋ํ ์ ์์๋ค.
