
이미지 1,2,3을 클릭하면 이미지가 바뀌면서 보인다.
<!doctype html> <html> <head> <!-- Internal game scripts/styles, mostly boring stuff --> <script src="/static/game-frame.js"></script> <link rel="stylesheet" href="/static/game-frame-styles.css" /> <!-- Load jQuery --> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"> </script> <script> function chooseTab(num) { // Dynamically load the appropriate image. var html = "Image " + parseInt(num) + "<br>"; html += "<img src='/static/level3/cloud" + num + ".jpg' />"; $('#tabContent').html(html); window.location.hash = num; // Select the current tab var tabs = document.querySelectorAll('.tab'); for (var i = 0; i < tabs.length; i++) { if (tabs[i].id == "tab" + parseInt(num)) { tabs[i].className = "tab active"; } else { tabs[i].className = "tab"; } } // Tell parent we've changed the tab top.postMessage(self.location.toString(), "*"); } window.onload = function() { chooseTab(unescape(self.location.hash.substr(1)) || "1"); } // Extra code so that we can communicate with the parent page window.addEventListener("message", function(event){ if (event.source == parent) { chooseTab(unescape(self.location.hash.substr(1))); } }, false); </script> </head> <body id="level3"> <div id="header"> <img id="logo" src="/static/logos/level3.png"> <span>Take a tour of our cloud data center.</a> </div> <div class="tab" id="tab1" onclick="chooseTab('1')">Image 1</div> <div class="tab" id="tab2" onclick="chooseTab('2')">Image 2</div> <div class="tab" id="tab3" onclick="chooseTab('3')">Image 3</div> <div id="tabContent"> </div> </body> </html>

영어는 참 어렵다;
1. 버그의 원인을 찾으려면 JavaScript를 검토하여 사용자 제공 입력을 처리하는 위치를 확인하십시오.
2. window.location 개체의 데이터 는 공격자의 영향을받을 수 있습니다.
3. 주입 지점을 식별했으면 새 HTML 요소를 몰래 들어가기 위해해야 할 일에 대해 생각해보십시오.
4. 이전과 마찬가지로 <script> ...페이로드로 사용 하면 페이지가로드 된 후에 추가 된 스크립트가 브라우저에서 실행되지 않기 때문에 작동하지 않습니다.
html += "<img src='/static/level3/cloud" + num + ".jpg' />";
코드에 이 부분이 있는데 num부분에 값을 넣는것 같다.onerror를 이용하여 level 2처럼 똑같이 입력하면 될것같다.

'hi' onerror=alert(1);>를 입력해주었다.

'Write-Up > XSS-game' 카테고리의 다른 글
[XSS game] xss-game level 6 (0) | 2021.01.26 |
---|---|
[XSS game] xss-game level 5 (0) | 2021.01.26 |
[XSS game] xss-game level 4 (0) | 2021.01.26 |
[XSS game] xss-game level 2 (0) | 2021.01.26 |
[XSS game] xss-game level 1 (0) | 2021.01.26 |