๋ฐ์ํ
https://dreamhack.io/wargame/challenges/830
๋ฌธ์
STEP 1~2๋ฅผ ๊ฑฐ์ณ FLAG ํ์ด์ง์ ๋๋ฌํ๋ฉด ํ๋๊ทธ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
๋ชจ๋ ๋จ๊ณ๋ฅผ ํต๊ณผํ์ฌ ํ๋๊ทธ๋ฅผ ํ๋ํ์ธ์. ํ๋๊ทธ๋ flag.txt ํ์ผ๊ณผ FLAG ๋ณ์์ ์์ต๋๋ค.
ํ๋๊ทธ ํ์์ DH{…} ์ ๋๋ค.
ํ์ด
๋ฌธ์ ํ์ผ์ ์ฝ์ ์๋ง ์์ผ๋ฉด ๋ฐ๋ก ํด๊ฒฐ๋๋ ๋ฌธ์
@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, prm2์ rerequest๋ฅผ ๋ฃ์ผ๋ฉด 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")
์ด์ชฝ ๋ํ ์ฝ๋์ ๋์์๋๋๋ก pooost ์ requeeest๋ฅผ ์ ๋ ฅํ๋ฉด
๋ต ํ๋๊ทธ๊ฐ ์ถ๋ ฅ๋๋ค
๋ฐ์ํ
'๐ Cyber Security > Web Hacking (์นํดํน)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[DreamHack] ๋๋ฆผํต ์นํดํน : session (0) | 2023.09.11 |
---|---|
[DreamHack] ๋๋ฆผํต ์นํดํน : pathtraversal (0) | 2023.08.14 |
[DreamHack] ๋๋ฆผํต ์นํดํน : blind-command (0) | 2023.07.31 |
[DreamHack] ๋๋ฆผํต ์นํดํน : Carve Party (0) | 2023.07.27 |
[DreamHack] ๋๋ฆผํต ์นํดํน: web-ssrf (0) | 2023.07.17 |