[DreamHack] [web] [Level 1] session-basic 풀이

2024. 12. 26. 15:38Information Security 정보보안/DreamHack

728x90

배울내용 

dreamhack,

web hacking,

개발자도구,

dreamhack 풀이,

dreamhack session-basic 문제,

dreamhack web 풀이 ,

session-basic,

session hijacking

 

 

 

문제

 

 

 

 


 코드에 답이 이미 나와있는상태라서 

 

별도의  긴 설명이 필요없다

 

 

코드를 보면 



@app.route('/admin')
def admin():
    # developer's note: review below commented code and uncomment it (TODO)

    #session_id = request.cookies.get('sessionid', None)
    #username = session_storage[session_id]
    #if username != 'admin':
    #    return render_template('index.html')

    return session_storage


 

이부분에서 인증을 해야하지만 주석처리를 해서 /admin 만해도 session_storage 를 return 하기 떄문이다 

그럼 값을 입력하면 아래처럼 나오는데 이번 목표는 admin 의 session 값만 확보하면 되는것이다 

 

 

 

그렇게 guest 로 되어진걸로 로그인하게 되면 F12 개발자 도구를 클릭한다음에 application 에 cookie 에 admin 의 쿠키값을 넣어주고 F5 하면 admin으로 로그인이 되어지게 된다.

 

 

 

 

그럼 기존에 아래처럼 되있던거에서 F5 를 누르게 되면

 

 

 

 

 

성공적으로 admin 으로 로그인이 가능하고 성공플레그를 뛰울수있게 된다 

 

728x90