Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- 보안
- KITRI
- 웹해킹
- file download vulnerability
- 보안교육
- WEB
- loose comparison
- cookie
- cookie tampering
- web-misconf-1
- WarGame
- 드림핵
- Dreamhack
- 타입 변환 취약점
- 한국정보기술연구원
- type juggling
- cybersecurity
- WhiteHatSchool
- path traversal
- 화이트해커
- 정보보안
- dev-tools
- php
- Cross Site Script
- php7.4
- session hijacking
- 워게임
- 화이트햇스쿨
- webhacking
- 웹
Archives
- Today
- Total
xmi1e-vir.log
[Dreamhack] wargame '🌱 simple-web-request' write-up 본문
🌱 Biginner
문제링크
STEP 1~2를 거쳐 FLAG 페이지에 도달하면 플래그가 출력됩니다.
모든 단계를 통과하여 플래그를 획득하세요. 플래그는 flag.txt 파일과 FLAG 변수에 있습니다.
플래그 형식은 DH{...} 입니다.
📌문제 파악
주어진 웹사이트로 접속하면 아래와 같이 param, param2를 입력하는 창이 나온다.

📌 문제 풀이
코드를 살펴보면서 어떻게 풀어야할지 고민해보자
Step1
- 웹사이트 URL의 파라미터로 뭐가 들어갈지 입력하는 과정
- param: getget / param2: rerequest 넣어야 step2로 넘어갈 수 있음
@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")
- 값을 맞게 입력하면 step2로 넘어갈 수 있다.

Step2
- html 파일을 확인해보니, 입력값을 제출하면 flag페이지로 연결
{% block content %}
{% if prev_step_num and hidden_num %}
<form action="/flag" method="post">
<p>param <input type="text" name="param"/></p>
<p>param2 <input type="text" name="param2"/></p>
<input type="hidden" name="check" value="{{ hidden_num }}"/>
<input type="submit"/>
</form>
{% else %}
...
{% endif %}
- flag 페이지의 코드
- param: pooost / param2: requeeest 를 입력해야 통과할 수 있다는 것을 알수있다.
@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")
- 파악한 값을 입력하면 무난하게 flag를 얻을 수 있다.

'WARGAME > WEB' 카테고리의 다른 글
| [Dreamhack] wargame 'web-misconf-1' write-up (0) | 2025.09.19 |
|---|---|
| [Dreamhack] wargame 'session' write-up (0) | 2025.09.15 |
| [Dreamhack] wargame 'Flying Chars' write-up (0) | 2025.09.11 |
| [Dreamhack] wargame 'phpreg' write-up (0) | 2025.09.08 |
| [Dreamhack] wargame 'ex-reg-ex' write-up (0) | 2025.09.07 |