반응형
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return render_template('login.html')
else:
userid = request.form.get('userid')
userpassword = request.form.get('userpassword')
res = query_db(f'select * from users where userid="{userid}" and userpassword="{userpassword}"')
if res:
userid = res[0]
if userid == 'admin':
return f'hello {userid} flag is {FLAG}'
return f'<script>alert("hello {userid}");history.go(-1);</script>'
return '<script>alert("wrong");history.go(-1);</script>'
admin으로 로그인하는 문제인데 userid만 admin이면 되고 pw는 상관없는 것 같다.
그래서 admin 뒷부분을 주석처리하고 pw는 아무거나 입력하여 해결했다.
admin"--
반응형
'Dreamhack > Web' 카테고리의 다른 글
XSS Filtering Bypass (0) | 2023.11.09 |
---|---|
[wargame.kr] fly me to the moon (0) | 2023.11.09 |
[wargame.kr] login filtering (0) | 2023.11.09 |
random-test (0) | 2023.11.09 |
Type c-j (0) | 2023.11.09 |