https://dreamhack.io/wargame/challenges/830

들어가보면 이렇다.

step1을 누르면 이렇게 뜬다.

step2를 누르면 이렇게 뜬다. 아마 step1을 해결해야 열리지않을까 싶다.

소스 코드를 확인해보았다.
@app.route("/")
def index():
return render_template("index.html")
@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")
@app.route("/step2", methods=["GET", "POST"])
def step2():
if request.method == "GET":
:
:
else:
return render_template("step2.html", text="Not POST")
@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")
step1은 풀이가 매우 쉽다.
그냥 param = getget, param2 = rerequest 입력해주면 된다.
step1_text = "param : " + prm1 + "\nparam2 : " + prm2 + "\n"
if prm1 == "getget" and prm2 == "rerequest":
return redirect(url_for("step2", prev_step_num = step1_num))

step2로 들어왔다.

또 코드를 살펴보면
prm1 = request.form.get("param", "")
prm2 = request.form.get("param2", "")
if prm1 == "pooost" and prm2 == "requeeest":
return render_template("flag.html", flag_txt=FLAG)
param = pooost, param2 = requeeest를 입력하면 flag로 도달할 수 있다는 것을 알게되었다.
입력해주면

flag가 나오는 것을 알 수 있다.
