Iriton's log

[XSS game] Lv.5 : Breaking protocol 본문

WebHacking/WarGame

[XSS game] Lv.5 : Breaking protocol

Iriton 2023. 11. 7. 19:40

웹 페이지 흐름은 아래와 같다.

첫 welcome 페이지

Sign up 하이퍼링크 타고 가면

 

Signup 페이지가 뜬다

유심히 볼 것은 URL인데, next=confirm 으로 입력되어 있다.

Next 버튼을 누르면

/confirm으로 이동한다.

next 인자 값에 따라 페이지가 바뀌나 싶어서 py 코드를 살펴 보았다.

 

 # Route the request to the appropriate template
    if "signup" in self.request.path:
      self.render_template('signup.html', 
        {'next': self.request.get('next')})
    elif "confirm" in self.request.path:
      self.render_template('confirm.html', 
        {'next': self.request.get('next', 'welcome')})
    else:
      self.render_template('welcome.html', {})
     
    return

signup이 포함되면 signup 페이지로 이동, confirm도 마찬가지다.

그 외의 값이면 첫 페이지로 이동한다.

 

url에서 html 파일로 이동하는 거 대신에, alert() 가 실행되도록 하려면 어떻게 해야 될까?

우선 파이썬 코드 내에서 자바스크립트를 삽입하려면 어떻게 해야 되는지부터 알아 보자.

 

https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html

 

XSS Filter Evasion - OWASP Cheat Sheet Series

XSS Filter Evasion Cheat Sheet Introduction This article is focused on providing application security testing professionals with a guide to assist in Cross Site Scripting testing. The initial contents of this article were donated to OWASP by RSnake, from h

cheatsheetseries.owasp.org

 

'WebHacking > WarGame' 카테고리의 다른 글

[Dreamhack] Lv.1 csrf-2  (0) 2023.11.13
[Dreamhack] Lv.1 XSS Filtering Bypass  (0) 2023.11.13
[Dreamhack] Lv.1 xss-2  (0) 2023.11.07
[Dreamhack] Lv.1 xss-1  (0) 2023.11.07
[Dreamhack] Lv.2 DOM XSS  (0) 2023.11.07
Comments