Hack The World
XSS game: Level 4 Write up 본문
이번에는 게시판에 숫자를 입력후 타이머 생성버튼을 눌르면
해당 시간이 지나고 팝업창이 뜨는 형태의 게시판인거같다.


코드를 살펴보면
index.html 은
<!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" />
</head>
<body id="level4">
<img src="/static/logos/level4.png" />
<br>
<form action="" method="GET">
<input id="timer" name="timer" value="3">
<input id="button" type="submit" value="Create timer"> </form>
</form>
</body>
</html>
다음과 같고
timer.html은
<!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" />
<script>
function startTimer(seconds) {
seconds = parseInt(seconds) || 3;
setTimeout(function() {
window.confirm("Time is up!");
window.history.back();
}, seconds * 1000);
}
</script>
</head>
<body id="level4">
<img src="/static/logos/level4.png" />
<br>
<img src="/static/loading.gif" onload="startTimer('{{ timer }}');" />
<br>
<div id="message">Your timer will execute in {{ timer }} seconds.</div>
</body>
</html>
다음과 같다.
코드를 살펴보면 입력하는 타이머 부분은
onload="startTimer('{{timer}}');" /> 부분에 들어가는거같다.
크러면 해당 코드를 닫고 alert 창을 실행시키면 되기에
3}}');alert('1 명령어를 입력후 실행시키면 다음과 같이 alert 창 생성


'Wargame > XSS game' 카테고리의 다른 글
XSS game : Level 5 Write up (0) | 2020.03.23 |
---|---|
XSS game: Level 3 Write up (0) | 2020.03.13 |
XSS game: Level2 Write up (0) | 2020.03.12 |
XSS game: Level 1 Write up (0) | 2020.03.12 |