사자자리
[XSS game] 4. Google Reader 본문
Level 4: http://www.xssgame.com/__58a1wgqGgI

XSS는 데이터를 올바르게 escaping하는 것만이 아니다. 때때로, 공격자는 DOM에 새로운 elements를 injecting하지 않고도 나쁜 일을 저지를 수 있다. 이 레벨의 목표는 전과 같이 JavaScript의 alert 함수를 실행시키는 것이다. 중요한 점은, 사용자 상호작용이 필요하지 않은 해결이어야 한다는 것이다 - URL을 여는 것은 alert 함수를 실행시키기에 충분하다. 또한, alert 함수는 challenge domain에서 pop up해야 한다. 자신의 웹페이지로 redirecting하고 alert 함수를 실행시키는 것은 유효한 해결이 아니다.




<!--http://www.xssgame.com/f/__58a1wgqGgI/-->
<!--welcome 페이지-->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/static/css/level_style.css" />
<script src="/static/js/js_frame.js"></script>
</head>
<body style="background-color: white;">
<center>
Welcome! Today we are announcing the much anticipated<br>
<img src="/static/img/googlereader.png" /><br>
<a href="signup?next=confirm">Sign up</a> for an exclusive Beta.
</center>
</body>
</html>
img와 a태그만 있다.
<!--http://www.xssgame.com/f/__58a1wgqGgI/signup?next=confirm-->
<!--signup 페이지-->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/static/css/level_style.css" />
<script src="/static/js/js_frame.js"></script>
</head>
<body>
<center>
<img src="/static/img/googlereader-logo.png" /><br><br>
<!-- We're ignoring the email, but the poor user will never know! -->
Enter email: <input id="reader-email" name="email" value="">
<br><br>
<a href="confirm?next=welcome">Next >></a>
</center>
</body>
</html>
input 태그가 있지만, 입력한 이메일을 무시한다고 나와있다.
<!--http://www.xssgame.com/f/__58a1wgqGgI/confirm?next=welcome-->
<!--confirm 페이지-->
<!DOCTYPE html>
<html>
<head>
<script src="/static/js/js_frame.js"></script>
</head>
<body style="background-color: white;">
<center>
<img src="/static/img/googlereader-logo.png" /><br><br>
Thanks for signing up, you will be redirected soon...
<script>
setTimeout(function() { window.location = 'welcome'; }, 1000);
</script>
</center>
</body>
</html>
window.location = 'welcome'을 통해 welcome 페이지로 이동한다.
https://thingsthis.tistory.com/130
A 태그(Ahchor) 에서의 href, onclick 사용
안녕하세요. 이번에는 프로그래밍 관련 게시글을 하나 적어볼까 합니다. 아래 문제는 아주 오래전에 겪어봐서 알아두었던 건데 최근에 깜빡하고 다시 똑같은 실수를 범해서 그냥 다시 한번 참
thingsthis.tistory.com
http://www.xssgame.com/f/__58a1wgqGgI/confirm?next=javascript:alert()
URL에 confimr?next=javascript:alert() 를 입력한다.


Level 5: http://www.xssgame.com/JFTG_t7t3N-P
'웹해킹 > XSS game' 카테고리의 다른 글
| [XSS game] 3. Gallery (0) | 2022.08.22 |
|---|---|
| [XSS game] 2. Time's out! (0) | 2022.08.13 |
| [XSS game] 1. Foogle (0) | 2022.08.13 |
| [XSS game] Level 1: Hello, world of XSS (0) | 2022.08.09 |