반응형
문제 풀이
소스코드
@app.route('/check')
def check():
input_flag = request.args.get('flag', '')
modified_input = input_flag.replace('flag', '')
if modified_input == 'flag' return FLAG
else return "Wrong input! Try again."
modified_input 값이 flag이면 FLAG를 확인할 수 있다. modified_input은 input_flag에서 replace함수로 처리된 결과이다. replace 함수는 1번만 변경하기 때문에 flflagag를 입력할 경우 flag가 반환이된다. 따라서 flag값에 flflagag를 입력하면 문제를 해결할 수 있다.
반응형
'WEB hacking > 드림핵(dreamhack)' 카테고리의 다른 글
드림핵 Dream Badge WriteUp (0) | 2025.01.26 |
---|---|
드림핵 baby-ai WriteUp (0) | 2025.01.25 |
드림핵 Find The Lost Flag WriteUp (0) | 2025.01.24 |
드림핵 Logical WriteUp (0) | 2025.01.24 |
드림핵 simple_sqli_chatgpt WriteUp (2) | 2023.09.09 |