Wargame/Web

[XSS-GAME] Level3

월루이 2022. 6. 2. 11:18

https://xss-game.appspot.com/level3

 

https://xss-game.appspot.com/level3

Oops! Based on your browser cookies it seems like you haven't passed the previous level of the game. Please go back to the previous level and complete the challenge.

xss-game.appspot.com

 


문제

 

 

 

 

 

 


풀이

 

IMAGE 1, 2, 3을 클릭할 때마다, 각각에 해당되는 이미지가 보이면서

url에 frame#1, frame#2, frame#3으로 바뀌는 것을 볼 수 있다.

 

 

 

이번 문제는 코드를 보고 풀었다 !

코드에서는 다른건 볼 필요 없고, chooseTab 함수 부분만 눈여겨 보면 된다.

 

 

코드를 보니

⭐내가 넣는 값은 num 자리에 해당되는 것을 볼 수 있다.

 

 

 

 

Level 2에서 했던 것과 같이, onerror 함수를 사용해보자.

onerror 함수는 이미지를 로드할 때 오류가 발생하면 작동하는 함수라고 지난 시간에 말했다.

즉 그렇다면, 위의 경로(/static/level3/cloud "num" + .jpg)를 오류로 인식하게 하고, 뒤에 alert를 띄우게 하면 된다.

 

' onerror = "alert(document.domain)"

 

 

아래와 같이 뜨면 성공 !