250x250
Notice
Recent Posts
Archives
Tags
- 오블완
- 누구나 쉽게 즐기는 c언어 콘서트 2장 연습문제 답
- simple-sqli
- 누구나 쉽게 즐기는 c언어 콘서트 2장 연습문제 풀이
- 프로그래머스
- Carve Party
- file-download-1
- 코딩테스트
- Flying Chars
- simplewebrequest
- Session-basic
- ex-reg-ex
- image-storage
- 누구나 쉽게 즐기는 c언어 콘서트 개정판
- 프로그래머스 해설
- 짝수의 합 c
- flag
- 티스토리챌린지
- cookie
- 누구나 쉽게 즐기는 c언어 콘서트 2장 연습문제
- 누구나 쉽게 즐기는 c언어 콘서트 3장 연습문제
- 누구나 쉽게 즐기는 c언어 콘서트 3장 연습문제 풀이
- 워게임
- 짝수의 합
- 누구나 쉽게 즐기는 c언어 콘서트 3장 연습문제 답
- proxy-1
- dreamhack
- babylinux
- 프로그래머스 짝수의 합
- web-misconf-1
보안 일기
[Dreamhack] cookie 풀이 본문
728x90
Description
쿠키로 인증 상태를 관리하는 간단한 로그인 서비스입니다. admin 계정으로 로그인에 성공하면 플래그를 획득할 수 있습니다.
풀이
step 1. 접속 정보 사이트로 접속
step 2. 문제 파일 다운로드 후 코드 확인
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return render_template('login.html')
elif request.method == 'POST':
username = request.form.get('username')
password = request.form.get('password')
try:
pw = users[username]
except:
return '<script>alert("not found user");history.go(-1);</script>'
if pw == password:
resp = make_response(redirect(url_for('index')) )
resp.set_cookie('username', username)
return resp
return '<script>alert("wrong password");history.go(-1);</script>'
→ guest/guest 계정이 default라, 일단 이 계정으로 로그인이 가능한 것을 확인 가능하다.
step 3. url창에 /login을 붙여서 login페이지로 들어간 후, guest : guest로 로그인해보자.
step 4. 마지막으로 개발자 도구를 열어 Application -> Cookies의 username을 guest에서 admin으로 변경해주고 새로고침해주면,
플래그가 나온다.
728x90
'웹해킹·취약점 분석 > dreamhack' 카테고리의 다른 글
[Dreamhack] 🌱 simple-web-request (Beginner) (0) | 2023.11.07 |
---|---|
[Dreamhack] proxy-1 (LEVEL 1) (0) | 2023.10.05 |
[Dreamhack] Carve Party (Beginner) (0) | 2023.10.05 |
[Dreamhack] devtools-sources (Beginner) (0) | 2023.10.03 |
[Dreamhack] session-basic (LEVEL 1) (0) | 2023.09.26 |